projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4e88cb6
)
[InstCombine] add test for bogus bswap; NFC
author
Sanjay Patel
<spatel@rotateright.com>
Wed, 23 Mar 2022 11:53:11 +0000
(07:53 -0400)
committer
Sanjay Patel
<spatel@rotateright.com>
Wed, 23 Mar 2022 15:28:37 +0000
(11:28 -0400)
This is reduced from a crash caused by
D122166
.
llvm/test/Transforms/InstCombine/lshr.ll
patch
|
blob
|
history
diff --git
a/llvm/test/Transforms/InstCombine/lshr.ll
b/llvm/test/Transforms/InstCombine/lshr.ll
index 175430189ce128343121ba18a25280d7546865ac..34a5facceafd5d11031a1533b1e2895048be838b 100644
(file)
--- a/
llvm/test/Transforms/InstCombine/lshr.ll
+++ b/
llvm/test/Transforms/InstCombine/lshr.ll
@@
-919,3
+919,16
@@
define i128 @narrow_bswap_overshift2(i96 %x) {
%s = lshr i128 %b, 61
ret i128 %s
}
+
+define i32 @not_narrow_bswap(i24 %x) {
+; CHECK-LABEL: @not_narrow_bswap(
+; CHECK-NEXT: [[Z:%.*]] = zext i24 [[X:%.*]] to i32
+; CHECK-NEXT: [[B:%.*]] = call i32 @llvm.bswap.i32(i32 [[Z]])
+; CHECK-NEXT: [[R:%.*]] = lshr exact i32 [[B]], 8
+; CHECK-NEXT: ret i32 [[R]]
+;
+ %z = zext i24 %x to i32
+ %b = call i32 @llvm.bswap.i32(i32 %z)
+ %r = lshr i32 %b, 8
+ ret i32 %r
+}