RFR: 8351016: RA support for EVEX to REX/REX2 demotion to optimize NDD instructions [v18]

Jatin Bhateja jbhateja at openjdk.org
Tue Nov 25 13:04:26 UTC 2025


On Tue, 25 Nov 2025 07:06:51 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>>>  if (mdef->operand_num_edges(oper_index) != 1) {
>>>    assert(!is_ndd_demotable(mdef), "%s", mdef->Name());
>>>    return false;
>>>  }
>> 
>> We don't need this assertion, NDD commutative operation MachNode may have its first input as memory, but we may pick second input for biasing.
>
> Do you have `addI_rReg_rReg_mem_ndd` case in mind here? (It matches `Set dst (AddI src1 (LoadI src2))` and is marked as `Flag_ndd_demotable_commutative`).

Yes, memory operand capture more than one edge, effective address computation is done using BASE + INDEX x SCALE + DISP, there are multiple address computation schemeds using different components but x86 mandates INDEX and BASE must be held in valid registers, we cannot share either of these registers with destination operand and demote.
New assertion check should catch violations.

>> Bias live ranges are indipendent while marking and during enforcement.
>
> Do I get it right that memory operands in the first position for commutative operations are the reason why `copy_bias` is invalid while `copy_bias2` is not?

Yes, thats correct. I have fined tuned the assertion checks.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26283#discussion_r2559911309
PR Review Comment: https://git.openjdk.org/jdk/pull/26283#discussion_r2559909395


More information about the hotspot-compiler-dev mailing list