Use isConvergent helper instead of directly checking attribute

This commit is contained in:
Matt Arsenault 2019-10-27 19:37:45 -07:00 committed by Matt Arsenault
parent 40b0fa7ef2
commit 9b0b626d2c
2 changed files with 2 additions and 2 deletions
llvm/lib/Transforms/Scalar

View File

@ -683,7 +683,7 @@ bool LoopUnswitch::processCurrentLoop() {
for (auto &I : *BB) {
auto CS = CallSite(&I);
if (!CS) continue;
if (CS.hasFnAttr(Attribute::Convergent))
if (CS.isConvergent())
return false;
if (auto *II = dyn_cast<InvokeInst>(&I))
if (!II->getUnwindDest()->canSplitPredecessors())

View File

@ -78,7 +78,7 @@ static bool isSafeToMove(Instruction *Inst, AliasAnalysis &AA,
if (auto *Call = dyn_cast<CallBase>(Inst)) {
// Convergent operations cannot be made control-dependent on additional
// values.
if (Call->hasFnAttr(Attribute::Convergent))
if (Call->isConvergent())
return false;
for (Instruction *S : Stores)