[llvm] [InstCombine] Reassociate commutative binops over select/phi/minmax (PR #187493)
Mitch Briles via llvm-commits
llvm-commits at lists.llvm.org
Sun May 24 16:44:03 PDT 2026
================
@@ -522,6 +522,17 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final
/// or commutative.
bool SimplifyAssociativeOrCommutative(BinaryOperator &I);
+ /// If InnerVal1 and OuterVal form a symmetric pair, and "op" is commutative:
+ /// "(InnerVal0 op InnerVal1) op OuterVal" ==> "(X op' Y) op InnerVal0".
+ /// "OuterVal op (InnerVal0 op InnerVal1)" ==> "InnerVal0 op (X op' Y)".
+ /// X and Y are the inputs to the symmetric pair. "op'" indicates that
+ /// InnerOp will have its poison-generating flags dropped. Warning:
+ /// associativity not checked.
----------------
MitchBriles wrote:
Done.
https://github.com/llvm/llvm-project/pull/187493
More information about the llvm-commits
mailing list