[llvm-commits] [llvm] r60392 - in /llvm/trunk: lib/CodeGen/VirtRegMap.cpp test/CodeGen/X86/2008-12-01-SpillerAssert.ll

Evan Cheng evan.cheng at apple.com
Mon Dec 1 18:15:36 PST 2008


Author: evancheng
Date: Mon Dec  1 20:15:36 2008
New Revision: 60392

URL: http://llvm.org/viewvc/llvm-project?rev=60392&view=rev
Log:
Fix PR3124: overly strict assert.

Added:
    llvm/trunk/test/CodeGen/X86/2008-12-01-SpillerAssert.ll
Modified:
    llvm/trunk/lib/CodeGen/VirtRegMap.cpp

Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=60392&r1=60391&r2=60392&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Mon Dec  1 20:15:36 2008
@@ -1760,8 +1760,10 @@
           SmallVector<unsigned, 2> KillRegs;
           InvalidateKills(MI, RegKills, KillOps, &KillRegs);
           if (MO.isDead() && !KillRegs.empty()) {
-            // Source register or an implicit super-register use is killed.
-            assert(KillRegs[0] == Dst || TRI->isSubRegister(KillRegs[0], Dst));
+            // Source register or an implicit super/sub-register use is killed.
+            assert(KillRegs[0] == Dst ||
+                   TRI->isSubRegister(KillRegs[0], Dst) ||
+                   TRI->isSuperRegister(KillRegs[0], Dst));
             // Last def is now dead.
             TransferDeadness(&MBB, Dist, Src, RegKills, KillOps);
           }

Added: llvm/trunk/test/CodeGen/X86/2008-12-01-SpillerAssert.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-12-01-SpillerAssert.ll?rev=60392&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/2008-12-01-SpillerAssert.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2008-12-01-SpillerAssert.ll Mon Dec  1 20:15:36 2008
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu
+; PR3124
+
+        %struct.cpuinfo_x86 = type { i8, i8, i8, i8, i32, i8, i8, i8, i32, i32, [9 x i32], [16 x i8], [64 x i8], i32, i32, i32, i64, %struct.cpumask_t, i16, i16, i16, i16, i16, i16, i16, i16, i32 }
+        %struct.cpumask_t = type { [1 x i64] }
+ at .str10 = external constant [70 x i8]           ; <[70 x i8]*> [#uses=1]
+
+declare i32 @printk(i8*, ...)
+
+define void @display_cacheinfo(%struct.cpuinfo_x86* %c) nounwind section ".cpuinit.text" {
+entry:
+        %asmtmp = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 -2147483643, i32 0) nounwind          ; <{ i32, i32, i32, i32 }> [#uses=0]
+        %0 = tail call i32 (i8*, ...)* @printk(i8* getelementptr ([70 x i8]* @.str10, i32 0, i64 0), i32 0, i32 0, i32 0, i32 0) nounwind           ; <i32> [#uses=0]
+        unreachable
+}





More information about the llvm-commits mailing list