(WIP) Push down constants in AddNode

Gilles Duboscq gilles.m.duboscq at oracle.com
Fri Jan 5 10:19:45 UTC 2018


Hi Jackson,

What about not doing it during canonicalization?
Maybe a dedicated phase to to optimize expressions more globally makes more sense?
Such a phase should be careful about other usages of sub-parts of the expression and avoid including more work into loops.

 Gilles

On 05/01/18 09:20, Jackson Davis wrote:
> I've had this change around for a while now, finally got around to creating
> a PR.
> 
> https://github.com/graalvm/graal/pull/274
> 
> This seems like a important thing to be doing, but is pretty brittle as-is:
> if done aggressively, it can undo other calls to
> BinaryArithmeticNode.reassociate() (eg from LoopEx.reassociateInvariants),
> which means that the result of that reassociation is only valid up until
> another canonicalization of the resulting AddNode occurs, hence the need
> for the self != null checks.
> 
> Is there a cleaner/smarter way of avoiding this race?
> 
> -Jackson
> 


More information about the graal-dev mailing list