File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
llvm/lib/Transforms/Scalar Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -962,6 +962,15 @@ StringRef GuardWideningImpl::scoreTypeToString(WideningScore WS) {
962
962
963
963
PreservedAnalyses GuardWideningPass::run (Function &F,
964
964
FunctionAnalysisManager &AM) {
965
+ // Avoid requesting analyses if there are no guards or widenable conditions.
966
+ auto *GuardDecl = F.getParent ()->getFunction (
967
+ Intrinsic::getName (Intrinsic::experimental_guard));
968
+ bool HasIntrinsicGuards = GuardDecl && !GuardDecl->use_empty ();
969
+ auto *WCDecl = F.getParent ()->getFunction (
970
+ Intrinsic::getName (Intrinsic::experimental_widenable_condition));
971
+ bool HasWidenableConditions = WCDecl && !WCDecl->use_empty ();
972
+ if (!HasIntrinsicGuards && !HasWidenableConditions)
973
+ return PreservedAnalyses::all ();
965
974
auto &DT = AM.getResult <DominatorTreeAnalysis>(F);
966
975
auto &LI = AM.getResult <LoopAnalysis>(F);
967
976
auto &PDT = AM.getResult <PostDominatorTreeAnalysis>(F);
You can’t perform that action at this time.
0 commit comments