[llvm] [SROA] Propagate no-signed-zeros(nsz) fast-math flag on the phi node using function attribute (PR #83381)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 05:01:01 PDT 2024


================
@@ -1112,6 +1113,12 @@ 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") &&
----------------
arsenm wrote:

Unfortunately these attributes have explicit boolean parameters. You should use .getValueAsBool() on this. You should add a negative test with an explicit ="false" value 

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


More information about the llvm-commits mailing list