[llvm] [InstCombine] Fold (X * 0.0) * constant => X * 0.0 #85241 (PR #92512)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 05:27:14 PDT 2024
================
@@ -905,6 +905,16 @@ Instruction *InstCombinerImpl::visitFMul(BinaryOperator &I) {
}
}
+ // (X * 0.0) * constant => X * 0.0
+ Constant *C1;
+ if (match(Op0, m_FMul(m_Value(X), m_Constant(C1))) &&
+ match(C1, m_AnyZeroFP()) && match(Op1, m_Constant(C))) {
----------------
arsenm wrote:
It can't point at a specific constant in the non-splat case. You should be able to just match m_AnyZeroFP and cast<Constant>
https://github.com/llvm/llvm-project/pull/92512
More information about the llvm-commits
mailing list