Skip to content

Commit 57d26c5

Browse files
committed
Add flag to override setting
1 parent b6a52d8 commit 57d26c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ static cl::opt<bool> EnableEarlyExitVectorization(
393393
cl::desc(
394394
"Enable vectorization of early exit loops with uncountable exits."));
395395

396+
static cl::opt<bool> ConsiderRegPressure(
397+
"vectorizer-consider-reg-pressure", cl::init(true), cl::Hidden,
398+
cl::desc("Discard VFs if their register pressure is too high."));
399+
396400
// Likelyhood of bypassing the vectorized loop because there are zero trips left
397401
// after prolog. See `emitIterationCountCheck`.
398402
static constexpr uint32_t MinItersBypassWeights[] = {1, 127};
@@ -3702,6 +3706,9 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
37023706

37033707
bool LoopVectorizationCostModel::shouldConsiderRegPressureForVF(
37043708
ElementCount VF) {
3709+
if (ConsiderRegPressure.getNumOccurrences())
3710+
return ConsiderRegPressure;
3711+
37053712
if (TTI.shouldConsiderVectorizationRegPressure())
37063713
return true;
37073714

0 commit comments

Comments
 (0)