Skip to content

Commit b8e6716

Browse files
committed
Emit stackmaps for all indirect calls.
Since the JIT compiler can inline indirect calls, we need to emit stackmaps for them too. Since we can't tell if an indirect call is an intrisnic (which doesn't need stackmaps) this will inevitably create some unneeded stackmap calls. But since they'll never be used, all they cost is space in the binary.
1 parent f7b17f0 commit b8e6716

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Yk/StackMaps.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ class YkStackmaps : public ModulePass {
5656
CallInst &CI = cast<CallInst>(I);
5757
if (CI.isInlineAsm())
5858
continue;
59-
if (CI.isIndirectCall())
60-
continue;
61-
if (CI.getCalledFunction()->isIntrinsic())
59+
// We don't need to insert stackmaps after intrinsics. But since we
60+
// can't tell if an indirect call is an intrinsic at compile time,
61+
// emit a stackmap in those cases too.
62+
if (!CI.isIndirectCall() && CI.getCalledFunction()->isIntrinsic())
6263
continue;
6364
SMCalls.insert({&I, LA.getLiveVarsBefore(&I)});
6465
} else if ((isa<BranchInst>(I) &&

0 commit comments

Comments
 (0)