diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-12-02 02:15:36 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-12-02 02:15:36 +0000 |
commit | bbe4105cd7c94e90ecc7de2be57c04b3d80bb267 (patch) | |
tree | ce57328d53b77c84d58bf322665cf67d0bb7031c | |
parent | 221cd2f0813be675784b9825aee9f74f22026247 (diff) |
Fix PR3124: overly strict assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60392 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/VirtRegMap.cpp | 6 | ||||
-rw-r--r-- | test/CodeGen/X86/2008-12-01-SpillerAssert.ll | 15 |
2 files changed, 19 insertions, 2 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index 7ce5347482..dab0215005 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -1760,8 +1760,10 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) { 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); } diff --git a/test/CodeGen/X86/2008-12-01-SpillerAssert.ll b/test/CodeGen/X86/2008-12-01-SpillerAssert.ll new file mode 100644 index 0000000000..81b25da8a8 --- /dev/null +++ b/test/CodeGen/X86/2008-12-01-SpillerAssert.ll @@ -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] } +@.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 +} |