Skip to content

Commit 928a3b1

Browse files
committed
Making sure stackmaps are not added after unmappable fuction.
These changes make sure that stackmap is not inserted after unmappable functions except control point and yk_promote calls.
1 parent c24768e commit 928a3b1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

llvm/lib/Transforms/Yk/StackMaps.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "llvm/InitializePasses.h"
1717
#include "llvm/Pass.h"
1818
#include "llvm/Transforms/Yk/LivenessAnalysis.h"
19-
19+
#include "llvm/Transforms/Yk/ControlPoint.h"
2020
#include <map>
2121

2222
#define DEBUG_TYPE "yk-stackmaps"
@@ -60,8 +60,15 @@ class YkStackmaps : public ModulePass {
6060
// We don't need to insert stackmaps after intrinsics. But since we
6161
// can't tell if an indirect call is an intrinsic at compile time,
6262
// emit a stackmap in those cases too.
63-
if (!CI.isIndirectCall() && CI.getCalledFunction()->isIntrinsic())
63+
64+
if (!CI.isIndirectCall() &&
65+
(CI.getCalledFunction()->isIntrinsic() ||
66+
(CI.getCalledFunction()->isDeclaration() &&
67+
(!CI.getCalledFunction()->getName().startswith(
68+
"yk_promote") &&
69+
CI.getCalledFunction()->getName() != YK_NEW_CONTROL_POINT))))
6470
continue;
71+
6572
SMCalls.insert({&I, LA.getLiveVarsBefore(&I)});
6673
} else if ((isa<BranchInst>(I) &&
6774
cast<BranchInst>(I).isConditional()) ||

0 commit comments

Comments
 (0)