[LLVMdev] Question about FMA formation
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev