summaryrefslogtreecommitdiff
path: root/test/Transforms/LICM
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-04 00:12:30 +0000
committerChris Lattner <sabre@nondot.org>2010-09-04 00:12:30 +0000
commit469996400c4ab89d5ddb2eb80acc1c1553439f07 (patch)
tree88ca59ff06cd284aeb2c9ed88e203d5922cc4a86 /test/Transforms/LICM
parent43c05744b58ff24fab998080680b5ba1e2120dec (diff)
downloadllvm-469996400c4ab89d5ddb2eb80acc1c1553439f07.tar.gz
llvm-469996400c4ab89d5ddb2eb80acc1c1553439f07.tar.bz2
llvm-469996400c4ab89d5ddb2eb80acc1c1553439f07.tar.xz
fix a bug in my licm rewrite when a load from the promoted memory
location is being re-stored to the memory location. We would get a dangling pointer from the SSAUpdate data structure and miss a use. This fixes PR8068 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113042 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LICM')
-rw-r--r--test/Transforms/LICM/crash.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Transforms/LICM/crash.ll b/test/Transforms/LICM/crash.ll
new file mode 100644
index 0000000000..325f250bd5
--- /dev/null
+++ b/test/Transforms/LICM/crash.ll
@@ -0,0 +1,27 @@
+; RUN: opt -licm %s -disable-output
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-apple-darwin10.0.0"
+
+
+; PR8068
+@g_12 = external global i8, align 1
+define void @test1() nounwind ssp {
+entry:
+ br label %for.body
+
+for.body: ; preds = %for.cond, %bb.nph
+ store i8 0, i8* @g_12, align 1
+ %tmp6 = load i8* @g_12, align 1
+ br label %for.cond
+
+for.cond: ; preds = %for.body
+ store i8 %tmp6, i8* @g_12, align 1
+ br i1 false, label %for.cond.for.end10_crit_edge, label %for.body
+
+for.cond.for.end10_crit_edge: ; preds = %for.cond
+ br label %for.end10
+
+for.end10: ; preds = %for.cond.for.end10_crit_edge, %entry
+ ret void
+}