[LLVMdev] Question about FMA formation

Eric Christopher echristo at gmail.com
Wed Dec 12 22:24:31 PST 2012


On Wed, Dec 12, 2012 at 8:34 PM, Lang Hames <lhames at gmail.com> wrote:

> Hi Michael, Shuxin,
>
>
>> Shuxin was showing some more complicated patterns that required
>> re-association to match (fast-math flags permitting). For those, we're
>> considering if having a re-associate-for-FMA functionality in
>> codegen-prepare would solve that problem. Thus, we can re-associate in
>> codegen-prepare and emit FMA in fast-isel.
>>
>
> Yep. I misread the association on Shuxin's example, but even ((a*b) +
> (c*d)) + e would match to a 3-instructions:
> (fadd (fma a b (fmul c d)) e).
>
> If there are hairier examples that really require reassociation my vote
> would be for this last scheme: An FMA-friendly reassociation pass run
> before isel that exposes simple patterns for isel to match.
>
>

Agreed. I don't think fast isel should be attempting to form any new
patterns.

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


More information about the llvm-dev mailing list