RFR: 8342662: C2: Add new phase for backend-specific lowering [v6]

Jatin Bhateja jbhateja at openjdk.org
Thu Dec 26 09:03:45 UTC 2024


On Mon, 16 Dec 2024 02:23:30 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:

>> Hi all,
>> This patch adds a new pass to consolidate lowering of complex backend-specific code patterns, such as `MacroLogicV` and the optimization proposed by #21244. Moving these optimizations to backend code can simplify shared code, while also making it easier to develop more in-depth optimizations. The linked bug has an example of a new optimization this could enable. The new phase does GVN to de-duplicate nodes and calls nodes' `Value()` method, but it does not call `Identity()` or `Ideal()` to avoid undoing any changes done during lowering. It also reuses the IGVN worklist to avoid needing to re-create the notification mechanism.
>> 
>> In this PR only the skeleton code for the pass is added, moving `MacroLogicV` to this system will be done separately in a future patch. Tier 1 tests pass on my linux x64 machine. Feedback on this patch would be greatly appreciated!
>
> Jasmine Karthikeyan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Implement apply_identity

Hi @jaskarth ,

Thanks for your analysis, skeleton code looks good to me. Lowering being a derivative of IGVN has target specific idealization, we don't intend to create target specific IR , and thus re-use existing Value and Identity transforms. For now, you have completely disabled all identity transforms citing dependency on Idealization. One additional IGVN pass on entire graph could have settled the dust, but it's expensive. 

Even without identity transform, iterative lowering benefits from sharing of lowered nodes.

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

Marked as reviewed by jbhateja (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/21599#pullrequestreview-2522976598


More information about the hotspot-compiler-dev mailing list