[llvm] [InstCombine] Fold more 'fcmp' 'select' instrs idioms into 'fabs' (PR #83381)
Joshua Cranmer via llvm-commits
llvm-commits at lists.llvm.org
Thu May 16 13:31:22 PDT 2024
================
@@ -1112,6 +1113,13 @@ void PromoteMem2Reg::RenamePass(BasicBlock *BB, BasicBlock *Pred,
for (unsigned i = 0; i != NumEdges; ++i)
APN->addIncoming(IncomingVals[AllocaNo], Pred);
+ if (APN->isComplete() &&
+ APN->getFunction()->hasFnAttribute("no-signed-zeros-fp-math") &&
+ any_of(APN->incoming_values(),
+ [](Value *V) { return isa<FPMathOperator>(V); })) {
----------------
jcranmer-intel wrote:
`isa<FPMathOperator>(APN)` would work better instead.
https://github.com/llvm/llvm-project/pull/83381
More information about the llvm-commits
mailing list