summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-07-13 18:40:38 +0000
committerSanjay Patel <spatel@rotateright.com>2016-07-13 18:40:38 +0000
commit904a88025aaf29e4113a916c471dacbb2e65e55d (patch)
tree735fd0ea1ae5c0322ce4e6db6e04f38db6e02139
parent544b23d88fcc43265ecc417cfc25c0957a64d776 (diff)
downloadbcm5719-llvm-904a88025aaf29e4113a916c471dacbb2e65e55d.tar.gz
bcm5719-llvm-904a88025aaf29e4113a916c471dacbb2e65e55d.zip
add test for zexty xor sandwich
llvm-svn: 275297
-rw-r--r--llvm/test/Transforms/InstCombine/xor.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/xor.ll b/llvm/test/Transforms/InstCombine/xor.ll
index 1dfc017980c..dc4b3fd1a4c 100644
--- a/llvm/test/Transforms/InstCombine/xor.ll
+++ b/llvm/test/Transforms/InstCombine/xor.ll
@@ -242,6 +242,20 @@ define i32 @test22(i1 %X) {
ret i32 %Q
}
+; Look through a zext between xors.
+
+define i32 @fold_zext_xor_sandwich(i1 %X) {
+; CHECK-LABEL: @fold_zext_xor_sandwich(
+; CHECK-NEXT: [[TMP1:%.*]] = zext i1 %X to i32
+; CHECK-NEXT: [[Q:%.*]] = xor i32 [[TMP1]], 3
+; CHECK-NEXT: ret i32 [[Q]]
+;
+ %Y = xor i1 %X, true
+ %Z = zext i1 %Y to i32
+ %Q = xor i32 %Z, 2
+ ret i32 %Q
+}
+
define i1 @test23(i32 %a, i32 %b) {
; CHECK-LABEL: @test23(
; CHECK-NEXT: [[T4:%.*]] = icmp eq i32 %b, 0
OpenPOWER on IntegriCloud