summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-06 19:51:54 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-06 19:51:54 +0000
commit364ef5db2b23f0aee6e6aa76b338d2210e54a0d7 (patch)
tree775ff2376fde3d59fa1c1128360d00d6165e4842 /llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
parentad56843dd780711fea6228fb672d7e56af74cb12 (diff)
downloadbcm5719-llvm-364ef5db2b23f0aee6e6aa76b338d2210e54a0d7.tar.gz
bcm5719-llvm-364ef5db2b23f0aee6e6aa76b338d2210e54a0d7.zip
Pull out repeated CI->getCalledFunction() calls. NFCI.
llvm-svn: 360070
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index 3b874e4b457..cc0b6e0f469 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -1075,7 +1075,8 @@ static Value *valueHasFloatPrecision(Value *Val) {
/// Shrink double -> float functions.
static Value *optimizeDoubleFP(CallInst *CI, IRBuilder<> &B,
bool isBinary, bool isPrecise = false) {
- if (!CI->getType()->isDoubleTy() || !CI->getCalledFunction())
+ Function *CalleeFn = CI->getCalledFunction();
+ if (!CI->getType()->isDoubleTy() || !CalleeFn)
return nullptr;
// If not all the uses of the function are converted to float, then bail out.
@@ -1095,7 +1096,6 @@ static Value *optimizeDoubleFP(CallInst *CI, IRBuilder<> &B,
if (!V[0] || (isBinary && !V[1]))
return nullptr;
- Function *CalleeFn = CI->getCalledFunction();
StringRef CalleeNm = CalleeFn->getName();
AttributeList CalleeAt = CalleeFn->getAttributes();
bool CalleeIn = CalleeFn->isIntrinsic();
OpenPOWER on IntegriCloud