RFR: 8351016: RA support for EVEX to REX/REX2 demotion to optimize NDD instructions [v15]
Jatin Bhateja
jbhateja at openjdk.org
Sat Nov 22 18:35:19 UTC 2025
On Sat, 22 Nov 2025 04:51:47 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>> Jatin Bhateja has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>>
>> Generic operand traversal and sharpening candidate selection based on RegisterMask and non-interference. Review feedback incorporated
>
> src/hotspot/share/opto/chaitin.cpp line 1522:
>
>> 1520: uint copy_lrg = _lrg_map.find(lrg._copy_bias);
>> 1521: OptoReg::Name reg = select_bias_lrg_color(lrg, copy_lrg);
>> 1522: if (reg != OptoReg::Bad) {
>
> Please, use `OptoReg::is_valid(reg)` here. I find it more readable.
>
> Also, there's repetitive pattern for `lrg._copy_bias` and `lrg._copy_bias2`. Would be nice to hide it behind a single `select_bias_lrg_color(_lrg_map, lrg)` call.
Done.
> src/hotspot/share/opto/chaitin.cpp line 1661:
>
>> 1659: }
>> 1660:
>> 1661: Node* def = lrg->_def;
>
> I'm concerned about the approach chosen here. It iterates over all operands trying to find a candidate for biasing irrespective of the shape of Mach node.
>
> Instead, I'd be much more comfortable with 2 operand probes at fixed positions (ideally, at indices 1 and 2). Any mismatches in Mach node shape should be reported. In other words, any failed operand probe on a mach node marked with `Flag_ndd_demotable` or `Flag_ndd_demotable_commutative` should trigger an assert. (Corresponding AD instructions can be adjusted to fit the desired pattern.)
Thanks @iwanowww, My intent with current version was to get your feedback on generic implementation :-) , entire processing is triggered only for MachNodes marked with Flag_ndd_demotable and Flag_ndd_demotable_commutative, my previous versions were only probing specific operands but expected regimented operand ordering. Current scheme is generic in nature, but I agree that regimented scheme with asserts is more appealing.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26283#discussion_r2553292523
PR Review Comment: https://git.openjdk.org/jdk/pull/26283#discussion_r2553292229
More information about the hotspot-compiler-dev
mailing list