[Bug tree-optimization/116008] MAX<i+j, i+k> should simplify to MAX<j,k>+i

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 19 21:03:34 GMT 2024


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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note clang/LLVM can optimize the case where j/k are constants but gcc still
does not. e.g.
```
int f2(int i, int j, int k)
{
        j = 1;
        k = 2;
        int t = i+j;
        int t1 = i+k;
        return t > t1 ? t : t1;
}
```


More information about the Gcc-bugs mailing list