aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/2009-09-19-SchedCustomLoweringBug.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-09-19 09:51:03 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-09-19 09:51:03 +0000
commitce31910eae5bd4896fa6c27798e7b26885691d3b (patch)
tree724f5ef9adebe214b0b564f1f8153e5d329e0a31 /test/CodeGen/X86/2009-09-19-SchedCustomLoweringBug.ll
parent83d63919bd990ce00f62e18114504b9e4a5cb35e (diff)
downloadexternal_llvm-ce31910eae5bd4896fa6c27798e7b26885691d3b.zip
external_llvm-ce31910eae5bd4896fa6c27798e7b26885691d3b.tar.gz
external_llvm-ce31910eae5bd4896fa6c27798e7b26885691d3b.tar.bz2
Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/2009-09-19-SchedCustomLoweringBug.ll')
-rw-r--r--test/CodeGen/X86/2009-09-19-SchedCustomLoweringBug.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2009-09-19-SchedCustomLoweringBug.ll b/test/CodeGen/X86/2009-09-19-SchedCustomLoweringBug.ll
new file mode 100644
index 0000000..646806e
--- /dev/null
+++ b/test/CodeGen/X86/2009-09-19-SchedCustomLoweringBug.ll
@@ -0,0 +1,30 @@
+; RUN: llc < %s -mtriple=i386-apple-darwin10 | FileCheck %s
+
+; PR4958
+
+define i32 @main() nounwind ssp {
+entry:
+; CHECK: main:
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ br label %bb
+
+bb: ; preds = %bb1, %entry
+; CHECK: movl %e
+; CHECK-NEXT: addl $1
+; CHECK-NEXT: movl %e
+; CHECK-NEXT: adcl $0
+ %i.0 = phi i64 [ 0, %entry ], [ %0, %bb1 ] ; <i64> [#uses=1]
+ %0 = add nsw i64 %i.0, 1 ; <i64> [#uses=2]
+ %1 = icmp sgt i32 0, 0 ; <i1> [#uses=1]
+ br i1 %1, label %bb2, label %bb1
+
+bb1: ; preds = %bb
+ %2 = icmp sle i64 %0, 1 ; <i1> [#uses=1]
+ br i1 %2, label %bb, label %bb2
+
+bb2: ; preds = %bb1, %bb
+ br label %return
+
+return: ; preds = %bb2
+ ret i32 0
+}