[llvm-commits] [llvm] r149768 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Feb 3 21:41:21 PST 2012


Author: stoklund
Date: Fri Feb  3 23:41:20 2012
New Revision: 149768

URL: http://llvm.org/viewvc/llvm-project?rev=149768&view=rev
Log:
Correctly terminate a physreg redefined by an early clobber.

I don't have a test that fails because of this, but a test case like
CodeGen/X86/2009-12-01-EarlyClobberBug.ll exposes the problem.  EAX is
redefined by a tied early clobber operand on inline asm, and the live
range should look like this:

  %EAX,inf = [48r,64e:0)[64e,80r:1)  0 at 48r 1 at 64e

Previously, the two values got merged:

  %EAX,inf = [48r,80r:0)  0 at 48r

With this bug fixed, the REDEF_BY_EC VNInfo flag is no longer needed.

Modified:
    llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp

Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=149768&r1=149767&r2=149768&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Feb  3 23:41:20 2012
@@ -402,7 +402,7 @@
       if (DefIdx != -1) {
         if (mi->isRegTiedToUseOperand(DefIdx)) {
           // Two-address instruction.
-          end = baseIndex.getRegSlot();
+          end = baseIndex.getRegSlot(mi->getOperand(DefIdx).isEarlyClobber());
         } else {
           // Another instruction redefines the register before it is ever read.
           // Then the register is essentially dead at the instruction that





More information about the llvm-commits mailing list