[Bug rtl-optimization/110823] [missed optimization] >50% speedup for x86-64 ASCII processing a la GNU diffutils
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jul 26 19:54:21 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110823
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The gimple level looks like:
```
if (_54 >= 0)
goto <bb 4>; [90.00%]
else
goto <bb 5>; [10.00%]
<bb 4> [local count: 63261141172]:
_18 = (unsigned int) _54;
goto <bb 8>; [100.00%]
...
len_37 = mbrtoc32 (&ch, iter_39, _36, &mbs);
len.0_38 = (signed long) len_37;
if (len.0_38 < 0)
goto <bb 7>; [10.00%]
else
goto <bb 6>; [90.00%]
<bb 6> [local count: 632611429]:
ch.1_42 = ch; // Note this is a local variable
<bb 7> [local count: 7029015815]:
# SR.45_12 = PHI <ch.1_42(6), 0(5)>
# SR.46_46 = PHI <len_37(6), 1(5)>
mbs ={v} {CLOBBER(eol)};
ch ={v} {CLOBBER(eol)};
<bb 8> [local count: 70290156974]:
# SR.41_16 = PHI <_18(4), SR.45_12(7)>
# SR.42_47 = PHI <1(4), SR.46_46(7)>
_6 = (long long unsigned int) SR.41_16;
```
Maybe we should have a type promotion pass on the gimple level that promotes
_54 to `long unsigned int`.
More information about the Gcc-bugs
mailing list