[llvm] [NFC] Turn the StrictFP attribute check to a CompatRule. (PR #82600)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 05:34:43 PST 2024


================
@@ -2039,6 +2039,13 @@ static bool checkDenormMode(const Function &Caller, const Function &Callee) {
   return false;
 }
 
+static bool checkStrictFP(const Function &Caller, const Function &Callee) {
+  // Do not inline strictfp function into non-strictfp one. It would require
+  // conversion of all FP operations in host function to constrained intrinsics.
+  return !(Callee.getAttributes().hasFnAttr(Attribute::StrictFP) &&
+           !Caller.getAttributes().hasFnAttr(Attribute::StrictFP));
----------------
nikic wrote:

```suggestion
  return !Callee.getAttributes().hasFnAttr(Attribute::StrictFP) ||
           Caller.getAttributes().hasFnAttr(Attribute::StrictFP);
```

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


More information about the llvm-commits mailing list