aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/IndVarSimplify/avoid-i0.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-25 17:05:40 +0000
committerDan Gohman <gohman@apple.com>2009-04-25 17:05:40 +0000
commit2c73d5fb9e3d68c96bb2242bbbf2930a8db10343 (patch)
tree7871a90ca0cb7812f7fe9a280dc3c92ea1adc2a5 /test/Transforms/IndVarSimplify/avoid-i0.ll
parent4cdc44c82c4415b467760065fed146f73933c67b (diff)
downloadexternal_llvm-2c73d5fb9e3d68c96bb2242bbbf2930a8db10343.zip
external_llvm-2c73d5fb9e3d68c96bb2242bbbf2930a8db10343.tar.gz
external_llvm-2c73d5fb9e3d68c96bb2242bbbf2930a8db10343.tar.bz2
Handle ands with 0 and shifts by 0 correctly. These aren't
common, but indvars shouldn't crash on them. This fixes PR4054. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/IndVarSimplify/avoid-i0.ll')
-rw-r--r--test/Transforms/IndVarSimplify/avoid-i0.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Transforms/IndVarSimplify/avoid-i0.ll b/test/Transforms/IndVarSimplify/avoid-i0.ll
new file mode 100644
index 0000000..28112e7
--- /dev/null
+++ b/test/Transforms/IndVarSimplify/avoid-i0.ll
@@ -0,0 +1,23 @@
+; RUN: llvm-as < %s | opt -indvars
+; PR4054
+
+; Don't treat an and with 0 as a mask (trunc+zext).
+
+define i32 @int80(i8 signext %p_71) nounwind {
+entry:
+ br label %bb
+
+bb: ; preds = %bb6, %entry
+ %p_71_addr.0 = phi i8 [ %p_71, %entry ], [ %0, %bb6 ] ; <i8> [#uses=0]
+ br i1 false, label %bb4, label %bb1
+
+bb1: ; preds = %bb
+ ret i32 0
+
+bb4: ; preds = %bb4, %bb
+ br i1 false, label %bb6, label %bb4
+
+bb6: ; preds = %bb4
+ %0 = and i8 0, 0 ; <i8> [#uses=1]
+ br label %bb
+}