[PATCH] D119148: [LoopUnroll] Always respect user unroll pragma
Whitney Tsang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 7 08:45:35 PST 2022
Whitney created this revision.
Whitney added a reviewer: Meinersbur.
Whitney added a project: LoopOptWG.
Herald added subscribers: zzheng, hiraditya.
Whitney requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
IMO when user provide unroll pragma, compiler should always respect it.
It is not clear to me why loop unroll pass currently ensure that the unrolled loop size is limited by `PragmaUnrollThreshold`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119148
Files:
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
Index: llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -788,14 +788,12 @@
// 2nd priority is unroll count set by pragma.
if (PInfo.PragmaCount > 0) {
- if ((UP.AllowRemainder || (TripMultiple % PInfo.PragmaCount == 0)) &&
- UCE.getUnrolledLoopSize(UP, PInfo.PragmaCount) < PragmaUnrollThreshold)
+ if ((UP.AllowRemainder || (TripMultiple % PInfo.PragmaCount == 0)))
return PInfo.PragmaCount;
}
if (PInfo.PragmaFullUnroll && TripCount != 0) {
- if (UCE.getUnrolledLoopSize(UP, TripCount) < PragmaUnrollThreshold)
- return TripCount;
+ return TripCount;
}
// if didn't return until here, should continue to other priorties
return None;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119148.406481.patch
Type: text/x-patch
Size: 859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220207/d9aade85/attachment.bin>
More information about the llvm-commits
mailing list