Skip to content
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

(0.35) Check whether array index variable is an induction variable #15904

Conversation

hzongaro
Copy link
Member

In examining an array index for Idiom Recognition, analyzeOneArrayIndex checks whether the variable operand in a 'var + const' or 'const + var' expression is an induction variable. On the other hand, if the expression is a simple variable, the analysis assumes the variable reference is acceptable. However, it can happen that the variable used as the array index is not an induction variable which can result in an incorrect transformation.

Fixed this by adding a check that an arrayindex that is a variable is also an induction variable.

Merges pull request #15870 to v0.35.0-release
Fixes #15474

FYI @pshipton

In examining an array index for Idiom Recognition, analyzeOneArrayIndex
checks whether the variable operand in a 'var + const' or 'const + var'
expression is an induction variable.  On the other hand, if the
expression is a simple variable, the analysis assumes the variable
reference is acceptable.  However, it can happen that the variable used
as the array index is not an induction variable which can result in an
incorrect transformation.

Fixed this by adding a check that an arrayindex that is a variable is
also an induction variable.

Fixes eclipse-openj9#15474

Signed-off-by:  Henry Zongaro <zongaro@ca.ibm.com>
@pshipton pshipton merged commit 6d7886c into eclipse-openj9:v0.35.0-release Sep 15, 2022
@hzongaro hzongaro deleted the idiom-rec-check-arr-index-is-induction-var-v0.35 branch September 16, 2022 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants