aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-10-15 06:19:55 +0000
committerAndrew Trick <atrick@apple.com>2011-10-15 06:19:55 +0000
commit365c9f1ff55bef134c6b9707f7df44d680ddabea (patch)
treeedc2f1c2fa2fa67906158462fba8d4a8c96ccfab /test/Transforms
parent569c4a4767428d7b489db1e634ced5a3b36d8a1d (diff)
downloadexternal_llvm-365c9f1ff55bef134c6b9707f7df44d680ddabea.zip
external_llvm-365c9f1ff55bef134c6b9707f7df44d680ddabea.tar.gz
external_llvm-365c9f1ff55bef134c6b9707f7df44d680ddabea.tar.bz2
Fix SCEVExpander assert during LSR: "argument of incompatible type".
Just because we're dealing with a GEP doesn't mean we can assert the SCEV has a pointer type. The fix is simply to ignore the SCEV pointer type, which we really didn't need. Fixes PR11138 webkit crash. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll b/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll
new file mode 100644
index 0000000..60cc7a5
--- /dev/null
+++ b/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll
@@ -0,0 +1,27 @@
+; RUN: opt -loop-reduce -S < %s | FileCheck %s
+;
+; Test SCEVExpander reusing a phi->gep->phi IV when SCEV "wrongly"
+; reports the expression as an IntegerTy.
+
+target triple = "x86_64-apple-darwin"
+
+; CHECK: @test
+; CHECK: phi
+; CHECK-NOT: phi
+define void @test(i32 %rowStride) ssp align 2 {
+entry:
+ %cond = select i1 undef, i32 %rowStride, i32 4
+ br label %for.end
+
+for.end.critedge: ; preds = %for.end
+ br label %for.end
+
+for.end: ; preds = %for.end.critedge, %entry
+ br i1 undef, label %for.body83, label %for.end.critedge
+
+for.body83: ; preds = %for.body83, %for.end
+ %ptr.0157 = phi i8* [ %add.ptr96, %for.body83 ], [ null, %for.end ]
+ store i8 undef, i8* %ptr.0157, align 1
+ %add.ptr96 = getelementptr inbounds i8* %ptr.0157, i32 %cond
+ br label %for.body83
+}