diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2008-07-17 19:48:53 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2008-07-17 19:48:53 +0000 |
| commit | cefd6e62fad6743c479f73b0b6d8e8728e037695 (patch) | |
| tree | 1510be6f0da61ac8e699ef6604b13112d8c9364d | |
| parent | c5add64f0a13e7c91b6ebd56f6a5ff6788b18ef6 (diff) | |
| download | bcm5719-llvm-cefd6e62fad6743c479f73b0b6d8e8728e037695.tar.gz bcm5719-llvm-cefd6e62fad6743c479f73b0b6d8e8728e037695.zip | |
Subreg live interval valno may not have a corresponding def machineinstr since it's less precise.
llvm-svn: 53734
| -rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 2 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/2008-07-16-CoalescerCrash.ll | 34 |
2 files changed, 35 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index bc833633ed2..5b7f55dfc9a 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -1327,7 +1327,7 @@ bool SimpleRegisterCoalescing::RangeIsDefinedByCopyFromReg(LiveInterval &li, // Re-compute it. MachineInstr *DefMI = li_->getInstructionFromIndex(LR->start); unsigned SrcReg, DstReg; - if (tii_->isMoveInstr(*DefMI, SrcReg, DstReg) && + if (DefMI && tii_->isMoveInstr(*DefMI, SrcReg, DstReg) && DstReg == li.reg && SrcReg == Reg) { // Cache computed info. LR->valno->def = LR->start; diff --git a/llvm/test/CodeGen/X86/2008-07-16-CoalescerCrash.ll b/llvm/test/CodeGen/X86/2008-07-16-CoalescerCrash.ll new file mode 100644 index 00000000000..aa9ee507f80 --- /dev/null +++ b/llvm/test/CodeGen/X86/2008-07-16-CoalescerCrash.ll @@ -0,0 +1,34 @@ +; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin + + %struct.SV = type { i8*, i64, i64 } +@"\01LC25" = external constant [8 x i8] ; <[8 x i8]*> [#uses=1] + +declare void @Perl_sv_catpvf(%struct.SV*, i8*, ...) nounwind + +declare fastcc i64 @Perl_utf8n_to_uvuni(i8*, i64, i64*, i64) nounwind + +define fastcc i8* @Perl_pv_uni_display(%struct.SV* %dsv, i8* %spv, i64 %len, i64 %pvlim, i64 %flags) nounwind { +entry: + br i1 false, label %bb, label %bb40 + +bb: ; preds = %entry + tail call fastcc i64 @Perl_utf8n_to_uvuni( i8* null, i64 13, i64* null, i64 255 ) nounwind ; <i64>:0 [#uses=1] + br i1 false, label %bb6, label %bb33 + +bb6: ; preds = %bb + br i1 false, label %bb30, label %bb31 + +bb30: ; preds = %bb6 + unreachable + +bb31: ; preds = %bb6 + icmp eq i8 0, 0 ; <i1>:1 [#uses=0] + br label %bb33 + +bb33: ; preds = %bb31, %bb + tail call void (%struct.SV*, i8*, ...)* @Perl_sv_catpvf( %struct.SV* %dsv, i8* getelementptr ([8 x i8]* @"\01LC25", i32 0, i64 0), i64 %0 ) nounwind + unreachable + +bb40: ; preds = %entry + ret i8* null +} |

