summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index d8ef450eeb9a..0712ff77151e 100644
--- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -2990,9 +2990,11 @@ static bool collectUnswitchCandidates(
/// into its equivalent where `Pred` is something that we support for injected
/// invariants (so far it is limited to ult), LHS in canonicalized form is
/// non-invariant and RHS is an invariant.
-static void canonicalizeForInvariantConditionInjection(
- ICmpInst::Predicate &Pred, Value *&LHS, Value *&RHS, BasicBlock *&IfTrue,
- BasicBlock *&IfFalse, const Loop &L) {
+static void canonicalizeForInvariantConditionInjection(CmpPredicate &Pred,
+ Value *&LHS, Value *&RHS,
+ BasicBlock *&IfTrue,
+ BasicBlock *&IfFalse,
+ const Loop &L) {
if (!L.contains(IfTrue)) {
Pred = ICmpInst::getInversePredicate(Pred);
std::swap(IfTrue, IfFalse);
@@ -3235,7 +3237,7 @@ static bool collectUnswitchCandidatesWithInjections(
// other).
for (auto *DTN = DT.getNode(Latch); L.contains(DTN->getBlock());
DTN = DTN->getIDom()) {
- ICmpInst::Predicate Pred;
+ CmpPredicate Pred;
Value *LHS = nullptr, *RHS = nullptr;
BasicBlock *IfTrue = nullptr, *IfFalse = nullptr;
auto *BB = DTN->getBlock();