Open fjeremic opened 8 years ago
Are constants always expected on the right-hand side? If not, this optimization could equally apply if the child nodes are reversed ('and' is symmetric).
One of the "tree canonicalizations" done by simplifier is to reorder expressions such that the constant is the second child (i.e. the right hand side) where possible to allow other opts to assume that and make their implementation simpler.
That makes sense. Thanks for the education and tolerating a query from a newb. ;-)
@keithc-ca Just in case you're curious the said ordering can be seen a few lines before the call to my new helper function here:
https://github.com/eclipse/omr/blob/master/compiler/optimizer/OMRSimplifierHandlers.cpp#L11114
Just thought I would also mention that there is some documentation on our IL at
https://github.com/eclipse/omr/tree/master/doc/compiler/il
in case you are interested to learn more about it in general.
Referencing the comment by @vijaysun-omr in https://github.com/eclipse/omr/pull/381#issuecomment-256696340 this issue is to track the work to implement the widened and simplification using value constraints determined during the value propagation optimization pass.