[llvm] Update foldFMulReassoc to respect absent fast-math flags (PR #88589)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 12:22:23 PDT 2024


================
@@ -636,26 +636,43 @@ Instruction *InstCombinerImpl::foldFMulReassoc(BinaryOperator &I) {
   // expression.
   if (match(Op1, m_Constant(C)) && C->isFiniteNonZeroFP()) {
     Constant *C1;
-    if (match(Op0, m_OneUse(m_FDiv(m_Constant(C1), m_Value(X))))) {
+    if (match(Op0,
+              m_AllowReassoc(m_OneUse(m_FDiv(m_Constant(C1), m_Value(X)))))) {
----------------
arsenm wrote:

I still think the flags should be some kind of template argument to the m_FDiv 

https://github.com/llvm/llvm-project/pull/88589


More information about the llvm-commits mailing list