summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp b/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
index f48d3cc098a..83861b98fbd 100644
--- a/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
@@ -360,10 +360,11 @@ bool LoopVersioningLICM::legalLoopMemoryAccesses() {
bool LoopVersioningLICM::instructionSafeForVersioning(Instruction *I) {
assert(I != nullptr && "Null instruction found!");
// Check function call safety
- if (isa<CallInst>(I) && !AA->doesNotAccessMemory(CallSite(I))) {
- LLVM_DEBUG(dbgs() << " Unsafe call site found.\n");
- return false;
- }
+ if (auto *Call = dyn_cast<CallBase>(I))
+ if (!AA->doesNotAccessMemory(Call)) {
+ LLVM_DEBUG(dbgs() << " Unsafe call site found.\n");
+ return false;
+ }
// Avoid loops with possiblity of throw
if (I->mayThrow()) {
LLVM_DEBUG(dbgs() << " May throw instruction found in loop body\n");
OpenPOWER on IntegriCloud