Skip to content

Commit 6bea870

Browse files
committed
[LV] Use ElementCount::isKnownLT to factor code (NFC)
1 parent dd86ece commit 6bea870

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,10 @@
144144
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
145145
#include "llvm/Transforms/Utils/SizeOpts.h"
146146
#include "llvm/Transforms/Vectorize/LoopVectorizationLegality.h"
147-
#include <algorithm>
148147
#include <cassert>
149148
#include <cstdint>
150-
#include <functional>
151-
#include <iterator>
152149
#include <limits>
153-
#include <memory>
154150
#include <string>
155-
#include <tuple>
156-
#include <utility>
157151

158152
using namespace llvm;
159153

@@ -4396,10 +4390,7 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks(
43964390
sort(InvalidCosts, [&Numbering](RecipeVFPair &A, RecipeVFPair &B) {
43974391
if (Numbering[A.first] != Numbering[B.first])
43984392
return Numbering[A.first] < Numbering[B.first];
4399-
const auto &LHS = A.second;
4400-
const auto &RHS = B.second;
4401-
return std::make_tuple(LHS.isScalable(), LHS.getKnownMinValue()) <
4402-
std::make_tuple(RHS.isScalable(), RHS.getKnownMinValue());
4393+
return ElementCount::isKnownLT(A.second, B.second);
44034394
});
44044395

44054396
// For a list of ordered recipe-VF pairs:

0 commit comments

Comments
 (0)