[llvm] [InstCombine] Resolve TODO: Remove one-time check if other logic operand (Y) is constant (PR #77973)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 21 05:50:15 PST 2024
================
@@ -240,6 +240,36 @@ define i32 @lshr_or_extra_use(i32 %x, i32 %y, ptr %p) {
ret i32 %sh1
}
+define i32 @lshr_or_extra_use_shift(i32 %x, ptr %p) {
+; CHECK-LABEL: @lshr_or_extra_use_shift(
+; CHECK-NEXT: [[SH0:%.*]] = lshr i32 [[X:%.*]], 5
+; CHECK-NEXT: store i32 [[SH0]], ptr [[P:%.*]], align 4
+; CHECK-NEXT: [[R:%.*]] = lshr i32 [[X]], 12
+; CHECK-NEXT: [[SH1:%.*]] = or i32 [[R]], 192
+; CHECK-NEXT: ret i32 [[SH1]]
+;
+ %sh0 = lshr i32 %x, 5
+ %r = or i32 %sh0, 24601
+ store i32 %sh0, ptr %p
+ %sh1 = lshr i32 %r, 7
+ ret i32 %sh1
+}
----------------
AtariDreams wrote:
The other tests you asked me to remove did in fact change, but not this one.
https://github.com/llvm/llvm-project/pull/77973
More information about the llvm-commits
mailing list