[llvm] [InstCombine] Extend bitmask mul combine to handle independent operands (PR #142503)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 27 22:15:16 PDT 2025
================
@@ -451,6 +451,225 @@ define i32 @and_mul_non_disjoint(i32 %in) {
ret i32 %out
}
+define i32 @unrelated_ops(i32 %in, i32 %in2) {
+; CHECK-LABEL: @unrelated_ops(
+; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[IN:%.*]], 15
+; CHECK-NEXT: [[TMP2:%.*]] = mul nuw nsw i32 [[TMP1]], 72
+; CHECK-NEXT: [[OUT:%.*]] = or disjoint i32 [[TMP2]], [[IN2:%.*]]
+; CHECK-NEXT: ret i32 [[OUT]]
+;
+ %1 = and i32 %in, 3
----------------
dtcxzyw wrote:
Use named values.
https://github.com/llvm/llvm-project/pull/142503
More information about the llvm-commits
mailing list