https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52082
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
One thing I noticed that LLVM does to reduce the register pressure is:
(z ? v4 [k] : v3 [k])
Gets pulled out of the loop such that it is:
tmpaddr = z ? v4 : v3;
and then inside the loop it does:
(tempaddr)[k]
GCC still has (I changed the bb order just so it is easier to see what is going
on):
if (z_39(D) != 0)
goto <bb 9>; [50.00%]
else
goto <bb 11>; [50.00%]
<bb 11> [local count: 5427362]:
_21 = v3.3_18 + _157;
iftmp.1_40 = *_21;
goto <bb 10>; [100.00%]
<bb 9> [local count: 5427362]:
_17 = v4.2_14 + _157;
iftmp.1_41 = *_17;
<bb 10> [local count: 10854724]:
# m_8 = PHI <iftmp.1_40(11), iftmp.1_41(9)>
if (m_8 != 0B)
goto <bb 12>; [94.50%]
else
goto <bb 19>; [5.50%]
we should able to do the similar it seems and need two less registers; one to
hold z and one to hold either v3 or v4. This won't be enough for this testcase
but it will be something.