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

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 01:36:14 PDT 2017


samparker added inline comments.


================
Comment at: lib/Target/ARM/ARMTargetTransformInfo.cpp:628
+                                            I.value_op_end());
+      Cost += getUserCost(&I, Operands);
     }
----------------
efriedma wrote:
> 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.
Yes, sorry, somehow I managed to misread your question. We don't want to break early because a call maybe discovered once Cost > 12, in this case we could still unroll and prevent inlining of the call.


https://reviews.llvm.org/D38952





More information about the llvm-commits mailing list