Skip to content

Commit

Permalink
Merge rust-lang#26
Browse files Browse the repository at this point in the history
26: Mark function arguments live for the control point. r=ltratt a=vext01



Co-authored-by: Edd Barrett <[email protected]>
  • Loading branch information
bors[bot] and vext01 authored Mar 3, 2022
2 parents 3b11c63 + 5613b25 commit 5bbd767
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions llvm/lib/Transforms/Yk/ControlPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,19 @@ CallInst *findControlPointCall(Module &M) {
}

/// Extract all live variables that need to be passed into the control point.
///
/// YKFIXME: This currently computes an over-approximation of what's live.
/// https://github.com/ykjit/yk/issues/515
std::vector<Value *> getLiveVars(DominatorTree &DT, CallInst *OldCtrlPoint) {
std::vector<Value *> Vec;
Function *Func = OldCtrlPoint->getFunction();

// Add function arguments to the live set.
for (Value &Arg : Func->args()) {
Vec.push_back(&Arg);
}

// Then add anything which dominates the control point to the live set.
for (auto &BB : *Func) {
if (!DT.dominates(cast<Instruction>(OldCtrlPoint), &BB)) {
for (auto &I : BB) {
Expand Down

0 comments on commit 5bbd767

Please sign in to comment.