[code-reflection] RFR: Experiment: Alternative SSA construction algorithm
Hannes Greule
hgreule at openjdk.org
Fri Aug 16 07:28:03 UTC 2024
On Thu, 15 Aug 2024 22:47:08 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
> I am curious as to how easily you found the adaption from phi nodes to block parameters. Generally i have found it easy to adapt and it can often simplify things.
Conceptually, I think block parameters are easy to understand. One hurdle I could imagine when doing global transformation is the "when do I need them", or rather the "why do I *sometimes* need them". I'm not sure how I would explain that without explaining phis first. But for local transformations, that doesn't really matter at all, reducing the complexity in that aspect.
It also fits in well with the design of the API (I think it wouldn't fit into a sea-of-nodes style API), and transformations between the representations seem pretty simple too.
> I don't currently see a way to retain immutability and post-adapt what is currently built before building completes. Maybe as I look more deeply a few ideas will emerge. One approach i have used when transforming is instead of building up data structures I build up (capturing) functions on the first pass to apply when transforming on the second pass. I don't yet know if this would make your implementation simpler.
I'm not sure how useful that is in general, but I think terminating ops could always only be added to the block after everything else was done. Combined with the ability to remove block parameters again, it would potentially made some things a little easier. However, that also feels like an odd special casing that might be more confusing than helpful.
-------------
PR Comment: https://git.openjdk.org/babylon/pull/214#issuecomment-2292975517
More information about the babylon-dev
mailing list