[AMDGPU] Add __builtin_amdgcn_grid_size
Similar to D76772, loads the data from the dispatch pointer. Marked invariant.
Patch also updates the openmp devicertl to use this builtin.
Paths
| Differential D90251
[AMDGPU] Add __builtin_amdgcn_grid_size ClosedPublic Authored by JonChesterfield on Oct 27 2020, 10:25 AM.
Details Summary [AMDGPU] Add __builtin_amdgcn_grid_size Similar to D76772, loads the data from the dispatch pointer. Marked invariant. Patch also updates the openmp devicertl to use this builtin.
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 27 2020, 10:25 AM Herald added subscribers: openmp-commits, cfe-commits, dexonsmith and 7 others. · View Herald Transcript Comment Actions What's the point of this? The reason for the other case was because there was no other way to attach the range metadata. The invariant load here is redundant since with AMDGPU AA the load from constant will be treated as invariant anyway Comment Actions Consistency really. It seemed strange to have a builtin for reading the workgroup size and not one for the grid size. There's probably a range limit that can be set on this one too, I'm just not sure what it is. Happy to leave the invariant annotation for a pass to insert if preferred. Comment Actions I think there is value in this change. It may help simplify device library and hide some compiler details. This revision is now accepted and ready to land.Oct 28 2020, 6:52 PM This revision was landed with ongoing or failed builds.Oct 29 2020, 9:25 AM Closed by commit rGdee7704829bd: [AMDGPU] Add __builtin_amdgcn_grid_size (authored by JonChesterfield). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 301653 clang/include/clang/Basic/BuiltinsAMDGPU.def
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGenOpenCL/builtins-amdgcn.cl
openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip
|