summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
index 1bfecea2f61..a044fe38b76 100644
--- a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
+++ b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
@@ -32,10 +32,6 @@ static bool optimizeSQRT(CallInst *Call, Function *CalledFunc,
if (Call->onlyReadsMemory())
return false;
- // The call must have the expected result type.
- if (!Call->getType()->isFloatingPointTy())
- return false;
-
// Do the following transformation:
//
// (before)
@@ -96,11 +92,14 @@ static bool runPartiallyInlineLibCalls(Function &F, TargetLibraryInfo *TLI,
if (!Call || !(CalledFunc = Call->getCalledFunction()))
continue;
+ if (Call->isNoBuiltin())
+ continue;
+
// Skip if function either has local linkage or is not a known library
// function.
LibFunc LF;
- if (CalledFunc->hasLocalLinkage() || !CalledFunc->hasName() ||
- !TLI->getLibFunc(CalledFunc->getName(), LF))
+ if (CalledFunc->hasLocalLinkage() ||
+ !TLI->getLibFunc(*CalledFunc, LF) || !TLI->has(LF))
continue;
switch (LF) {
OpenPOWER on IntegriCloud