[llvm] 70de0b8 - [LV][NFC] Simplify initialization of MinProfitableTripCount (#113445)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 4 23:14:02 PST 2024
Author: Mel Chen
Date: 2024-11-05T15:13:59+08:00
New Revision: 70de0b8bea31bb734bce86581574a60a0968d838
URL: https://github.com/llvm/llvm-project/commit/70de0b8bea31bb734bce86581574a60a0968d838
DIFF: https://github.com/llvm/llvm-project/commit/70de0b8bea31bb734bce86581574a60a0968d838.diff
LOG: [LV][NFC] Simplify initialization of MinProfitableTripCount (#113445)
Iteration runtime check confirms whether the trip count is greater than
VFxUF at least. Therefore, there is no need to adjust the
MinProfitableTripCount to VF if it is zero.
Retaining the original MinProfitableTripCount information is also
beneficial for supporting more profitable runtime checks in the future.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 1c64bd2982d764..35113c204b3c16 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -470,18 +470,14 @@ class InnerLoopVectorizer {
ProfileSummaryInfo *PSI, GeneratedRTChecks &RTChecks,
VPlan &Plan)
: OrigLoop(OrigLoop), PSE(PSE), LI(LI), DT(DT), TLI(TLI), TTI(TTI),
- AC(AC), ORE(ORE), VF(VecWidth), UF(UnrollFactor),
+ AC(AC), ORE(ORE), VF(VecWidth),
+ MinProfitableTripCount(MinProfitableTripCount), UF(UnrollFactor),
Builder(PSE.getSE()->getContext()), Legal(LVL), Cost(CM), BFI(BFI),
PSI(PSI), RTChecks(RTChecks), Plan(Plan) {
// Query this against the original loop and save it here because the profile
// of the original loop header may change as the transformation happens.
OptForSizeBasedOnProfile = llvm::shouldOptimizeForSize(
OrigLoop->getHeader(), PSI, BFI, PGSOQueryType::IRPass);
-
- if (MinProfitableTripCount.isZero())
- this->MinProfitableTripCount = VecWidth;
- else
- this->MinProfitableTripCount = MinProfitableTripCount;
}
virtual ~InnerLoopVectorizer() = default;
More information about the llvm-commits
mailing list