> @@ -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).

Possibly it could be in another patch, but then it would seem 
better to have the same semantics always. FWIW I don't think
the edges are needed for anything, but of course for moderate
use of the builtin it doesn't really matter.

-Andi

Reply via email to