This is an archive of the discontinued LLVM Phabricator instance.

[flang][OpenMP] Fix parallel do with integer*1 var
ClosedPublic

Authored by luporl on Aug 1 2023, 8:01 AM.

Details

Summary

Temporaries created to store worksharing loop index values were
using different types than that of the original index variables.
This caused invalid IR to be produced when an index variable was
used in binary operations which expected its original type.

Fix this by creating temporaries with the types of their original
variables and converting the loop values, that continue to use
the types that OpenMP runtime expects, to them.

Fixes https://github.com/llvm/llvm-project/issues/60870

Diff Detail

Event Timeline

luporl created this revision.Aug 1 2023, 8:01 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
luporl published this revision for review.Aug 1 2023, 8:05 AM

Thanks @luporl for this change. Did this work successfully end to end (execution)?

I just submitted a patch that modified the code here a bit. Could you rebase?
https://github.com/llvm/llvm-project/commit/980808dc5b598dd6d2f85746bd1fdeb36d4c6a1c

luporl added a comment.Aug 1 2023, 8:27 AM

Thanks for the review @kiranchandramohan.
This patch worked successfully with the test program from #60870, execution included.
It also didn't cause any regression with check-flang and llvm-test-suite.

I'll rebase it on top of your change.

kiranchandramohan accepted this revision.Aug 1 2023, 2:36 PM

LG. Thanks.

This revision is now accepted and ready to land.Aug 1 2023, 2:36 PM
This revision was automatically updated to reflect the committed changes.