-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix problems in handling of summation reduction and invariant expressions in Expressions Simplification #6747
Fix problems in handling of summation reduction and invariant expressions in Expressions Simplification #6747
Conversation
In considering whether to pull an invariant expression out of a loop, removeUncertainBlocks needs to verify that blocks that are being considered will be executed exactly once within the region that contains them. If a block is nested within another loop in the region, it might be executed more or less than one time, and so should be removed from consideration. Also removed some stray tab characters.
Devin @jdmpapin and Vijay @vijaysun-omr, may I ask you to review this change? |
Jenkins build all |
I will wait for @jdmpapin review before considering this for merging. |
Expressions Simplification looks for summation reductions and invariant expressions that can be pulled out of loops. Each instance is tracked by placing the TR::TreeTop of the candidate in a TR::List. However, in the process of actually performing the transformation, <some method> doesn't perform the same checking of a summation reduction as it does during the initial analysis. In particular, an invariant expression that happens to involve an ineg, ixor, isub or iadd might end up being transformed as if it was a summation reduction. Fixed this by using a list of candidates that carries a flag indicating the kind of transformation that can be performed along with the TR::TreeTop.
7f4dd02
to
5975854
Compare
Squashed trace message change in commit 5975854. No other changes. |
All checks passed for the revision that Vijay approved. The only difference between that revision and the current one is from 7f4dd02 (now squashed), which only affects tracing, so I think that once the current builds pass, this is fine to merge without another "build all." |
Thanks, as mentioned the only change is in the area of tracing and since basic/build checks have now passed, I am merging. |
This pull request fixes two problem in Expressions Simplification.
TR_ExpressionsSimplification::removeUncertainBlocks
checks whether blocks will be executed exactly once within each iteration of the loop, and if not, it removes them from consideration. It does this by checking whether the block post-dominates the entry block for the loop. However, if a block is in another loop nested within the loop, it might post-dominate the entry but still be executed more than once in each iteration of the outer loop. Such blocks must also be removed from consideration.TR::TreeTop
pointers. It later iterates over the candidates, and in checking whether it's working with a summation reduction candidate, it simply checks whether the first child operation of the store is one ofiadd
,isub
,ixor
orineg
. However, a candidate for an invariant expression transformation might also have one of those operations as the first child of its store operation. This can result in an invariant expression candidate being transformed as if it had been summation reduction candidate.Fixed this by changing the list of candidate
TR::TreeTop
pointers into a list ofSimplificationCandidateTuple
objects that contain the candidateTR::TreeTop
along with flags indicating the kind of candidate it is.Fixes eclipse-openj9/openj9#15306