Skip to content

Commit 7dba356

Browse files
committed
Don't add shadow stack to debug calls.
After merging upstream LLVM, some yk langtester tests failed, due to extra debug calls appearing in the AOT IR. Investigating this I noticed that we are inserting shadowstack calculations before and after debug calls, which isn't necessary since those calls are removed in the JIT IR anyway. Incidentally, this also resolves the tests failures without changing (most of) them.
1 parent 77ddc62 commit 7dba356

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

llvm/lib/Transforms/Yk/ShadowStack.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,11 @@ class YkShadowStack : public ModulePass {
193193
if (CI.getCalledFunction()->getName() ==
194194
"llvm.experimental.stackmap") {
195195
continue;
196-
} else if (CI.getCalledFunction()->getName() ==
197-
"llvm.dbg.declare") {
196+
}
197+
if (CI.getCalledFunction()->getName() == "llvm.dbg.declare") {
198+
continue;
199+
}
200+
if (CI.getCalledFunction()->getName() == "llvm.dbg.value") {
198201
continue;
199202
}
200203
}

llvm/lib/Transforms/Yk/StackMaps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class YkStackmaps : public ModulePass {
9191
// Insert the stackmap call after (not before) the call instruction, so
9292
// the offset of the stackmap entry will record the instruction after
9393
// the call, which is where we want to continue after deoptimisation.
94-
Bldr.SetInsertPoint(I->getNextNonDebugInstruction());
94+
Bldr.SetInsertPoint(I->getNextNode());
9595
}
9696
Bldr.CreateCall(SMFunc->getFunctionType(), SMFunc,
9797
ArrayRef<Value *>(Args));

0 commit comments

Comments
 (0)