Issue 76043
Summary missed optimization: Optimization based on the first of the two conditions
Labels new issue
Assignees
Reporter k-arrows
    Test case from gcc testsuite:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c
```cpp
int f(int a, int b, int c)
{
  if (a == 0 && b > c)
   return 0;
 return a;
}

int g(int a, int b, int c)
{
  if (a == 42 && b > c)
   return 42;
 return a;
}

int h(int a, int b, int c, int d)
{
  if (a == d && b > c)
   return d;
 return a;
}
```
https://godbolt.org/z/hd8Pb116n

Any of these functions can be optimized to a function which returns `a`. I feel like there may be a duplicate of this issue.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to