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

Jatin Bhateja jbhateja at openjdk.org
Fri Nov 21 10:53:54 UTC 2025


On Fri, 21 Nov 2025 08:33:36 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:

>> Speaking of implicit invariants, `Node::PD::Flag_ndd_commutative` implies `Node::PD::Flag_ndd_demotable` is also set. Please, add an assert to catch missing `Node::PD::Flag_ndd_demotable` flag.
>> 
>> Another constraint to assert: `mdef->operand_num_edges(oper_index) == 1` should be true for 1st operand when `Node::PD::Flag_ndd_demotable` is set and, also, for 2nd operand when `Node::PD::Flag_ndd_commutative` is set.
>> 
>> Also, any operand ordering constraints in AD instruction declaration? Is it possible to mess the order of declarations, so register biasing candidate operands don't occur as 1st and 2nd operands?
>
> Two nits:
> - Comma splice: "overlap, in such a scenario" -> "overlap. In such a scenario"
> - "For commutative operation allocation of definition operand can also be biased towards second operand" reads a bit strange to me. Perhaps "Commutative operation allocations of definition operands can also be biased towards the second operand"?

> Speaking of implicit invariants, `Node::PD::Flag_ndd_commutative` implies `Node::PD::Flag_ndd_demotable` is also set. Please, add an assert to catch missing `Node::PD::Flag_ndd_demotable` flag.
> 
> Another constraint to assert: `mdef->operand_num_edges(oper_index) == 1` should be true for 1st operand when `Node::PD::Flag_ndd_demotable` is set and, also, for 2nd operand when `Node::PD::Flag_ndd_commutative` is set.

Extended Flag_ndd_commutative semantics to imply demotion: Flag_ndd_demotable_commutative  
> 
> Also, any operand ordering constraints in AD instruction declaration? Is it possible to mess the order of declarations, so register biasing candidate operands don't occur as 1st and 2nd operands?

Extended this to make the candidate selection operand order agnostic.

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

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


More information about the hotspot-compiler-dev mailing list