summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-03-20 18:01:07 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-03-20 18:01:07 +0000
commit795dc946145cdce286c3721897b2faedb7238f5f (patch)
tree721ea5e374fc80eceeffaa93c3d02b16c0579a76 /llvm/lib
parent030d7d6daa1e93685660c6c03667126e72518101 (diff)
downloadbcm5719-llvm-795dc946145cdce286c3721897b2faedb7238f5f.tar.gz
bcm5719-llvm-795dc946145cdce286c3721897b2faedb7238f5f.zip
Fix UB found by -Wtautological-undefined-compare
llvm-svn: 298279
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 0f08d7f66fd..b486df8e818 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1439,10 +1439,9 @@ static void updateCallProfile(Function *Callee, const ValueToValueMapTy &VMap,
CalleeEntryCount.getValue());
for (auto const &Entry : VMap)
- if (isa<CallInst>(Entry.first) && &*Entry.second != nullptr &&
- isa<CallInst>(Entry.second))
- cast<CallInst>(Entry.second)
- ->updateProfWeight(CallCount, CalleeEntryCount.getValue());
+ if (isa<CallInst>(Entry.first))
+ if (auto *CI = dyn_cast_or_null<CallInst>(Entry.second))
+ CI->updateProfWeight(CallCount, CalleeEntryCount.getValue());
for (BasicBlock &BB : *Callee)
// No need to update the callsite if it is pruned during inlining.
if (VMap.count(&BB))
OpenPOWER on IntegriCloud