RFR(L): 8186027: C2: loop strip mining
Roland Westrelin
rwestrel at redhat.com
Tue Nov 7 16:49:38 UTC 2017
>>> 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.
Roland.
More information about the hotspot-compiler-dev
mailing list