[PATCH] Fw: [LLVMdev] More FMA folding opportunities

Olivier H Sallenave ohsallen at us.ibm.com
Mon Dec 29 14:09:11 PST 2014



Hi,

Attached is a patch to support more FMA folding opportunities (especially
for PPC) as discussed below.

Thanks,
Olivier

(See attached file: patch.diff)



----- Forwarded by Olivier H Sallenave/Watson/IBM on 12/29/2014 04:56 PM
-----

From:	Hal Finkel <hfinkel at anl.gov>
To:	Olivier H Sallenave/Watson/IBM at IBMUS
Cc:	<llvmdev at cs.uiuc.edu>
Date:	09/30/2014 08:08 PM
Subject:	Re: [LLVMdev] More FMA folding opportunities



----- Original Message -----
> From: "Olivier H Sallenave" <ohsallen at us.ibm.com>
> To: llvmdev at cs.uiuc.edu
> Sent: Monday, September 29, 2014 3:34:51 PM
> Subject: [LLVMdev] More FMA folding opportunities
>
> Hi,
>
> I think more opportunities might be added for FMA in the DAG
> combiner, please tell me what you think. Right now, those cases are
> implemented:
>
> fold (fadd (fmul x, y), z) -> (fma x, y, z)
> fold (fadd x, (fmul y, z)) -> (fma y, z, x)
>
> When the TLI callback "enableAggressiveFMAFusion" returns true, we
> might also support:
>
> fold (fadd (fma x, y, (fmul u, v)), z) -> (fma x, y (fma u, v, z))
> fold (fadd x, (fma y, z, (fmul u, v)) -> (fma y, z (fma u, v, x))
>
> This kind of reassociation generates two FMA for (x^2 + y^2 + z).


Yes, this all sounds reasonable.

Thanks again,
Hal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141229/90ab37d2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 6299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141229/90ab37d2/attachment.obj>


More information about the llvm-commits mailing list