Fix problem when using LiveRangeQuery with block entries.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sun, 16 Sep 2012 02:15:33 +0000 (02:15 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sun, 16 Sep 2012 02:15:33 +0000 (02:15 +0000)
A value that is live in to a basic block should be returned by valueIn()
in LiveRangeQuery(getMBBStartIdx(MBB)), unless it is a PHI-def which
should be returned by valueDefined() instead.

Current code isn't using this functionality. Future code will.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163990 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LiveInterval.h

index 3bce496b2b58560dd4dc3dc23bfe8c293d65dc83..b4d0b125233045532614164e62c49cce898d7369 100644 (file)
@@ -499,7 +499,9 @@ namespace llvm {
       if (I == E)
         return;
       // Is this an instruction live-in segment?
-      if (SlotIndex::isEarlierInstr(I->start, Idx)) {
+      // If Idx is the start index of a basic block, include live-in segments
+      // that start at Idx.getBaseIndex().
+      if (I->start <= Idx.getBaseIndex()) {
         EarlyVal = I->valno;
         EndPoint = I->end;
         // Move to the potentially live-out segment.