================ @@ -1140,6 +1148,15 @@ void PromoteMem2Reg::RenamePass(BasicBlock *BB, BasicBlock *Pred, if (isa<FPMathOperator>(APN) && NoSignedZeros) APN->setHasNoSignedZeros(true); + // This allows select instruction folding relevant to floating point + // reductions whose operand is a PHI. + if (isa<FPMathOperator>(APN) && NoNaNs) + APN->setHasNoNaNs(true); + + // Handle NoInfs flag too. + if (isa<FPMathOperator>(APN) && NoInfs) + APN->setHasNoInfs(true); ---------------- nikic wrote:
I'd suggest to extract a common `if (isa<FPMathOperator>(APN))` around all three. https://github.com/llvm/llvm-project/pull/114271 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits