forked from OSchip/llvm-project
Use isConvergent helper instead of directly checking attribute
This commit is contained in:
parent
40b0fa7ef2
commit
9b0b626d2c
llvm/lib/Transforms/Scalar
|
@ -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())
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue