[llvm] [FPEnv][AtomicExpand] Correct strictfp attribute handling in AtomicExpandPass (PR #87082)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 08:59:44 PDT 2024


================
@@ -135,10 +135,14 @@ class AtomicExpandLegacy : public FunctionPass {
 // IRBuilder to be used for replacement atomic instructions.
 struct ReplacementIRBuilder : IRBuilder<InstSimplifyFolder> {
   // Preserves the DebugLoc from I, and preserves still valid metadata.
+  // Enable StrictFP builder mode when appropriate.
   explicit ReplacementIRBuilder(Instruction *I, const DataLayout &DL)
       : IRBuilder(I->getContext(), DL) {
     SetInsertPoint(I);
     this->CollectMetadataToCopy(I, {LLVMContext::MD_pcsections});
+    if (I->getParent()->getParent()->getAttributes().hasFnAttr(
----------------
arsenm wrote:

```suggestion
    if (BB->getParent()->getAttributes().hasFnAttr(
```

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


More information about the llvm-commits mailing list