aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorDani <daniel.kiss@arm.com>2024-02-25 15:50:05 +0100
committerGitHub <noreply@github.com>2024-02-25 15:50:05 +0100
commit8eb6757564ccea8f9fc3bb75480f1c1d1784415a (patch)
tree538bf9156671d83e9fe73e6f850c8c61700aee60 /llvm/lib/IR/Attributes.cpp
parent9e7c0b1385baa1acffb62e0589ff100dd972cc0d (diff)
downloadllvm-8eb6757564ccea8f9fc3bb75480f1c1d1784415a.zip
llvm-8eb6757564ccea8f9fc3bb75480f1c1d1784415a.tar.gz
llvm-8eb6757564ccea8f9fc3bb75480f1c1d1784415a.tar.bz2
[NFC] Turn the StrictFP attribute check to a CompatRule. (#82600)
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 1907677..00acbbe 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -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);
+}
+
template<typename AttrClass>
static bool isEqual(const Function &Caller, const Function &Callee) {
return Caller.getFnAttribute(AttrClass::getKind()) ==