aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-05 06:19:13 +0000
committerChris Lattner <sabre@nondot.org>2010-03-05 06:19:13 +0000
commit18fdabadca110671b436de52fe7bd492ad49e656 (patch)
tree96e009235a8cfdc293c8bc3b340619d855272052 /test/CodeGen
parent1beaf41ef6fd29e96cff75fb173133f09822745f (diff)
downloadexternal_llvm-18fdabadca110671b436de52fe7bd492ad49e656.zip
external_llvm-18fdabadca110671b436de52fe7bd492ad49e656.tar.gz
external_llvm-18fdabadca110671b436de52fe7bd492ad49e656.tar.bz2
Fix PR6497, a bug where we'd fold a load into an addc
node which has a flag. That flag in turn was used by an already-selected adde which turned into an ADC32ri8 which used a selected load which was chained to the load we folded. This flag use caused us to form a cycle. Fix this by not ignoring chains in IsLegalToFold even in cases where the isel thinks it can. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/crash.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/X86/crash.ll b/test/CodeGen/X86/crash.ll
new file mode 100644
index 0000000..1e13046
--- /dev/null
+++ b/test/CodeGen/X86/crash.ll
@@ -0,0 +1,20 @@
+; RUN: llc -march=x86 %s -o -
+; RUN: llc -march=x86-64 %s -o -
+
+; PR6497
+
+; Chain and flag folding issues.
+define i32 @test1() nounwind ssp {
+entry:
+ %tmp5.i = volatile load i32* undef ; <i32> [#uses=1]
+ %conv.i = zext i32 %tmp5.i to i64 ; <i64> [#uses=1]
+ %tmp12.i = volatile load i32* undef ; <i32> [#uses=1]
+ %conv13.i = zext i32 %tmp12.i to i64 ; <i64> [#uses=1]
+ %shl.i = shl i64 %conv13.i, 32 ; <i64> [#uses=1]
+ %or.i = or i64 %shl.i, %conv.i ; <i64> [#uses=1]
+ %add16.i = add i64 %or.i, 256 ; <i64> [#uses=1]
+ %shr.i = lshr i64 %add16.i, 8 ; <i64> [#uses=1]
+ %conv19.i = trunc i64 %shr.i to i32 ; <i32> [#uses=1]
+ volatile store i32 %conv19.i, i32* undef
+ ret i32 undef
+}