Skip to content

Commit 5bbd767

Browse files
bors[bot]vext01
andauthored
26: Mark function arguments live for the control point. r=ltratt a=vext01 Co-authored-by: Edd Barrett <[email protected]>
2 parents 3b11c63 + 5613b25 commit 5bbd767

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm/lib/Transforms/Yk/ControlPoint.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,19 @@ CallInst *findControlPointCall(Module &M) {
8989
}
9090

9191
/// Extract all live variables that need to be passed into the control point.
92+
///
93+
/// YKFIXME: This currently computes an over-approximation of what's live.
94+
/// https://github.com/ykjit/yk/issues/515
9295
std::vector<Value *> getLiveVars(DominatorTree &DT, CallInst *OldCtrlPoint) {
9396
std::vector<Value *> Vec;
9497
Function *Func = OldCtrlPoint->getFunction();
98+
99+
// Add function arguments to the live set.
100+
for (Value &Arg : Func->args()) {
101+
Vec.push_back(&Arg);
102+
}
103+
104+
// Then add anything which dominates the control point to the live set.
95105
for (auto &BB : *Func) {
96106
if (!DT.dominates(cast<Instruction>(OldCtrlPoint), &BB)) {
97107
for (auto &I : BB) {

0 commit comments

Comments
 (0)