summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/Sink.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/Sink.cpp')
-rw-r--r--lib/Transforms/Scalar/Sink.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/Sink.cpp b/lib/Transforms/Scalar/Sink.cpp
index ca6b93e0b4a9..c99da8f0737a 100644
--- a/lib/Transforms/Scalar/Sink.cpp
+++ b/lib/Transforms/Scalar/Sink.cpp
@@ -72,18 +72,18 @@ static bool isSafeToMove(Instruction *Inst, AliasAnalysis &AA,
return false;
}
- if (isa<TerminatorInst>(Inst) || isa<PHINode>(Inst) || Inst->isEHPad() ||
+ if (Inst->isTerminator() || isa<PHINode>(Inst) || Inst->isEHPad() ||
Inst->mayThrow())
return false;
- if (auto CS = CallSite(Inst)) {
+ if (auto *Call = dyn_cast<CallBase>(Inst)) {
// Convergent operations cannot be made control-dependent on additional
// values.
- if (CS.hasFnAttr(Attribute::Convergent))
+ if (Call->hasFnAttr(Attribute::Convergent))
return false;
for (Instruction *S : Stores)
- if (isModSet(AA.getModRefInfo(S, CS)))
+ if (isModSet(AA.getModRefInfo(S, Call)))
return false;
}
@@ -104,7 +104,7 @@ static bool IsAcceptableTarget(Instruction *Inst, BasicBlock *SuccToSinkTo,
// It's never legal to sink an instruction into a block which terminates in an
// EH-pad.
- if (SuccToSinkTo->getTerminator()->isExceptional())
+ if (SuccToSinkTo->getTerminator()->isExceptionalTerminator())
return false;
// If the block has multiple predecessors, this would introduce computation