summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-10-14 16:31:54 +0000
committerSanjay Patel <spatel@rotateright.com>2016-10-14 16:31:54 +0000
commit6d6eca5cdc995fdb8850fd5c79d1018893a44988 (patch)
tree2d9870f0d84e7ec0f84759654c8b1c803d031ad3 /llvm/test
parent472a14197d58c0d6770aff8423c8593fa68307f0 (diff)
downloadbcm5719-llvm-6d6eca5cdc995fdb8850fd5c79d1018893a44988.tar.gz
bcm5719-llvm-6d6eca5cdc995fdb8850fd5c79d1018893a44988.zip
[InstCombine] use m_APInt to allow sub with constant folds for splat vectors
llvm-svn: 284247
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/sub-xor.ll2
-rw-r--r--llvm/test/Transforms/InstCombine/sub.ll6
2 files changed, 3 insertions, 5 deletions
diff --git a/llvm/test/Transforms/InstCombine/sub-xor.ll b/llvm/test/Transforms/InstCombine/sub-xor.ll
index ce411aa6080..9a0814c2c92 100644
--- a/llvm/test/Transforms/InstCombine/sub-xor.ll
+++ b/llvm/test/Transforms/InstCombine/sub-xor.ll
@@ -15,7 +15,7 @@ define i32 @test1(i32 %x) {
define <2 x i32> @test1vec(<2 x i32> %x) {
; CHECK-LABEL: @test1vec(
; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> %x, <i32 31, i32 31>
-; CHECK-NEXT: [[SUB:%.*]] = sub nsw <2 x i32> <i32 63, i32 63>, [[AND]]
+; CHECK-NEXT: [[SUB:%.*]] = xor <2 x i32> [[AND]], <i32 63, i32 63>
; CHECK-NEXT: ret <2 x i32> [[SUB]]
;
%and = and <2 x i32> %x, <i32 31, i32 31>
diff --git a/llvm/test/Transforms/InstCombine/sub.ll b/llvm/test/Transforms/InstCombine/sub.ll
index 3fa366a993f..32541f1f893 100644
--- a/llvm/test/Transforms/InstCombine/sub.ll
+++ b/llvm/test/Transforms/InstCombine/sub.ll
@@ -154,8 +154,7 @@ define i32 @test13(i32 %A) {
define <2 x i32> @test12vec(<2 x i32> %A) {
; CHECK-LABEL: @test12vec(
-; CHECK-NEXT: [[B:%.*]] = ashr <2 x i32> %A, <i32 31, i32 31>
-; CHECK-NEXT: [[C:%.*]] = sub nsw <2 x i32> zeroinitializer, [[B]]
+; CHECK-NEXT: [[C:%.*]] = lshr <2 x i32> %A, <i32 31, i32 31>
; CHECK-NEXT: ret <2 x i32> [[C]]
;
%B = ashr <2 x i32> %A, <i32 31, i32 31>
@@ -165,8 +164,7 @@ define <2 x i32> @test12vec(<2 x i32> %A) {
define <2 x i32> @test13vec(<2 x i32> %A) {
; CHECK-LABEL: @test13vec(
-; CHECK-NEXT: [[B:%.*]] = lshr <2 x i32> %A, <i32 31, i32 31>
-; CHECK-NEXT: [[C:%.*]] = sub nsw <2 x i32> zeroinitializer, [[B]]
+; CHECK-NEXT: [[C:%.*]] = ashr <2 x i32> %A, <i32 31, i32 31>
; CHECK-NEXT: ret <2 x i32> [[C]]
;
%B = lshr <2 x i32> %A, <i32 31, i32 31>
OpenPOWER on IntegriCloud