aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis/ScalarEvolution/xor-and.ll
blob: 4ab2f39a2810af43cb8d1a9d6a490fd7039ad4f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
; RUN: opt < %s -scalar-evolution -analyze \
; RUN:   | grep "\-->  (zext i4 (-8 + (trunc i64 (8 \* %x) to i4)) to i64)"

; ScalarEvolution shouldn't try to analyze %z 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
}