summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-01-30 17:19:32 +0000
committerSanjay Patel <spatel@rotateright.com>2017-01-30 17:19:32 +0000
commit77732d5033d6efab4a321c904e1eb4a12e7b2ecf (patch)
tree4814cc226305dc5cdf5dd2ebf1cb14d5eb035d70 /llvm/test/Transforms
parenta66696f210ae9772b9958b9aa003ba922340d0a3 (diff)
downloadbcm5719-llvm-77732d5033d6efab4a321c904e1eb4a12e7b2ecf.tar.gz
bcm5719-llvm-77732d5033d6efab4a321c904e1eb4a12e7b2ecf.zip
[InstCombine] enable (X <<nsw C1) >>s C2 --> X <<nsw (C1-C2) for vectors with splat constants
llvm-svn: 293507
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/shift.ll6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll
index 5e8b4cb3250..459bd5862bd 100644
--- a/llvm/test/Transforms/InstCombine/shift.ll
+++ b/llvm/test/Transforms/InstCombine/shift.ll
@@ -895,15 +895,15 @@ define i32 @test50(i32 %x) {
}
; (X <<nsw C1) >>s C2 --> X >>s (C2-C1)
+; Also, check that exact is propagated.
define <2 x i32> @test50_splat_vec(<2 x i32> %x) {
; CHECK-LABEL: @test50_splat_vec(
-; CHECK-NEXT: [[A:%.*]] = shl nsw <2 x i32> %x, <i32 1, i32 1>
-; CHECK-NEXT: [[B:%.*]] = ashr <2 x i32> [[A]], <i32 3, i32 3>
+; CHECK-NEXT: [[B:%.*]] = ashr exact <2 x i32> %x, <i32 2, i32 2>
; CHECK-NEXT: ret <2 x i32> [[B]]
;
%A = shl nsw <2 x i32> %x, <i32 1, i32 1>
- %B = ashr <2 x i32> %A, <i32 3, i32 3>
+ %B = ashr exact <2 x i32> %A, <i32 3, i32 3>
ret <2 x i32> %B
}
OpenPOWER on IntegriCloud