summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorDaniel Neilson <dneilson@azul.com>2017-07-27 16:49:39 +0000
committerDaniel Neilson <dneilson@azul.com>2017-07-27 16:49:39 +0000
commit2574d7cbf635076825ea7953b12b75593ba41024 (patch)
treefcc36834152304e66c0762fbe4b5184c96a49bf9 /llvm/lib/Transforms/Utils/Local.cpp
parentef5bbd61dac4abab34df4e79f6b3f5d167e7df04 (diff)
downloadbcm5719-llvm-2574d7cbf635076825ea7953b12b75593ba41024.tar.gz
bcm5719-llvm-2574d7cbf635076825ea7953b12b75593ba41024.zip
All libcalls should be considered to be GC-leaf functions.
Summary: It is possible for some passes to materialize a call to a libcall (ex: ldexp, exp2, etc), but these passes will not mark the call as a gc-leaf-function. All libcalls are actually gc-leaf-functions, so we change llvm::callsGCLeafFunction() to tell us that available libcalls are equivalent to gc-leaf-function calls. Reviewers: sanjoy, anna, reames Reviewed By: anna Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35840 llvm-svn: 309291
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 74610613001..805d7155ec7 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1832,7 +1832,8 @@ unsigned llvm::replaceDominatedUsesWith(Value *From, Value *To,
return ::replaceDominatedUsesWith(From, To, BB, ProperlyDominates);
}
-bool llvm::callsGCLeafFunction(ImmutableCallSite CS) {
+bool llvm::callsGCLeafFunction(ImmutableCallSite CS,
+ const TargetLibraryInfo &TLI) {
// Check if the function is specifically marked as a gc leaf function.
if (CS.hasFnAttr("gc-leaf-function"))
return true;
@@ -1846,6 +1847,14 @@ bool llvm::callsGCLeafFunction(ImmutableCallSite CS) {
IID != Intrinsic::experimental_deoptimize;
}
+ // Lib calls can be materialized by some passes, and won't be
+ // marked as 'gc-leaf-function.' All available Libcalls are
+ // GC-leaf.
+ LibFunc LF;
+ if (TLI.getLibFunc(CS, LF)) {
+ return TLI.has(LF);
+ }
+
return false;
}
OpenPOWER on IntegriCloud