This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Always pass `-fconvergent-functions` for GPU targets
Needs ReviewPublic

Authored by jhuber6 on Apr 23 2023, 12:37 PM.

Details

Summary

GPU targets like nvptx64-nvidia-cuda and amdgcn-amd-amdhsa require
that we have convergent functions on. Currently we apply this to all the
offloading languages, but this patch applies it based on the triple
directly. This is so users can specify --target=nvptx64-nvidia-cuda
and get this behaviour as an implementation detail of the architecture.

Diff Detail

Event Timeline

jhuber6 created this revision.Apr 23 2023, 12:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2023, 12:37 PM
Herald added a subscriber: kosarev. · View Herald Transcript
jhuber6 requested review of this revision.Apr 23 2023, 12:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2023, 12:37 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I think this is sensible. Passing fno-convergent-functions presumably changes the default?

I wonder if we should adopt this and then remove the checks for each of the GPU programming models

I think this is sensible. Passing fno-convergent-functions presumably changes the default?

I wonder if we should adopt this and then remove the checks for each of the GPU programming models

That would probably make sense, actually that's a good point. MaskRay wanted me to remove -fno-convergent-functions in the previous patch which prevents us from doing that. I think I'll add it back in because I like the idea of being able to override defaults.