https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83022

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #8)
> Created attachment 61040 [details]
> Patch which needs some comments but is lightly tested and seems to work
> 
> This also needs testcases but the patch fixes the performance issue here.
> Note it is on top of the patch for PR 87900 since that needs the similar
> code too.

This patch still allows to optimizing this:
```
void *m (int s, bool c, bool *a)
{
  void *r = __builtin_malloc (s);
 if (r)
  {
    __builtin_memset (r, 0, s);
    *a = 1;
  }
  return r;
}
```
Which llvm can do too. So it is it is only pattern matching the condition
between the 2 BBs.

>the move to the strlen pass made that inconvenient

I don't see how that was incovenient especially since my patch shows how easy
it was it was easy to add that pattern matching back.

Reply via email to