aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstSimplify
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-02-24 19:01:58 +0000
committerChris Lattner <sabre@nondot.org>2012-02-24 19:01:58 +0000
commit009e2650d69fe93bda1864340c5f000e56c52fb8 (patch)
tree0da13e16342e5c497332c81991972cd21517be33 /test/Transforms/InstSimplify
parent1a2d061ec08b86ba91d7009b6ffcf08d5bac3f42 (diff)
downloadexternal_llvm-009e2650d69fe93bda1864340c5f000e56c52fb8.zip
external_llvm-009e2650d69fe93bda1864340c5f000e56c52fb8.tar.gz
external_llvm-009e2650d69fe93bda1864340c5f000e56c52fb8.tar.bz2
fix PR12075, a regression in a recent transform I added. In unreachable code, gep chains can be infinite. Just like "stripPointerCasts", use a set to keep track of visited instructions so we don't recurse infinitely.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstSimplify')
-rw-r--r--test/Transforms/InstSimplify/compare.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/compare.ll b/test/Transforms/InstSimplify/compare.ll
index f22ac46..6ee6dfb 100644
--- a/test/Transforms/InstSimplify/compare.ll
+++ b/test/Transforms/InstSimplify/compare.ll
@@ -463,3 +463,13 @@ define i1 @alloca_compare(i64 %idx) {
; CHECK: alloca_compare
; CHECK: ret i1 false
}
+
+; PR12075
+define i1 @infinite_gep() {
+ ret i1 1
+
+unreachableblock:
+ %X = getelementptr i32 *%X, i32 1
+ %Y = icmp eq i32* %X, null
+ ret i1 %Y
+}