[llvm-commits] [llvm] r164173 - in /llvm/trunk: include/llvm/Transforms/Utils/IntegerDivision.h lib/Transforms/Utils/CMakeLists.txt lib/Transforms/Utils/IntegerDivision.cpp

Owen Anderson resistor at mac.com
Tue Sep 18 22:10:59 PDT 2012


On Sep 18, 2012, at 7:24 PM, Chandler Carruth <chandlerc at google.com> wrote:

> On Tue, Sep 18, 2012 at 5:42 PM, Sean Silva <silvas at purdue.edu> wrote:
> Is this substantively different than just inlining __udivsi3?
> 
> I'd particularly like to understand this design choice.
> 
> It would seem better to emit a single separate function (appropriately mangled and with appropriate linkage to never conflict with anything) and allow the existing inliner to manage when the call should be present. Then the utility would ensure that emission took place and produce a call to it. Maybe there are reasons this won't work well in practice, but those should at least be discussed.

The simple answer is that this is intended for use very late in the optimization pipeline, after inlining has been done already.  If it could be done in legalization, it would be.  But given that it can't, we want to perform the substitution as late in the IR pipeline as we can.  Given that, materializing a copy of __udivsi3 and force-inlining it would just be wasteful of compile time.

--Owen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120918/0a28347f/attachment.html>


More information about the llvm-commits mailing list