File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -550,6 +550,20 @@ bool LiveVars::isLiveAt(Value *VL, Instruction *MI) {
550
550
bool LiveVars::isLiveOut (Value *VL, const BasicBlock &MBB) {
551
551
LiveVars::LVInfo &VI = getLVInfo (VL);
552
552
553
+ if (isa<Instruction>(VL) && VI.AliveBlocks .empty ())
554
+ {
555
+ // a local value does not live out of any BB.
556
+ // (Originally, this function might be for checking non-local
557
+ // value. Adding this code to make it work for any value.)
558
+ Instruction* I = cast<Instruction>(VL);
559
+ if (VI.Kills .size () == 1 ) {
560
+ BasicBlock *killBB = VI.Kills [0 ]->getParent ();
561
+ if (killBB == I->getParent ()) {
562
+ return false ;
563
+ }
564
+ }
565
+ }
566
+
553
567
// Loop over all of the successors of the basic block, checking to see if
554
568
// the value is either live in the block, or if it is killed in the block.
555
569
SmallVector<const BasicBlock*, 8 > OpSuccBlocks;
You can’t perform that action at this time.
0 commit comments