RFR: 8342662: C2: Add new phase for backend-specific lowering [v6]
Quan Anh Mai
qamai at openjdk.org
Wed Jan 15 06:49:49 UTC 2025
On Wed, 15 Jan 2025 05:55:08 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
>> I would advise against using the term macro to avoid confusion with PhaseMacroExpansion.
>>
>> Regarding the separation, your point about the architecture dependency is the reason why we need a separate lower_node_transform. Suppose you want to lower a machine-independent node on x86. With lower_node_transform we would only need to add a case to the function, while with LoweredIdeal we would need to implement it for all architectures. Note that we can lower a machine-independent node to a machine-dependent node, for example let's imagine a node X86VectorRearrangeConst. So we can write machine-dependent transformation without using machine-dependent code.
>
> OK. I guess I got it more clear. Thanks for the clarifying!
>
> As a summary, this phase may do following transformations:
> 1. IR Identity -> backend in-dependent (different with GVN Identity)
> 2. lowering -> backend in-dependent
> 3. lower_node_platform ->backend dependent
> 4. IR Ideal -> backend in-dependent (different with GVN Ideal)
>
> If we want to add backend specific lowering, the only function is `lower_node_platform` in backend file, right?
Correction, we want to do normal Identity with the nodes, but we are having troubles due to some nodes missing their optimization, so we are disabling it for now.
IR Ideal can be platform-dependent if the node is platform dependent, which can be created from the platform-dependent lower_node_platform.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21599#discussion_r1916020386
More information about the hotspot-compiler-dev
mailing list