Convert foo() into baz(). void bar (void); int foo (int x, int y) { int t1 = x < 0; int t2 = y < 0; return t1 || t2; } int baz (int x, int y) { return (x | y) < 0; } Needless to mention, we should do this fairly late in SSA optimizations.
Another one just like above: void bar (void); void foo (int a, int b) { if (a != 0) return; if (b != 0) return; bar (); } void baz (int a, int b) { if ((a | b) == 0) bar (); } See also PR 15241.
Confirmed.
For AMD64, the functions from the first test case don't produce the same code either, so combine is not catching this either.
x86_64 r10-7080 for me produce identical code -- c#0 with -O2 -- c#1 with -O
Resolved at some point in the past. Not worth the trouble to bisect.