diff options
author | Omer Paparo Bivas <omer.paparo.bivas@intel.com> | 2018-05-01 12:25:46 +0000 |
---|---|---|
committer | Omer Paparo Bivas <omer.paparo.bivas@intel.com> | 2018-05-01 12:25:46 +0000 |
commit | 82ef8e19ef1dc06e7dde6a07ed035bf42213af07 (patch) | |
tree | 17f87e08cfd6c3d82bb9d7762cb89b201b95f611 /llvm/test | |
parent | 6f710a6440d45b1a5ab08a21ed7f93ac0a1f8a40 (diff) | |
download | bcm5719-llvm-82ef8e19ef1dc06e7dde6a07ed035bf42213af07.tar.gz bcm5719-llvm-82ef8e19ef1dc06e7dde6a07ed035bf42213af07.zip |
[InstCombine] Adjusting bswap pattern matching to hold for And/Shift mixed case
Differential Revision: https://reviews.llvm.org/D45731
Change-Id: I85d4226504e954933c41598327c91b2d08192a9d
llvm-svn: 331257
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Transforms/InstCombine/bswap.ll | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/test/Transforms/InstCombine/bswap.ll b/llvm/test/Transforms/InstCombine/bswap.ll index c63e16c81d0..69be38df415 100644 --- a/llvm/test/Transforms/InstCombine/bswap.ll +++ b/llvm/test/Transforms/InstCombine/bswap.ll @@ -116,7 +116,7 @@ define i32 @bswap32_and_first(i32 %x) { ret i32 %bswap } -; FIXME: Extra use should not prevent matching to bswap. +; Extra use should not prevent matching to bswap. ; swaphalf = (x << 16 | x >> 16) ; ((swaphalf & 0x00ff00ff) << 8) | ((swaphalf >> 8) & 0x00ff00ff) @@ -126,10 +126,7 @@ define i32 @bswap32_and_first_extra_use(i32 %x) { ; CHECK-NEXT: [[SHR:%.*]] = lshr i32 %x, 16 ; CHECK-NEXT: [[SWAPHALF:%.*]] = or i32 [[SHL]], [[SHR]] ; CHECK-NEXT: [[T:%.*]] = and i32 [[SWAPHALF]], 16711935 -; CHECK-NEXT: [[TSHL:%.*]] = shl nuw i32 [[T]], 8 -; CHECK-NEXT: [[B:%.*]] = lshr i32 [[SWAPHALF]], 8 -; CHECK-NEXT: [[BAND:%.*]] = and i32 [[B]], 16711935 -; CHECK-NEXT: [[BSWAP:%.*]] = or i32 [[TSHL]], [[BAND]] +; CHECK-NEXT: [[BSWAP:%.*]] = call i32 @llvm.bswap.i32(i32 %x) ; CHECK-NEXT: call void @extra_use(i32 [[T]]) ; CHECK-NEXT: ret i32 [[BSWAP]] ; |