Skip to content

[flang][OpenMP] Set OpenMP attributes in MLIR module in bbc before lo… #82774

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

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

kparzysz
Copy link
Contributor

…wering

Right now attributes like OpenMP version or target attributes for offload are set after lowering in bbc. The flang frontend sets them before lowering, making them available in the lowering process.

This change sets them before lowering in bbc as well.

…wering

Right now attributes like OpenMP version or target attributes for offload
are set after lowering in bbc. The flang frontend sets them before lowering,
making them available in the lowering process.

This change sets them before lowering in bbc as well.
@llvmbot llvmbot added the flang Flang issues not falling into any other category label Feb 23, 2024
Copy link
Contributor

@agozillon agozillon left a comment

Choose a reason for hiding this comment

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

LGTM, nice catch! Seems that as the attribute set expanded we forgot to move this... it's a bit of a pain to keep both bbc and flang in synch at times unfortunately

@clementval
Copy link
Contributor

It looks like this triggers some failures in the pre-commit CI.

@agozillon
Copy link
Contributor

LGTM, nice catch! Seems that as the attribute set expanded we forgot to move this... it's a bit of a pain to keep both bbc and flang in synch at times unfortunately

It does however appear to break a few dozen buildbot tests, but that may be something unrelated in the main branch you have this PR rebased on. Or perhaps the burnside.getModule() line also needs to be moved to below the lower call, at least I hope it's something as simple as that and not the tests acting a lot differently after the attribute movement.

@kparzysz
Copy link
Contributor Author

It worked with my version of main, I guess it wasn't recent enough. Looking into it...

@kparzysz
Copy link
Contributor Author

This still worked for me with the current main. Interestingly enough, it did pass on Windows in CI. Merging main into this PR to see if that fixes the issue.

@agozillon
Copy link
Contributor

This still worked for me with the current main. Interestingly enough, it did pass on Windows in CI. Merging main into this PR to see if that fixes the issue.

Lovely, the inverse of what normally happens (the windows buildbot falling over)! Perhaps the merge and a second run will fix the issue. If it doesn't I can perhaps do a rebase/rerun on one of my open PRs and see if it triggers the same problem, to see if it's just something a little strange going on with the buildbot environment if that's any help.

@kparzysz
Copy link
Contributor Author

It's a dangling reference problem: #82800.

@kparzysz
Copy link
Contributor Author

kparzysz commented Feb 23, 2024

I normally use gcc and it worked. I rebuilt everything with clang and it started failing.

Edit: I use gcc when building flang at work, not "normally", heh.

@agozillon
Copy link
Contributor

That's a weird and I imagine painful one to find and fix.

@agozillon
Copy link
Contributor

agozillon commented Feb 23, 2024

Thank you for finding the insidious little error! I've accepted the other PR as it seems reasonable to me (and passes all tests cleanly on linux), I am not code owner of the tool though, so if you feel a little unsure about the change then feel free to wait on someone else to chime in (although, from what I can see it's a fix that won't affect anything functionally other than making the code correct). Afterwards if this set of buildbot tests passes on rebase my acceptance still stands, so I think it should be safe to land it.

Copy link
Contributor

@clementval clementval left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe just rerun the precommit CI once your other change has landed to be sure but it should be fine.

@kparzysz
Copy link
Contributor Author

Windows CI failed for an unrelated reason.

@kparzysz kparzysz merged commit 47aee8b into llvm:main Feb 23, 2024
@kparzysz kparzysz deleted the set-attributes branch February 23, 2024 21:27
@agozillon
Copy link
Contributor

Windows CI failed for an unrelated reason.

Definitely an annoying and very frequent issue at this point.

Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants