* [Bug tree-optimization/91882] boolean XOR tautology missed optimisation
[not found] <bug-91882-4@http.gcc.gnu.org/bugzilla/>
@ 2020-08-05 21:56 ` sucicf1 at outlook dot com
2020-08-05 22:00 ` sucicf1 at outlook dot com
` (5 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: sucicf1 at outlook dot com @ 2020-08-05 21:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91882
Ivan Sučić <sucicf1 at outlook dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sucicf1 at outlook dot com
--- Comment #4 from Ivan Sučić <sucicf1 at outlook dot com> ---
I have added im match.pd a simplify. But fir unknown reason IT doesn't het
applied. Anybody knows why?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/91882] boolean XOR tautology missed optimisation
[not found] <bug-91882-4@http.gcc.gnu.org/bugzilla/>
2020-08-05 21:56 ` [Bug tree-optimization/91882] boolean XOR tautology missed optimisation sucicf1 at outlook dot com
@ 2020-08-05 22:00 ` sucicf1 at outlook dot com
2022-11-26 17:41 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: sucicf1 at outlook dot com @ 2020-08-05 22:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91882
--- Comment #5 from Ivan Sučić <sucicf1 at outlook dot com> ---
I have added in match.pd a simplify. But for unknown reason it doesn't get
applied. Anybody knows why?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/91882] boolean XOR tautology missed optimisation
[not found] <bug-91882-4@http.gcc.gnu.org/bugzilla/>
2020-08-05 21:56 ` [Bug tree-optimization/91882] boolean XOR tautology missed optimisation sucicf1 at outlook dot com
2020-08-05 22:00 ` sucicf1 at outlook dot com
@ 2022-11-26 17:41 ` pinskia at gcc dot gnu.org
2022-11-26 17:44 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-26 17:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91882
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Depends on| |103356
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
After my patch for PR 103356, this is fixed.
Before pre:
_1 = a_4(D) ^ b_5(D);
_2 = a_4(D) | b_5(D);
if (_2 != 0)
goto <bb 3>; [50.00%]
else
goto <bb 4>; [50.00%]
<bb 3> [local count: 536870913]:
_6 = a_4(D) & b_5(D);
_9 = ~_6;
<bb 4> [local count: 1073741824]:
# iftmp.0_3 = PHI <_9(3), 0(2)>
_7 = _1 == iftmp.0_3;
After PRE (after my patch):
_1 = a_4(D) ^ b_5(D);
_2 = a_4(D) | b_5(D);
if (_2 != 0)
goto <bb 4>; [50.00%]
else
goto <bb 3>; [50.00%]
<bb 3> [local count: 536870912]:
_10 = ~_1;
goto <bb 5>; [100.00%]
<bb 4> [local count: 536870913]:
// _6 = a_4(D) & b_5(D);
// _9 = ~_6;
<bb 5> [local count: 1073741824]:
# iftmp.0_3 = PHI <_9(4), 0(3)>
# prephitmp_11 = PHI <_2(4), _10(3)>
return prephitmp_11;
And then dom comes and does (because if (a|b) == 0 then both a and b are zero
and a^b == 0 and ~(a^b) is 1):
<bb 2> [local count: 1073741824]:
_2 = a_4(D) | b_5(D);
if (_2 != 0)
goto <bb 4>; [50.00%]
else
goto <bb 3>; [50.00%]
<bb 3> [local count: 536870912]:
_1 = 0;
_10 = 1;
<bb 4> [local count: 1073741824]:
# prephitmp_11 = PHI <1(2), 1(3)>
return 1;
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103356
[Bug 103356] bool0 == ~bool1 should simplify to bool1 ^ bool0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/91882] boolean XOR tautology missed optimisation
[not found] <bug-91882-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2022-11-26 17:41 ` pinskia at gcc dot gnu.org
@ 2022-11-26 17:44 ` pinskia at gcc dot gnu.org
2022-11-26 18:01 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-26 17:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91882
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note comment #1 is not done after the patch for PR103356 .
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/91882] boolean XOR tautology missed optimisation
[not found] <bug-91882-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2022-11-26 17:44 ` pinskia at gcc dot gnu.org
@ 2022-11-26 18:01 ` pinskia at gcc dot gnu.org
2022-11-26 18:03 ` pinskia at gcc dot gnu.org
2022-11-28 2:58 ` pinskia at gcc dot gnu.org
6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-26 18:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91882
Bug 91882 depends on bug 103356, which changed state.
Bug 103356 Summary: bool0 == ~bool1 should simplify to bool1 ^ bool0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103356
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/91882] boolean XOR tautology missed optimisation
[not found] <bug-91882-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2022-11-26 18:01 ` pinskia at gcc dot gnu.org
@ 2022-11-26 18:03 ` pinskia at gcc dot gnu.org
2022-11-28 2:58 ` pinskia at gcc dot gnu.org
6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-26 18:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91882
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
comment #0 is now fixed.
Filed PR 107880 for comment #1 since it is a different issue.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/91882] boolean XOR tautology missed optimisation
[not found] <bug-91882-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2022-11-26 18:03 ` pinskia at gcc dot gnu.org
@ 2022-11-28 2:58 ` pinskia at gcc dot gnu.org
6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-28 2:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91882
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 7+ messages in thread