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

Jakob Stoklund Olesen stoklund at 2pi.dk
Sat Sep 15 09:29:50 PDT 2012


Author: stoklund
Date: Sat Sep 15 11:29:49 2012
New Revision: 163971

URL: http://llvm.org/viewvc/llvm-project?rev=163971&view=rev
Log:
Make LiveRangeQuery work for PHIDefs as well.

If a PHI value happens to be live out from the layout predecessor of its
def block, the def slot index will be in the middle of the segment:

%vreg11 = [192r,240B:0)[352r,416B:2)[416B,496r:1)  0 at 192r 1 at 480B-phi %2 at 352r

A LiveRangeQuery for 480 should return NULL from valueIn() since the
PHI value is defined at the block entry, not live in to the block.

No test case, future code depends on this functionality.

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=163971&r1=163970&r2=163971&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Sat Sep 15 11:29:49 2012
@@ -508,6 +508,12 @@
           if (++I == E)
             return;
         }
+        // Special case: A PHIDef value can have its def in the middle of a
+        // segment if the value happens to be live out of the layout
+        // predecessor.
+        // Such a value is not live-in.
+        if (EarlyVal->def == Idx.getBaseIndex())
+          EarlyVal = 0;
       }
       // I now points to the segment that may be live-through, or defined by
       // this instr. Ignore segments starting after the current instr.





More information about the llvm-commits mailing list