summaryrefslogtreecommitdiff
path: root/test/Transforms/GVN
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-05-22 07:03:34 +0000
committerChris Lattner <sabre@nondot.org>2011-05-22 07:03:34 +0000
commit9e7bc05ad7fb69a25aff37e348942b07eed9cd73 (patch)
tree7c0dc3ada0e8f21d05cf8d95991ffd787b9fc96c /test/Transforms/GVN
parent0e959394ad5b74970253d21069ae11f25290e1fc (diff)
downloadllvm-9e7bc05ad7fb69a25aff37e348942b07eed9cd73.tar.gz
llvm-9e7bc05ad7fb69a25aff37e348942b07eed9cd73.tar.bz2
llvm-9e7bc05ad7fb69a25aff37e348942b07eed9cd73.tar.xz
fix PR9841 by having GVN not process dead loads. This was
causing it to get into infinite loops when it would widen a load (which can necessarily leave around dead loads). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131847 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN')
-rw-r--r--test/Transforms/GVN/crash.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/GVN/crash.ll b/test/Transforms/GVN/crash.ll
index 4a3aa1c55a..31eae256c6 100644
--- a/test/Transforms/GVN/crash.ll
+++ b/test/Transforms/GVN/crash.ll
@@ -151,3 +151,15 @@ dead:
dead2:
ret i32 %A
}
+
+
+; PR9841
+define fastcc i8 @test5(i8* %P) nounwind {
+entry:
+ %0 = load i8* %P, align 2
+
+ %Q = getelementptr i8* %P, i32 1
+ %1 = load i8* %Q, align 1
+ ret i8 %1
+}
+