Fix crash in ConvertParallelToGPU1 pass on grid×block loops with multiple inner parallels#2564
Fix crash in ConvertParallelToGPU1 pass on grid×block loops with multiple inner parallels#2564xys-syx wants to merge 1 commit into
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b62ef6353f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (enclosingGpuDims < 6) | ||
| return failure(); |
There was a problem hiding this comment.
Preserve serialization for lower-dimensional launches
This guard only serializes inner sibling scf.parallel loops when the enclosing loops have six IVs total, so a valid lower-dimensional grid/block nest such as a 1D grid loop containing a 1D block loop is no longer handled. ParallelToGPULaunch pads missing dimensions to 1, and the previous depth-based check serialized these cases; with this change, multiple sibling inner parallels remain in the block body and ParallelizeBlockOps can still hit its llvm_unreachable("Unhandled case") on the second sibling.
Useful? React with 👍 / 👎.
The input IRs:
ConvertParallelToGPU1pass crashed withllvm_unreachable("Unhandled case")(inParallelizeBlockOps)Fix with if the GPUDIMs equals 6 (grid -> [0, 3), block -> [3,6)),
InnerParallelSerializationwill serialize a parallel loop into scf.for.