aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/PowerPC/and_add.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/PowerPC/and_add.ll')
-rw-r--r--test/CodeGen/PowerPC/and_add.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/and_add.ll b/test/CodeGen/PowerPC/and_add.ll
new file mode 100644
index 0000000..1f6428a
--- /dev/null
+++ b/test/CodeGen/PowerPC/and_add.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
+; RUN: grep slwi %t
+; RUN: not grep addi %t
+; RUN: not grep rlwinm %t
+
+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
+}
+