diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2025-02-03 18:51:27 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2025-02-03 18:51:27 +0000 |
| commit | 32a711e1c447004eb1fd015925f305ed1d8426de (patch) | |
| tree | 6647b84917053748367f573f9bdc66e809cb17f5 /llvm/lib/Transforms/Scalar/GuardWidening.cpp | |
| parent | ac9a064cb179f3425b310fa2847f8764ac970a4d (diff) | |
Vendor import of llvm-project main llvmorg-20-init-19504-g8c2574832ed2,vendor/llvm-project/llvmorg-20-init-19504-g8c2574832ed2vendor/llvm-project/main
the last commit before the upstream release/20.x branch was created.
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GuardWidening.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GuardWidening.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/GuardWidening.cpp b/llvm/lib/Transforms/Scalar/GuardWidening.cpp index e7ff2a14469c..2978b7990a6e 100644 --- a/llvm/lib/Transforms/Scalar/GuardWidening.cpp +++ b/llvm/lib/Transforms/Scalar/GuardWidening.cpp @@ -52,7 +52,6 @@ #include "llvm/IR/Dominators.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/IntrinsicInst.h" -#include "llvm/IR/Module.h" #include "llvm/IR/PatternMatch.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" @@ -728,7 +727,7 @@ GuardWideningImpl::mergeChecks(SmallVectorImpl<Value *> &ChecksToHoist, // L >u C0 && L >u C1 -> L >u max(C0, C1) ConstantInt *RHS0, *RHS1; Value *LHS; - ICmpInst::Predicate Pred0, Pred1; + CmpPredicate Pred0, Pred1; // TODO: Support searching for pairs to merge from both whole lists of // ChecksToHoist and ChecksToWiden. if (ChecksToWiden.size() == 1 && ChecksToHoist.size() == 1 && @@ -980,11 +979,11 @@ StringRef GuardWideningImpl::scoreTypeToString(WideningScore WS) { PreservedAnalyses GuardWideningPass::run(Function &F, FunctionAnalysisManager &AM) { // Avoid requesting analyses if there are no guards or widenable conditions. - auto *GuardDecl = F.getParent()->getFunction( - Intrinsic::getName(Intrinsic::experimental_guard)); + auto *GuardDecl = Intrinsic::getDeclarationIfExists( + F.getParent(), Intrinsic::experimental_guard); bool HasIntrinsicGuards = GuardDecl && !GuardDecl->use_empty(); - auto *WCDecl = F.getParent()->getFunction( - Intrinsic::getName(Intrinsic::experimental_widenable_condition)); + auto *WCDecl = Intrinsic::getDeclarationIfExists( + F.getParent(), Intrinsic::experimental_widenable_condition); bool HasWidenableConditions = WCDecl && !WCDecl->use_empty(); if (!HasIntrinsicGuards && !HasWidenableConditions) return PreservedAnalyses::all(); |
