Index: src/IceCfgNode.cpp |
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp |
index c92c9eb49af6f43dedd41739cde1cee4f83db4b0..eb0bcfc8aa6e1c5764a8938695336b51c28397f6 100644 |
--- a/src/IceCfgNode.cpp |
+++ b/src/IceCfgNode.cpp |
@@ -459,8 +459,10 @@ void CfgNode::advancedPhiLowering() { |
// Undo the effect of the phi instruction on this node's live-in set by |
// marking the phi dest variable as live on entry. |
SizeT VarNum = Func->getLiveness()->getLiveIndex(Dest->getIndex()); |
- assert(!Func->getLiveness()->getLiveIn(this)[VarNum]); |
- Func->getLiveness()->getLiveIn(this)[VarNum] = true; |
+ if (Func->getLiveness()->getLiveIn(this).size() >= VarNum) { |
Jim Stichnoth
2016/07/29 17:04:06
Shouldn't the '>=' be '>' ?
In any case, I think
manasijm
2016/08/01 22:20:03
Done.
|
+ assert(!Func->getLiveness()->getLiveIn(this)[VarNum]); |
+ Func->getLiveness()->getLiveIn(this)[VarNum] = true; |
+ } |
Phi->setDeleted(); |
} |
} |
@@ -867,15 +869,15 @@ void CfgNode::livenessAddIntervals(Liveness *Liveness, InstNumberT FirstInstNum, |
Variable *Var = Liveness->getVariable(i, this); |
if (LB > LE) { |
- Var->addLiveRange(FirstInstNum, LE); |
- Var->addLiveRange(LB, LastInstNum + 1); |
+ Var->addLiveRange(FirstInstNum, LE, this); |
+ Var->addLiveRange(LB, LastInstNum + 1, this); |
// Assert that Var is a global variable by checking that its liveness |
// index is less than the number of globals. This ensures that the |
// LiveInAndOut[] access is valid. |
assert(i < Liveness->getNumGlobalVars()); |
LiveInAndOut[i] = false; |
} else { |
- Var->addLiveRange(LB, LE); |
+ Var->addLiveRange(LB, LE, this); |
} |
if (i == i1) |
++IBB; |
@@ -887,7 +889,7 @@ void CfgNode::livenessAddIntervals(Liveness *Liveness, InstNumberT FirstInstNum, |
i = LiveInAndOut.find_next(i)) { |
Variable *Var = Liveness->getVariable(i, this); |
if (Liveness->getRangeMask(Var->getIndex())) |
- Var->addLiveRange(FirstInstNum, LastInstNum + 1); |
+ Var->addLiveRange(FirstInstNum, LastInstNum + 1, this); |
} |
} |