diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2018-02-13 22:24:37 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2018-02-13 22:24:37 +0000 |
| commit | 7558d860af88bde4b860d9f66fd0281a331db345 (patch) | |
| tree | 527c3c11d3199e193dca4ff61893ea5d6093eac9 /llvm/test/Transforms | |
| parent | b42495468250e7887b3273100299190a70fab9ce (diff) | |
| download | bcm5719-llvm-7558d860af88bde4b860d9f66fd0281a331db345.tar.gz bcm5719-llvm-7558d860af88bde4b860d9f66fd0281a331db345.zip | |
[InstCombine] (lshr X, 31) * Y --> (ashr X, 31) & Y
This replaces the bit-tracking based fold that did the same thing,
but it only worked for scalars and not directly.
There is no evidence in existing regression tests that the greater
power of bit-tracking was needed here, but we should be aware of
this potential loss of optimization.
llvm-svn: 325062
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/mul.ll | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/test/Transforms/InstCombine/mul.ll b/llvm/test/Transforms/InstCombine/mul.ll index 64ed57ec701..28e334866e6 100644 --- a/llvm/test/Transforms/InstCombine/mul.ll +++ b/llvm/test/Transforms/InstCombine/mul.ll @@ -158,8 +158,8 @@ define i32 @signbit_mul_commute_extra_use(i32 %a, i32 %b) { define <2 x i32> @signbit_mul_vec(<2 x i32> %a, <2 x i32> %b) { ; CHECK-LABEL: @signbit_mul_vec( -; CHECK-NEXT: [[D:%.*]] = lshr <2 x i32> [[A:%.*]], <i32 31, i32 31> -; CHECK-NEXT: [[E:%.*]] = mul nuw <2 x i32> [[D]], [[B:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = ashr <2 x i32> [[A:%.*]], <i32 31, i32 31> +; CHECK-NEXT: [[E:%.*]] = and <2 x i32> [[TMP1]], [[B:%.*]] ; CHECK-NEXT: ret <2 x i32> [[E]] ; %d = lshr <2 x i32> %a, <i32 31, i32 31> @@ -169,8 +169,8 @@ define <2 x i32> @signbit_mul_vec(<2 x i32> %a, <2 x i32> %b) { define <2 x i32> @signbit_mul_vec_commute(<2 x i32> %a, <2 x i32> %b) { ; CHECK-LABEL: @signbit_mul_vec_commute( -; CHECK-NEXT: [[D:%.*]] = lshr <2 x i32> [[A:%.*]], <i32 31, i32 31> -; CHECK-NEXT: [[E:%.*]] = mul nuw <2 x i32> [[D]], [[B:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = ashr <2 x i32> [[A:%.*]], <i32 31, i32 31> +; CHECK-NEXT: [[E:%.*]] = and <2 x i32> [[TMP1]], [[B:%.*]] ; CHECK-NEXT: ret <2 x i32> [[E]] ; %d = lshr <2 x i32> %a, <i32 31, i32 31> |

