[PATCH] D21719: Unroll restructure
Michael Zolotukhin via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 30 15:29:48 PDT 2016
mzolotukhin added inline comments.
================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:704-711
@@ -690,1 +703,10 @@
+ if (TT == Pragma)
+ return (uint64_t)(LoopSize - UP.BEInsns) * UP.Count +
+ UP.BEInsns <= PragmaUnrollThreshold;
+ else if (TT == Partial)
+ return (uint64_t)(LoopSize - UP.BEInsns) * UP.Count +
+ UP.BEInsns <= UP.PartialThreshold;
+ return (uint64_t)(LoopSize - UP.BEInsns) * UP.Count +
+ UP.BEInsns <= UP.Threshold;
+}
// Returns true if unroll count was set explicitly.
----------------
evstupac wrote:
> mzolotukhin wrote:
> > Why can't we just pass `PragmaUnrollThreshold`/`UP.PartialThreshold`/`UP.Threshold instead` of `ThresholdType TT`?
> In most cases Threshold are in UP, so we need to pass only 2 parameters which is less. Also passing structure reference and its field value as different parameters looks strange.
I'd rather create a function that would compute `(LoopSize - UP.BEInsns) * UP.Count + UP.BEInsns`. I don't see a value in passing a threshold and comparing against it inside the function. It causes code duplication inside and requires an additional parameter.
Repository:
rL LLVM
https://reviews.llvm.org/D21719
More information about the llvm-commits
mailing list