|
63 | 63 | // value that indicates if we should start/stop tracing, or jump to machine |
64 | 64 | // code etc. |
65 | 65 | // |
66 | | -// - Because we haven't yet implemented guards or trace stitching, a machine |
67 | | -// code trace will always return to the interpreter after one full run of |
68 | | -// the traced interpreter loop. This means that the JIT doesn't yet |
69 | | -// correctly implement the right program semantics. When we have trace |
70 | | -// stitching, a machine code trace will only return upon a guard failure. |
| 66 | +// - Guards are currently assumed to abort the program. |
| 67 | +// https://github.com/ykjit/yk/issues/443 |
71 | 68 | // |
| 69 | +// - The block that performs the call to JITted code branches back to itself |
| 70 | +// to achieve rudimentary trace stitching. The looping should really be |
| 71 | +// implemented in the JITted code itself so that it isn't necessary to |
| 72 | +// repeatedly enter and exit the JITted code. |
| 73 | +// https://github.com/ykjit/yk/issues/442 |
72 | 74 | //===----------------------------------------------------------------------===// |
73 | 75 |
|
74 | 76 | #include "llvm/Transforms/Yk/ControlPoint.h" |
@@ -214,7 +216,7 @@ void createControlPoint(Module &Mod, Function *F, std::vector<Value *> LiveVars, |
214 | 216 | CallInst *CTResult = Builder.CreateCall(FType, CastTrace, F->getArg(1)); |
215 | 217 | createJITStatePrint(Builder, &Mod, "exit-jit-code"); |
216 | 218 | CTResult->setTailCall(true); |
217 | | - Builder.CreateBr(BBReturn); |
| 219 | + Builder.CreateBr(BBExecuteTrace); |
218 | 220 |
|
219 | 221 | // Create block that decides when to stop tracing. |
220 | 222 | Builder.SetInsertPoint(BBTracing); |
@@ -243,7 +245,6 @@ void createControlPoint(Module &Mod, Function *F, std::vector<Value *> LiveVars, |
243 | 245 | Value *YkCtrlPointVars = F->getArg(1); |
244 | 246 | PHINode *Phi = Builder.CreatePHI(YkCtrlPointStruct, 3); |
245 | 247 | Phi->addIncoming(YkCtrlPointVars, BBHasTrace); |
246 | | - Phi->addIncoming(CTResult, BBExecuteTrace); |
247 | 248 | Phi->addIncoming(YkCtrlPointVars, BBTracing); |
248 | 249 | Phi->addIncoming(YkCtrlPointVars, BBHasNoTrace); |
249 | 250 | Phi->addIncoming(YkCtrlPointVars, BBStopTracing); |
|
0 commit comments