File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ void initializeYkStackmapsPass(PassRegistry &);
28
28
} // namespace llvm
29
29
30
30
namespace {
31
+ const char *YkPromote = " __ykllvm_recognised_promote" ;
32
+
31
33
class YkStackmaps : public ModulePass {
32
34
public:
33
35
static char ID;
@@ -61,7 +63,15 @@ class YkStackmaps : public ModulePass {
61
63
// emit a stackmap in those cases too.
62
64
if (!CI.isIndirectCall () && CI.getCalledFunction ()->isIntrinsic ())
63
65
continue ;
64
- SMCalls.insert ({&I, LA.getLiveVarsBefore (&I)});
66
+ std::vector<Value *> Lives = LA.getLiveVarsBefore (&I);
67
+ // Value guards for variable promotions, require us to also
68
+ // track the value generated by the call.
69
+ if (CI.getCalledFunction () &&
70
+ CI.getCalledFunction ()->getName () == YkPromote) {
71
+ Value *RV = cast<Value>(&CI);
72
+ Lives.push_back (RV);
73
+ }
74
+ SMCalls.insert ({&I, Lives});
65
75
} else if ((isa<BranchInst>(I) &&
66
76
cast<BranchInst>(I).isConditional ()) ||
67
77
isa<SwitchInst>(I)) {
You can’t perform that action at this time.
0 commit comments