[PATCH] D38952: [ARM] Allow unrolling on multi-block loops.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 11:20:06 PDT 2017


efriedma added inline comments.


================
Comment at: lib/Target/ARM/ARMTargetTransformInfo.cpp:628
+                                            I.value_op_end());
+      Cost += getUserCost(&I, Operands);
     }
----------------
samparker wrote:
> efriedma wrote:
> > Would it make sense to break out of this loop early if "Cost" is 12 or more?
> No, we still want to allow partial and runtime unrolling and the default thresholds in the unroller work well for loops which the unroller understands. The cost is used to force the unroller to do its thing on small loops that it otherwise wouldn't unroll.
I just looked again.  As far as I can tell, the only use of "Cost" is the "if (Cost < 12)" check.


https://reviews.llvm.org/D38952





More information about the llvm-commits mailing list