Request for reviews (M): 6957939: Reduce registers usage by DecodeN/EncodeP
vladimir.kozlov at oracle.com
Thu Jun 3 18:56:43 PDT 2010
What about adding _conv_bias LRG field? I can record it in build_ifg_physical() and process after _copy_bias in PhaseChaitin::bias_color() so it will give high priority to _copy_bias.
Tom Rodriguez wrote:
> On Jun 3, 2010, at 6:13 PM, Vladimir Kozlov wrote:
>> Tom Rodriguez wrote:
>>> It might be nice to use this with Conv's as well. Maybe we should have a new Node flag to tag nodes that have this copy like behaviour.
>> Yes, it is good idea and I tried CastX2P/CastP2X but I am concern about next comment in PhaseCoalesce::combine_these_two():
> That stuff only matters when a node is a true copy node since in that case we can merge the LRG and completely eliminate the node, thus losing type information. The bias stuff just hints for better register selection so it can't cause any of those problems.
>>> Can we avoid doing a whole second pass over the instruction to record the bias, maybe by tagging LRGs as copy LRGs and overwriting non-copy LRGs in record_bias?
>> record_bias() is called only for SpillCopy nodes.
> That can be changed.
>> I tried to do it in Conservative coalesce() but it is not called before Select() if there are no spills.
> So it might need refactoring.
>> And I am concern about putting the code into build_ifg_physical() since it removes nodes.
> Why does that matter? Bias is related to LRGs.
>> Also I am not sure who should have priority in copy bias: SpillCopy nodes or DecodeN/EncodeP.
> I would assume SpillCopy. Maybe we should looking into keeping an accurate list of possible biases or at least more than 1.
>>> On Jun 3, 2010, at 2:33 PM, Vladimir Kozlov wrote:
>>>> Fixed 6957939: Reduce registers usage by DecodeN/EncodeP
>>>> DecodeN/EncodeP usually produce result in the different
>>>> from input register because types difference (32bit narrow
>>>> oop vs 64bit oop).
>>>> Try to reuse input regiser for result if DecodeN/EncodeP is
>>>> the only user by recording bias for input and ouput lrgs.
>>>> It is done after copy bias for spill copies was recorded
>>>> so they will get priority since only one copy bias could
>>>> be recorded.
>>>> Tested with CTW, GCBasher with +VerifyOops.
More information about the hotspot-compiler-dev