[llvm-branch-commits] [llvm-branch] r106334 - in /llvm/branches/Apple/Troughton: ./ lib/CodeGen/LiveIntervalAnalysis.cpp test/CodeGen/Thumb2/crash.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Jun 18 15:32:07 PDT 2010


Author: stoklund
Date: Fri Jun 18 17:32:07 2010
New Revision: 106334

URL: http://llvm.org/viewvc/llvm-project?rev=106334&view=rev
Log:
--- Merging r106333 into '.':
U    test/CodeGen/Thumb2/crash.ll
U    lib/CodeGen/LiveIntervalAnalysis.cpp


Modified:
    llvm/branches/Apple/Troughton/   (props changed)
    llvm/branches/Apple/Troughton/lib/CodeGen/LiveIntervalAnalysis.cpp
    llvm/branches/Apple/Troughton/test/CodeGen/Thumb2/crash.ll

Propchange: llvm/branches/Apple/Troughton/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 18 17:32:07 2010
@@ -1 +1 @@
-/llvm/trunk:105358,105361,105369,105372,105399,105427,105437,105439,105441,105470,105473,105481,105498,105541,105554,105557,105585-105586,105634,105653,105665,105669,105677,105745,105749,105774-105775,105836,105845,105862,105938,105959,105965,105969,105982,105990-105991,105997-105998,106004,106015,106021,106024,106027,106030,106051,106057,106146,106149,106152,106155,106157,106164,106199,106203-106204,106227,106229,106289,106292,106312,106318,106321,106324
+/llvm/trunk:105358,105361,105369,105372,105399,105427,105437,105439,105441,105470,105473,105481,105498,105541,105554,105557,105585-105586,105634,105653,105665,105669,105677,105745,105749,105774-105775,105836,105845,105862,105938,105959,105965,105969,105982,105990-105991,105997-105998,106004,106015,106021,106024,106027,106030,106051,106057,106146,106149,106152,106155,106157,106164,106199,106203-106204,106227,106229,106289,106292,106312,106318,106321,106324,106333

Modified: llvm/branches/Apple/Troughton/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Troughton/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=106334&r1=106333&r2=106334&view=diff
==============================================================================
--- llvm/branches/Apple/Troughton/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/branches/Apple/Troughton/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Jun 18 17:32:07 2010
@@ -329,9 +329,16 @@
     MachineInstr *CopyMI = NULL;
     unsigned SrcReg, DstReg, SrcSubReg, DstSubReg;
     if (mi->isExtractSubreg() || mi->isInsertSubreg() || mi->isSubregToReg() ||
-        tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg))
+        tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg)) {
       CopyMI = mi;
 
+      // Some of the REG_SEQUENCE lowering in TwoAddressInstrPass creates
+      // implicit defs without really knowing. It shows up as INSERT_SUBREG
+      // using an undefined register.
+      if (mi->isInsertSubreg())
+        mi->getOperand(1).setIsUndef();
+    }
+
     VNInfo *ValNo = interval.getNextValue(defIndex, CopyMI, true,
                                           VNInfoAllocator);
     assert(ValNo->id == 0 && "First value in interval is not 0?");

Modified: llvm/branches/Apple/Troughton/test/CodeGen/Thumb2/crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Troughton/test/CodeGen/Thumb2/crash.ll?rev=106334&r1=106333&r2=106334&view=diff
==============================================================================
--- llvm/branches/Apple/Troughton/test/CodeGen/Thumb2/crash.ll (original)
+++ llvm/branches/Apple/Troughton/test/CodeGen/Thumb2/crash.ll Fri Jun 18 17:32:07 2010
@@ -19,3 +19,31 @@
 }
 
 declare void @llvm.arm.neon.vst4.v4i32(i8*, <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32>) nounwind
+
+ at sbuf = common global [16 x i32] zeroinitializer, align 16 ; <[16 x i32]*> [#uses=5]
+ at dbuf = common global [16 x i32] zeroinitializer  ; <[16 x i32]*> [#uses=2]
+
+; This function creates 4 chained INSERT_SUBREGS and then invokes the register scavenger.
+; The first INSERT_SUBREG needs an <undef> use operand for that to work.
+define arm_apcscc i32 @main() nounwind {
+bb.nph:
+  br label %bb
+
+bb:                                               ; preds = %bb, %bb.nph
+  %0 = phi i32 [ 0, %bb.nph ], [ %1, %bb ]        ; <i32> [#uses=4]
+  %scevgep = getelementptr [16 x i32]* @sbuf, i32 0, i32 %0 ; <i32*> [#uses=1]
+  %scevgep5 = getelementptr [16 x i32]* @dbuf, i32 0, i32 %0 ; <i32*> [#uses=1]
+  store i32 %0, i32* %scevgep, align 4
+  store i32 -1, i32* %scevgep5, align 4
+  %1 = add nsw i32 %0, 1                          ; <i32> [#uses=2]
+  %exitcond = icmp eq i32 %1, 16                  ; <i1> [#uses=1]
+  br i1 %exitcond, label %bb2, label %bb
+
+bb2:                                              ; preds = %bb
+  %2 = load <4 x i32>* bitcast ([16 x i32]* @sbuf to <4 x i32>*), align 16 ; <<4 x i32>> [#uses=1]
+  %3 = load <4 x i32>* bitcast (i32* getelementptr inbounds ([16 x i32]* @sbuf, i32 0, i32 4) to <4 x i32>*), align 16 ; <<4 x i32>> [#uses=1]
+  %4 = load <4 x i32>* bitcast (i32* getelementptr inbounds ([16 x i32]* @sbuf, i32 0, i32 8) to <4 x i32>*), align 16 ; <<4 x i32>> [#uses=1]
+  %5 = load <4 x i32>* bitcast (i32* getelementptr inbounds ([16 x i32]* @sbuf, i32 0, i32 12) to <4 x i32>*), align 16 ; <<4 x i32>> [#uses=1]
+  tail call void @llvm.arm.neon.vst4.v4i32(i8* bitcast ([16 x i32]* @dbuf to i8*), <4 x i32> %2, <4 x i32> %3, <4 x i32> %4, <4 x i32> %5) nounwind
+  ret i32 0
+}





More information about the llvm-branch-commits mailing list