diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-01-30 16:11:40 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-01-30 16:11:40 +0000 |
commit | 1196d7cd7f13642920584631cd7fcad704d3e3d6 (patch) | |
tree | ed4e4927442674e4d31965c451c1cf76ce4638af /llvm/test/Transforms/InstCombine/shift.ll | |
parent | 3104468bc060d7b485f00a8603ec547b09b067c6 (diff) | |
download | bcm5719-llvm-1196d7cd7f13642920584631cd7fcad704d3e3d6.tar.gz bcm5719-llvm-1196d7cd7f13642920584631cd7fcad704d3e3d6.zip |
[InstCombine] enable lshr(shl X, C1), C2 folds for vectors with splat constants
llvm-svn: 293489
Diffstat (limited to 'llvm/test/Transforms/InstCombine/shift.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/shift.ll | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/test/Transforms/InstCombine/shift.ll b/llvm/test/Transforms/InstCombine/shift.ll index 26cb5ddef9b..5ee4f49fe0a 100644 --- a/llvm/test/Transforms/InstCombine/shift.ll +++ b/llvm/test/Transforms/InstCombine/shift.ll @@ -924,8 +924,7 @@ define i32 @test51(i32 %x) { define <2 x i32> @test51_splat_vec(<2 x i32> %x) { ; CHECK-LABEL: @test51_splat_vec( -; CHECK-NEXT: [[A:%.*]] = shl nuw <2 x i32> %x, <i32 1, i32 1> -; CHECK-NEXT: [[B:%.*]] = lshr exact <2 x i32> [[A]], <i32 3, i32 3> +; CHECK-NEXT: [[B:%.*]] = lshr exact <2 x i32> %x, <i32 2, i32 2> ; CHECK-NEXT: ret <2 x i32> [[B]] ; %A = shl nuw <2 x i32> %x, <i32 1, i32 1> @@ -950,8 +949,8 @@ define i32 @test51_no_nuw(i32 %x) { define <2 x i32> @test51_no_nuw_splat_vec(<2 x i32> %x) { ; CHECK-LABEL: @test51_no_nuw_splat_vec( -; CHECK-NEXT: [[A:%.*]] = shl <2 x i32> %x, <i32 1, i32 1> -; CHECK-NEXT: [[B:%.*]] = lshr <2 x i32> [[A]], <i32 3, i32 3> +; CHECK-NEXT: [[TMP1:%.*]] = lshr <2 x i32> %x, <i32 2, i32 2> +; CHECK-NEXT: [[B:%.*]] = and <2 x i32> [[TMP1]], <i32 536870911, i32 536870911> ; CHECK-NEXT: ret <2 x i32> [[B]] ; %A = shl <2 x i32> %x, <i32 1, i32 1> |