Skip to content

Commit 9c9f169

Browse files
bors[bot]vext01
andauthored
71: Support for promotion. r=ltratt a=vext01 Co-authored-by: Edd Barrett <[email protected]>
2 parents 4db5152 + 739d8c9 commit 9c9f169

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

llvm/lib/Transforms/Yk/StackMaps.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ void initializeYkStackmapsPass(PassRegistry &);
2828
} // namespace llvm
2929

3030
namespace {
31+
const char *YkPromote = "__ykllvm_recognised_promote";
32+
3133
class YkStackmaps : public ModulePass {
3234
public:
3335
static char ID;
@@ -61,7 +63,15 @@ class YkStackmaps : public ModulePass {
6163
// emit a stackmap in those cases too.
6264
if (!CI.isIndirectCall() && CI.getCalledFunction()->isIntrinsic())
6365
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});
6575
} else if ((isa<BranchInst>(I) &&
6676
cast<BranchInst>(I).isConditional()) ||
6777
isa<SwitchInst>(I)) {

0 commit comments

Comments
 (0)