This is the mail archive of the
mailing list for the GCC project.
Re: How to gimplify_build a FMA_EXPR since it was removed?
- From: Laurent Thévenoux <lrnt at thvnx dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Tue, 5 Feb 2019 00:13:44 +0100
- Subject: Re: How to gimplify_build a FMA_EXPR since it was removed?
- References: <78ef-5c583400-5-25671200@29579276> <CA+=Sn1m6Lj=1ahbq2vSj+46sAjfBhN0=jKu8T0t-37EbamUgTA@mail.gmail.com>
Thanks for pointing this me out. Nevertheless, I’m not sure this can apply in my case since gimple_build_call_internal() returns a gimple data type while gimplify_build3() returns a tree data type. I’ll try to figure how faisable is to use it in my case. For more context, see the code snippet below.
some_fn (gimple_stmt_iterator *gsi, tree inner_type, tree ar, tree ai, tree br, tree bi)
tree rr, ri, pr1;
p1r = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, ar);
rr = gimplify_build3 (gsi, FMA_EXPR, inner_type, ai, ai, p1r);
ri = build_real (inner_type, dconst0);
update_complex_assignment (gsi, rr, ri);
> Le 4 févr. 2019 à 23:38, Andrew Pinski <firstname.lastname@example.org> a écrit :
> On Mon, Feb 4, 2019 at 4:47 AM Laurent Thévenoux <email@example.com> wrote:
>> Sorry for duplicate, gcc-help was not the right mailing list for this one.
>> -------- Original Message --------
>> Subject: How to gimplify_build a FMA_EXPR since it was removed?
>> Date: Monday, February 04, 2019 13:28 CET
>> From: Laurent Thévenoux <firstname.lastname@example.org>
>> To: email@example.com
>> CC: firstname.lastname@example.org
>> I've developed some code in gcc/tree-complex.c. I was using the
>> FMA_EXPR to generate fma operations such as in:
>> rr = gimplify_build3 (gsi, FMA_EXPR, inner_type, ai, ai, p1r);```
>> FMA_EXPR was removed in https://gcc.gnu.org/ml/gcc-patches/2018-05/msg00570.html.
>> Is there an easy way to gimplify FMAs with the new functions
>> introduced in the patch below?
> From that patch (e.g. rs6000_gimple_fold_builtin):
> - gimple *g = gimple_build_assign (lhs, FMA_EXPR, arg0, arg1, arg2);
> + gcall *g = gimple_build_call_internal (IFN_FMA, 3, arg0, arg1, arg2);
> + gimple_call_set_lhs (g, lhs);
> + gimple_call_set_nothrow (g, true);
> Andrew Pinski