-
Notifications
You must be signed in to change notification settings - Fork 396
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
Max and Min IL opcodes should have two children #4176
Comments
Limiting to the binary case makes sense to me. If you want to do multiple then some kind of vector max/min would seem to be the right representation rather than a variable number of children. |
I agree to limiting to only the two child versions. @dchopra001 for any additional input given your expertise in the area. |
Could we find out who creates those nodes with more than two children? Sorry, I don’t have access to the source right now. |
@gita-omr, we didn't find any in OMR or OpenJ9. We only found code in the optimizer and some backends to handle more than 2 children. |
Will be tackling this issue. Should we also be changing iumax, lumax, fmax and dmax? |
Replace 'num_children' with '2' in 'imaxminSimplifier()' Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Replace 'n' with '2' in 'generateMaxMin()' Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
I will cautiously say yes. All of those opcodes are also specified as having two children in the OMR ILOpCodeProperties table. You should check through the source code (OMR and OpenJ9) to see where they are generated (i.e., either in IL generator or through an optimizer pass like simplifier) and where they are actually manipulated to see if there is any code that assumes there are more than two children expected. The reasoning for restricting those opcodes to two children is the same as the original opcodes in this issue. I'll let others chime in if they have a difference of opinion. |
I just noticed something strange on Z. We assign all the The This helper routine doesn't handle |
I don't believe any ILGen or optimization pass currently generates the |
This is the correct answer. As part of this work I'd like to see some Tril tests against these to weed out such bugs. |
To stay consistent, shouldn't we also change (For Z at least. On Power the evaluator handles floating point opcodes already) |
Replace 'n' with '2' in 'generateMaxMin()' Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Replace 'num_children' with '2' in 'lmaxminSimplifier()' Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Replace 'num_children' with '2' in 'imaxminSimplifier()' Replace 'n' with '2' in 'generateMaxMin()' Replace 'num_children' with '2' in 'lmaxminSimplifier()' Fixes eclipse-omr#4176
Replace 'num_children' with '2' in 'imaxminSimplifier()' Replace 'n' with '2' in 'generateMaxMin()' Replace 'num_children' with '2' in 'lmaxminSimplifier()' Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Replace 'n' with '2' in 'generateMaxMin()' Replace 'num_children' with '2' in 'imaxminSimplifier()' Replace 'num_children' with '2' in 'lmaxminSimplifier()' Replace 'num_children' with '2' in 'fmaxminSimplifier()' Replace 'num_children' with '2' in 'dmaxminSimplifier()' Fix comments. Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
@dchopra001 Should this be the same for |
Yes, since those are unimplemented as well. |
Change evaluator for fmax from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Change evaluator for fmin from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Change evaluator for dmax from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Change evaluator for dmin from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Add Tril tests for fmax, fmin, dmax and dmin. Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Change evaluator for fmax from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Change evaluator for fmin from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Change evaluator for dmax from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Change evaluator for dmin from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Add Tril tests for fmax, fmin, dmax and dmin. Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Change evaluator for fmax from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Change evaluator for fmin from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Change evaluator for dmax from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Change evaluator for dmin from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Add Tril tests for fmax, fmin, dmax and dmin. Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Change evaluator for fmax, fmin, dmax and dmin from 'TR::TreeEvaluator::maxEvaluator' to 'TR::TreeEvaluator::UnImpOpEvaluator'. Add Tril tests for fmax, fmin, dmax and dmin. Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca> a Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Change evaluator for fmax, fmin, dmax and dmin from 'maxEvaluator' to 'UnImpOpEvaluator' Add Tril tests for fmax, fmin, dmax and dmin. Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Re-opening as #4259 hasn't been merged yet. |
Change evaluator for fmax, fmin, dmax and dmin from 'maxEvaluator' to 'UnImpOpEvaluator' Add Tril tests for fmax, fmin, dmax and dmin. Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
Change evaluator for fmax, fmin, dmax and dmin from 'maxEvaluator' to 'UnImpOpEvaluator' Add Tril tests for fmax, fmin, dmax and dmin. Fixes eclipse-omr#4176 Signed-off-by: Aidan Ha <qbha@edu.uwaterloo.ca>
As discussed in eclipse-omr#4176 Max/Min IL should support only two operands Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
As discussed in eclipse-omr#4176 Max/Min IL should support only two operands Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
As discussed in eclipse-omr#4176 Max/Min IL should support only two operands Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
As discussed in eclipse-omr#4176 Max/Min IL should support only two operands Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment on the issue or it will be closed in 60 days. |
This is being worked on so it's not really stale. |
As discussed in eclipse-omr#4176 Max/Min IL should support only two operands Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
As discussed in eclipse-omr#4176 Max/Min IL should support only two operands Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
Ensure the IL opcodes
only support two children. Some optimizer and code generator support (see references below for a couple of examples) assume that these opcodes could have more than two children, and provides support for that case. These cases should be found and removed.
See redacted text below for background details.
The number of children of IL opcodes:is handled inconsistently. The IL opcode properties table [1] specifies the opcodesbehave like other binary operators and have only two children.
However, other code like [2][3] suggests it can have a variable number of children.
I suspect the variable nature is historical (pre-open source). Nothing in the currentcode base nor any known downstream project generates these opcodes with more than two children.
I propose to make these opcodes consistent with other operators and enforce the twochild property. Code that supports multiple children should be cleaned up.
These opcodes are somewhat unique in that they are reduction operations which mightjustify more than two children. However, they are ultimately reduced pairwise by the
backends anyway. I'm not sure the value in allowing more than two children is there.
@gita-omr @vijaysun-omr @andrewcraik @fjeremic @Leonardo2718 @knn-k : please share any opinions.[1] https://github.com/eclipse/omr/blob/b9ba1f63eafc8b7f4e80c47a0893f16dd8ffdbab/compiler/il/OMRILOpCodeProperties.hpp#L11719
[2] https://github.com/eclipse/omr/blob/b9ba1f63eafc8b7f4e80c47a0893f16dd8ffdbab/compiler/optimizer/OMRSimplifierHandlers.cpp#L16957
[3] https://github.com/eclipse/omr/blob/b9ba1f63eafc8b7f4e80c47a0893f16dd8ffdbab/compiler/p/codegen/ControlFlowEvaluator.cpp#L4171
The text was updated successfully, but these errors were encountered: