[LLVMdev] [RFC][Float2Int] Converting (fcmp Pred, x * F, y) to (ICmp ...)

Silviu Baranga Silviu.Baranga at arm.com
Thu Apr 30 03:32:34 PDT 2015


On Apr 29, 2015, at 2:33 PM, Matt Arsenault <arsenm2 at gmail.com> wrote:

     This is not true on the targets I care about. The integer division
(which, even with the division

     by constant expansion to multiplies with magic constants) would be
significantly more expensive.

 

I agree that we might need a hook to disable this for

targets where the transformation is not profitable.

 

On Apr 29, 2015, at 3:00 PM, Stephen Canon <scanon at apple.com> wrote:

 

     What targets *does* this benefit?  Soft-float targets and Cortex-A8?

 

Regarding profitability: there can be side effects of

allowing this transformation to happen. Further operations

could get converted from float to int, and integer

math is a lot easier to reason about.

 

But that would be hard to model at the moment, so we

could only consider the case where we just have something like:

(fcmp, (sitofp .. ) , (fmul  constant, sitofp))

which (ARM specific) is two moves from core registers to FP registers,

two conversions, one multiplication and one comparison.

The latency for this (fmov + fcvt + fmul + fcmp) should be large

enough even on AArch64 OoO cores to make the transformation

profitable. Of course, it depends on the specific core.

 

Thanks,

Silviu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150430/ff2f6ea8/attachment.html>


More information about the llvm-dev mailing list