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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-09-23
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is a testcase which shows the difference when it comes to the vectorizer:
```
static inline const unsigned &max_1(const unsigned &d,
                      const unsigned &e) {
  if (d < e)
    return e;
  return d;
}
static inline const unsigned max_2(const unsigned &d,
                      const unsigned &e) {
  if (d < e)
    return e;
  return d;
}
void g(unsigned *f) {
  for(int i = 0; i < 1024; i++)
   f[i] = max_1(f[i], 70);
}
void g1(unsigned *f) {
  for(int i = 0; i < 1024; i++)
   f[i] = max_2(f[i], 70);
}
```

I am going to look into implementing this soonish.

Reply via email to