Alex S
2014-Nov-10 19:30 UTC
[LLVMdev] About inlining the modulo function in ARM architecture
Hi Tim, Thanks for your reply. On Mon, Nov 10, 2014 at 1:26 PM, Tim Northover <t.p.northover at gmail.com> wrote:> Hi Ray, > > On 10 November 2014 10:13, Alex S <alexmountain13 at gmail.com> wrote: > > Sorry for bothering those not interested. I found that ARM backend will > > insert a modulo function > > (like __modsi3) instead of the modulo instruction. I wonder how we can > > inline the modulo function > > into the program. Is there any OPTION we can use in the opt or llc? > > It depends on whether the CPU actually supports integer division. > Surprisingly modern CPUs don't (the Cortex-A9 for example), and LLVM > doesn't synthesise an entire divide loop. >I know this may degrade the performance. I wonder whether there is any easy way to inline these functions into the callsite? Thanks again!> > Oddly, it also seems to call the library at -O0, because that's what > the FastISel decides to do. That strikes me as a bug, or at least an > oddity. > > Cheers. > > Tim. >Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141110/9b1a02a4/attachment.html>
Tim Northover
2014-Nov-10 19:47 UTC
[LLVMdev] About inlining the modulo function in ARM architecture
> I know this may degrade the performance. I wonder whether there is any easy > way to inline these functions into the callsite? Thanks again!I'm afraid not. There does appear to be an IntegerDivision.cpp file that you could write an IR pass around to do the job, but it's not accessible without C++ code at the moment. Cheers. Tim.
Joerg Sonnenberger
2014-Nov-10 20:00 UTC
[LLVMdev] About inlining the modulo function in ARM architecture
On Mon, Nov 10, 2014 at 02:30:23PM -0500, Alex S wrote:> I know this may degrade the performance. I wonder whether there is any easy > way to inline these functions into the callsite? Thanks again!I don't think that's a good idea. It is quite a bit code for optimal performance. Joerg
Alex S
2014-Nov-10 20:05 UTC
[LLVMdev] About inlining the modulo function in ARM architecture
Sure. I am doing this not for performance benefit. Sorry for the misunderstanding. Thanks, Ray On Mon, Nov 10, 2014 at 3:00 PM, Joerg Sonnenberger <joerg at britannica.bec.de> wrote:> On Mon, Nov 10, 2014 at 02:30:23PM -0500, Alex S wrote: > > I know this may degrade the performance. I wonder whether there is any > easy > > way to inline these functions into the callsite? Thanks again! > > I don't think that's a good idea. It is quite a bit code for optimal > performance. > > Joerg >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141110/e5036a67/attachment.html>