[PATCH] D18898: [Loop Rotation] Make default max rotation header size threshold dependent on target CPU

Andrey Turetskiy via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 04:57:05 PDT 2016


aturetsk added a comment.

OK.


================
Comment at: lib/Target/X86/X86TargetTransformInfo.cpp:1591
@@ +1590,3 @@
+
+unsigned X86TTIImpl::getLoopRotationDefaultThreshold() const {
+  // The loop rotation threshold equal to 2 shows the best performance and code
----------------
echristo wrote:
> Can you elaborate? What did you test on, do you know why? Is it just magic or is it based on something about the cpu?
The positive effect was measured on Spec2000 (code size only, Spec2000 is too large to run on MCU) and Dhrystone (code size and performance). Also tested code size on ULP and code size with performance on Coremark, but there was no effect.
The initial idea was to just improve code size for -Os by reducing the threshold, but since performance on Dhrystone improved as well (both for -Os and -O2), it seems to be a good idea to use a smaller threshold for Lakemont regardless of -O option.
So this is based on mere tuning, no special idea behind it.


https://reviews.llvm.org/D18898





More information about the llvm-commits mailing list