[LLVMdev] Question about FMA formation

Lang Hames lhames at gmail.com
Wed Dec 12 20:34:14 PST 2012

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.

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

More information about the llvm-dev mailing list