[llvm] [InstCombine] Don't propagate ninf when hoisting fneg above fmul/fdiv (PR #228671)
Divyansh Yadav via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 10 04:32:06 PDT 2026
schizophrenicmaniac wrote:
@suogesi I think the difference is where the flags come from. In #228684 the new fdiv takes all of its flags from the old fdiv, so passing `Div` as the FMF source works. Here the new fmul/fdiv and fneg take the fneg's flags, but ninf has to be ANDed with the fmul/fdiv's, so I have to build the FastMathFlags by hand either way. That's why I kept it close to foldFNegIntoConstant. I could bind the fmul/fdiv with m_Instruction to get rid of the cast if a reviewer prefers that, but otherwise I'd leave it as it is.
https://github.com/llvm/llvm-project/pull/228671
More information about the llvm-commits
mailing list