[llvm] [X86][ConstraintFP] Model rounding control registers for inline asm (PR #92846)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 23:39:34 PDT 2024


================
@@ -1412,6 +1412,13 @@ EmitSpecialNode(SDNode *Node, bool IsClone, bool IsCloned,
       }
     }
 
+    // Add rounding control registers as implicit def for inline asm.
+    if (MF->getFunction().hasFnAttribute(Attribute::StrictFP)) {
+      ArrayRef<MCPhysReg> RCRegs = TLI->getRoundingControlRegisters(AsmStr);
+      for (MCPhysReg Reg : RCRegs)
+        MIB.addReg(Reg, RegState::ImplicitDefine);
+    }
----------------
phoebewang wrote:

The use of rounding control requires parsing a lot of instructions or just unconditional add use here. I prefer to not do so in this patch.

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


More information about the llvm-commits mailing list