diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-01-30 17:19:32 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-01-30 17:19:32 +0000 |
| commit | 77732d5033d6efab4a321c904e1eb4a12e7b2ecf (patch) | |
| tree | 4814cc226305dc5cdf5dd2ebf1cb14d5eb035d70 /llvm/test/Transforms | |
| parent | a66696f210ae9772b9958b9aa003ba922340d0a3 (diff) | |
| download | bcm5719-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.ll | 6 |
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 } |

