[llvm-commits] [llvm] r163990 - /llvm/trunk/include/llvm/CodeGen/LiveInterval.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Sat Sep 15 19:15:33 PDT 2012


Author: stoklund
Date: Sat Sep 15 21:15:33 2012
New Revision: 163990

URL: http://llvm.org/viewvc/llvm-project?rev=163990&view=rev
Log:
Fix problem when using LiveRangeQuery with block entries.

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.

Modified:
    llvm/trunk/include/llvm/CodeGen/LiveInterval.h

Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=163990&r1=163989&r2=163990&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Sat Sep 15 21:15:33 2012
@@ -499,7 +499,9 @@
       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.





More information about the llvm-commits mailing list