aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/PowerPC/and_add.ll
blob: dc82fc94402fcb0bf41eacdd0a7fc66c9272f3ea (plain)
1
2
3
4
5
6
7
8
9
10
11
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep slwi &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep addi &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwinm

int %test(int %A) {
  %B = mul int %A, 8  ;; shift
  %C = add int %B, 7  ;; dead, no demanded bits.
  %D = and int %C, -8 ;; dead once add is gone.
  ret int %D
}