On Fri, May 11, 2018 at 2:44 AM, Andi Kleen <a...@firstfloor.org> wrote:
>> @@ -31325,7 +31329,21 @@ ix86_init_mmx_sse_builtins (void)
>>      continue;
>>
>>        ftype = (enum ix86_builtin_func_type) d->flag;
>> -      def_builtin2 (d->mask, d->name, ftype, d->code);
>> +      decl = def_builtin2 (d->mask, d->name, ftype, d->code);
>> +
>> +      /* Avoid edges for ptwrites generated by vartrace pass.  */
>> +      if (decl)
>> +    {
>> +      DECL_ATTRIBUTES (decl) = build_tree_list (get_identifier ("leaf"),
>> +                            NULL_TREE);
>> +      TREE_NOTHROW (decl) = 1;
>> +    }
>> +      else
>> +    {
>> +      ix86_builtins_isa[(int)d->code].leaf_p = true;
>> +      ix86_builtins_isa[(int)d->code].nothrow_p = true;
>> +    }
>> +
>>
>> Can you please explain what is the purpose of the above change?
>
> With the vartrace patch, which was the next patch in the original
> patchkit, the compiler can generate a lot of ptwrite builtins,
> and adding so many edges can slow it down. I originally copied
> this from the MPX builtins (which had the same problem).

Please add new def_builtin_noedge2 (or something appropriately named)
aux function and declare these two new builtins manually in
ix86_init_mmx_sse_builtins.

Uros.

Reply via email to