[llvm] [InstCombine] Ensure Safe Handling of Flags in foldFNegIntoConstant (PR #94148)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 08:59:29 PST 2024


================
@@ -2742,6 +2742,17 @@ Instruction *InstCombinerImpl::visitSub(BinaryOperator &I) {
   return TryToNarrowDeduceFlags();
 }
 
+static FastMathFlags combineFastMathFlagsForFNeg(FastMathFlags FMF,
----------------
arsenm wrote:

Name is too specific, but I'm not sure what to call this. Also, it should be directly in FastMathFlags.

Maybe unionWithRewriteIntersect? Plus the no infinity special case can be applied after 

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


More information about the llvm-commits mailing list