[PATCH] D104479: [PartiallyInlineLibCalls] Disable sqrt expansion for strictfp.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 17 11:56:40 PDT 2021
craig.topper updated this revision to Diff 352816.
craig.topper added a comment.
Add strictfp to caller in test case.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104479/new/
https://reviews.llvm.org/D104479
Files:
llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
llvm/test/Transforms/PartiallyInlineLibCalls/strictfp.ll
Index: llvm/test/Transforms/PartiallyInlineLibCalls/strictfp.ll
===================================================================
--- /dev/null
+++ llvm/test/Transforms/PartiallyInlineLibCalls/strictfp.ll
@@ -0,0 +1,12 @@
+; RUN: opt -S -partially-inline-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
+; RUN: opt -S -passes=partially-inline-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
+
+define float @f(float %val) strictfp {
+; CHECK-LABEL: @f
+; CHECK: call{{.*}}@sqrtf
+; CHECK-NOT: call{{.*}}@sqrtf
+ %res = tail call float @sqrtf(float %val) strictfp
+ ret float %res
+}
+
+declare float @sqrtf(float)
Index: llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
+++ llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
@@ -121,7 +121,7 @@
if (!Call || !(CalledFunc = Call->getCalledFunction()))
continue;
- if (Call->isNoBuiltin())
+ if (Call->isNoBuiltin() || Call->isStrictFP())
continue;
// Skip if function either has local linkage or is not a known library
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104479.352816.patch
Type: text/x-patch
Size: 1185 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210617/c4ad7b73/attachment.bin>
More information about the llvm-commits
mailing list