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

Fix issues with loop variable of io implied do loop #1592

Merged
merged 1 commit into from
Apr 19, 2022
Merged

Fix issues with loop variable of io implied do loop #1592

merged 1 commit into from
Apr 19, 2022

Conversation

kiranchandramohan
Copy link
Collaborator

The existing codegen was for loop variables in io implied do loop
was not working correctly for pointer, allocatable variables. Rather
than finding the symbol address directly, use Evaluate Expression to
find the correct symbol and find the expression address from it. This
is similar to the handling for loop variables in fir.do_loop.

The existing codegen was for loop variables in io implied do loop
was not working correctly for pointer, allocatable variables. Rather
than finding the symbol address directly, use Evaluate Expression to
find the correct symbol and find the expression address from it. This
is similar to the handling for loop variables in fir.do_loop.
@kiranchandramohan
Copy link
Collaborator Author

Reference: chiyoda_c4a

Copy link

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -672,7 +672,8 @@ static void genIoLoop(Fortran::lower::AbstractConverter &converter,
const auto &itemList = std::get<0>(ioImpliedDo.t);
const auto &control = std::get<1>(ioImpliedDo.t);
const auto &loopSym = *control.name.thing.thing.symbol;
mlir::Value loopVar = converter.getSymbolAddress(loopSym);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSymbolAddress() doesn't appear to be used all that often, but seems like it will not work in any situation where the symbol is a boxed variable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used in OpenMP/OpenACC lowering in a few other places. Filed an issue #1595 to capture this.

Copy link
Collaborator

@jeanPerier jeanPerier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants