Skip to content

Allow early returns#92

Open
AntonOresten wants to merge 2 commits intoJuliaGPU:mainfrom
AntonOresten:early-returns
Open

Allow early returns#92
AntonOresten wants to merge 2 commits intoJuliaGPU:mainfrom
AntonOresten:early-returns

Conversation

@AntonOresten
Copy link
Contributor

tileiras currently rejects cuda_tile.return inside cuda_tile.if regions. This PR adds a codegen pre-pass (hoist_returns!) that rewrites ReturnNode terminators inside IfOp regions into YieldOp, hoisting the return to the parent block. This keeps IRStructurizer's output unchanged and handles the constraint at the codegen layer.

Haven't tested returns inside loops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant