@@ -11665,8 +11665,8 @@ bool ScalarEvolution::isBasicBlockEntryGuardedByCond(const BasicBlock *BB,
1166511665 }
1166611666
1166711667 // Check conditions due to any @llvm.experimental.guard intrinsics.
11668- auto *GuardDecl = F.getParent()->getFunction (
11669- Intrinsic::getName( Intrinsic::experimental_guard) );
11668+ auto *GuardDecl = Intrinsic::getDeclarationIfExists (
11669+ F.getParent(), Intrinsic::experimental_guard);
1167011670 if (GuardDecl)
1167111671 for (const auto *GU : GuardDecl->users())
1167211672 if (const auto *Guard = dyn_cast<IntrinsicInst>(GU))
@@ -13615,8 +13615,8 @@ ScalarEvolution::ScalarEvolution(Function &F, TargetLibraryInfo &TLI,
1361513615 // ScalarEvolution to optimize based on those guards. For now we prefer to be
1361613616 // efficient in lieu of being smart in that rather obscure case.
1361713617
13618- auto *GuardDecl = F.getParent()->getFunction (
13619- Intrinsic::getName( Intrinsic::experimental_guard) );
13618+ auto *GuardDecl = Intrinsic::getDeclarationIfExists (
13619+ F.getParent(), Intrinsic::experimental_guard);
1362013620 HasGuards = GuardDecl && !GuardDecl->use_empty();
1362113621}
1362213622
@@ -15593,8 +15593,8 @@ ScalarEvolution::LoopGuards::collect(const Loop *L, ScalarEvolution &SE) {
1559315593 }
1559415594
1559515595 // Second, collect information from llvm.experimental.guards dominating the loop.
15596- auto *GuardDecl = SE.F.getParent()->getFunction (
15597- Intrinsic::getName( Intrinsic::experimental_guard) );
15596+ auto *GuardDecl = Intrinsic::getDeclarationIfExists (
15597+ SE.F.getParent(), Intrinsic::experimental_guard);
1559815598 if (GuardDecl)
1559915599 for (const auto *GU : GuardDecl->users())
1560015600 if (const auto *Guard = dyn_cast<IntrinsicInst>(GU))
0 commit comments