llvm-project
62c7cc9d - [clang][OpenMP] Add no-loop SPMD kernel promotion

Commit
10 days ago
[clang][OpenMP] Add no-loop SPMD kernel promotion A target teams distribute parallel for that is guaranteed a thread for every iteration does not need the loop around its body. Flang already drops it and runs the region as a no-loop kernel. Enable the same optimization for Clang through mirroring Flang's MLIR promotion using OpenMPIRBuilder. The kernel is tagged SPMD_NO_LOOP, so the runtime sizes the grid to the iteration space, and the body is emitted without a loop around it. The canonical loop it consumes is reconstructed in the no-loop branch rather than taken from an OMPCanonicalLoop node, so the promotion does not require -fopenmp-enable-irbuilder. Restrict offload entry creation to module level finalize, preventing asserts on missing offload entries from nested CodeGenFunction finalizing before module completion.
Author
Committer
Parents
Loading