summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorChen Zheng <shchenz@cn.ibm.com>2018-07-12 03:06:04 +0000
committerChen Zheng <shchenz@cn.ibm.com>2018-07-12 03:06:04 +0000
commitfdf13ef342e29d22f96f64a82679609873229d92 (patch)
tree1f97d7a6e459eb0081f2faf9ea1d5ca32c82d891 /llvm/test
parent71f1ec7ea1108937251d3681fb91d882009f0a97 (diff)
downloadbcm5719-llvm-fdf13ef342e29d22f96f64a82679609873229d92.tar.gz
bcm5719-llvm-fdf13ef342e29d22f96f64a82679609873229d92.zip
[InstSimplify] simplify add instruction if two operands are negative
Differential Revision: https://reviews.llvm.org/D49216 llvm-svn: 336881
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstSimplify/add.ll10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/test/Transforms/InstSimplify/add.ll b/llvm/test/Transforms/InstSimplify/add.ll
index d32b2551ab1..21cc905688b 100644
--- a/llvm/test/Transforms/InstSimplify/add.ll
+++ b/llvm/test/Transforms/InstSimplify/add.ll
@@ -30,10 +30,7 @@ define <2 x i32> @negated_operand_commute_vec(<2 x i32> %x) {
define i8 @knownnegation(i8 %x, i8 %y) {
; CHECK-LABEL: @knownnegation(
-; CHECK-NEXT: [[XY:%.*]] = sub i8 [[X:%.*]], [[Y:%.*]]
-; CHECK-NEXT: [[YX:%.*]] = sub i8 [[Y]], [[X]]
-; CHECK-NEXT: [[R:%.*]] = add i8 [[XY]], [[YX]]
-; CHECK-NEXT: ret i8 [[R]]
+; CHECK-NEXT: ret i8 0
;
%xy = sub i8 %x, %y
%yx = sub i8 %y, %x
@@ -43,10 +40,7 @@ define i8 @knownnegation(i8 %x, i8 %y) {
define <2 x i8> @knownnegation_commute_vec(<2 x i8> %x, <2 x i8> %y) {
; CHECK-LABEL: @knownnegation_commute_vec(
-; CHECK-NEXT: [[XY:%.*]] = sub <2 x i8> [[X:%.*]], [[Y:%.*]]
-; CHECK-NEXT: [[YX:%.*]] = sub <2 x i8> [[Y]], [[X]]
-; CHECK-NEXT: [[R:%.*]] = add <2 x i8> [[YX]], [[XY]]
-; CHECK-NEXT: ret <2 x i8> [[R]]
+; CHECK-NEXT: ret <2 x i8> zeroinitializer
;
%xy = sub <2 x i8> %x, %y
%yx = sub <2 x i8> %y, %x
OpenPOWER on IntegriCloud