aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-06-17 01:22:39 +0000
committerDan Gohman <gohman@apple.com>2009-06-17 01:22:39 +0000
commit3034c106753595f564d5852a2d4398f0acb16b32 (patch)
tree4e1805da4c29f4aa2e122d8da92dbe272d2bdad9 /test
parent369de261e7cb2ec17b135d827af639300943562e (diff)
downloadexternal_llvm-3034c106753595f564d5852a2d4398f0acb16b32.zip
external_llvm-3034c106753595f564d5852a2d4398f0acb16b32.tar.gz
external_llvm-3034c106753595f564d5852a2d4398f0acb16b32.tar.bz2
Fix ScalarEvolution's Xor handling to not assume that an And
that gets recognized with a SCEVZeroExtendExpr must be an And with a low-bits mask. With r73540, this is no longer the case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/ScalarEvolution/xor-and.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Analysis/ScalarEvolution/xor-and.ll b/test/Analysis/ScalarEvolution/xor-and.ll
new file mode 100644
index 0000000..9b02bb8
--- /dev/null
+++ b/test/Analysis/ScalarEvolution/xor-and.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | opt -scalar-evolution -disable-output -analyze | grep {\\--> %z}
+
+; ScalarEvolution shouldn't try to analyze %s into something like
+; --> (zext i4 (-1 + (-1 * (trunc i64 (8 * %x) to i4))) to i64)
+
+define i64 @foo(i64 %x) {
+ %a = shl i64 %x, 3
+ %t = and i64 %a, 8
+ %z = xor i64 %t, 8
+ ret i64 %z
+}