Folding nodes in instruction selection - please review
Quentin Colombet
qcolombet at apple.com
Wed Jul 10 10:28:15 PDT 2013
Hi Elena,
This is looking good with some minor comments:
- Could you paste the comment on the additional argument for IsProfitableToFold in the header file too?
- Add a test case.
Thanks,
-Quentin
On Jul 10, 2013, at 12:27 AM, "Demikhovsky, Elena" <elena.demikhovsky at intel.com> wrote:
> Hi, please review this patch.
>
> Thanks.
>
> Elena
>
>
> _____________________________________________
> From: Demikhovsky, Elena
> Sent: Monday, July 08, 2013 14:48
> To: llvm-commits at cs.uiuc.edu
> Cc: Demikhovsky, Elena; Nadav Rotem <nrotem at apple.com> (nrotem at apple.com)
> Subject: Folding nodes in instruction selection - please review
>
>
> Hi,
>
> I analyzed the folding DAG nodes algorithm in LLVM, compared to code generated by Intel compiler and got into conclusion that the LLVM code is not always optimal.
> This is an example:
>
> %b1 = fadd <8 x float> %a1, <float AAA, float AAA, float AAA, float AAA, float AAA, float AAA, float AAA, float AAA >
> %b2 = fadd <8 x float> %a2, <float AAA, float AAA, float AAA, float AAA, float AAA, float AAA, float AAA, float AAA >
> %c = fmul <8 x float> %b1, %b2
>
> The result (1) bellow is not better than (2), because loading constant is not a problem, but spilling %ymm2 that may be required in (1) is not cheap.
>
> (1)
> vmovaps .LCPI1_0(%rip), %ymm2
> vaddps %ymm2, %ymm1, %ymm1
> vaddps %ymm2, %ymm0, %ymm0
> vmulps %ymm1, %ymm0, %ymm0
>
> (2)
> vaddps .LCPI1_0(%rip), %ymm1, %ymm1
> vaddps .LCPI1_0(%rip), %ymm0, %ymm0
> vmulps %ymm1, %ymm0, %ymm0
>
> In the attached patch I did a minor thing that does not change the current algorithm, but allows to add some target-specific analysis.
> Please review.
>
> Thank you.
>
> Elena
>
>
>
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
> <folding.diff>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130710/72d591f9/attachment.html>
More information about the llvm-commits
mailing list