RFR(L): 8186027: C2: loop strip mining
Vladimir Kozlov
vladimir.kozlov at oracle.com
Tue Nov 7 17:14:51 UTC 2017
On 11/7/17 8:49 AM, Roland Westrelin wrote:
>
>>>> src/hotspot/share/opto/superword.cpp
>>>>
>>>> Where next change come from?
>>>>
>>>> + if (t2->Opcode() == Op_AddI && t2 == _lp->as_CountedLoop()->incr()) continue; // don't mess
>>>> with the iv
>>>
>>> I saw a few cases where t2 is the increment of the CountedLoop
>>> iv. SuperWord::opnd_positions_match() then swaps the edges of the AddI
>>> and later CountedLoopEndNode::phi() fails because the edges of the iv's
>>> AddI are not in the expected order anymore.
>>
>> Good. But why you need to check Opcode() too? In Counted loops it should be Int type.
>
> It's not required for correctness but _lp->as_CountedLoop()->incr() is
> somewhat expensive because it has to follow several edges from the loop
> head to the AddI so t2->Opcode() == Op_AddI skips that call if it's
> obvious it's not needed.
Got it. I thought Opcode() will be more expensive since it is virtual but looking on other - it has a lot of checks.
Thanks,
Vladimir
>
> Roland.
>
More information about the hotspot-compiler-dev
mailing list