| Issue |
71792
|
| Summary |
Simplification Comparison for `(a | b) ? (a ^ b) : (a & b)` etc. (Clang13 vs Clang trunk)
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
k-arrows
|
Consider the following six functions.
https://godbolt.org/z/cTsd43jhh
```cpp
bool test1(bool a, bool b)
{
return (a | b) ? (a ^ b) : (a & b);
}
bool test2(bool a, bool b)
{
return (a | b) ? (a & b) : (a ^ b);
}
bool test3(bool a, bool b)
{
return (a & b) ? (a | b) : (a ^ b);
}
bool test4(bool a, bool b)
{
return (a & b) ? (a ^ b) : (a | b);
}
bool test5(bool a, bool b)
{
return (a ^ b) ? (a | b) : (a & b);
}
bool test6(bool a, bool b)
{
return (a ^ b) ? (a & b) : (a | b);
}
```
Clang13 can simplify four of these, `test1`, `test2`, `test3` and `test4`, while Clang trunk cannot. Neither Clang13 nor Clang trunk can simplify `test5` and `test6`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs