Repository navigation
feat(warpforthc): add --emit to stop after mlir, llvm, or ptx - #139
Merged
Merged
Conversation
tetsuo-cpp
force-pushed
the
feat/warpforthc-emit
branch
from
November 2, 2026 03:26
41d16d3 to
bd1375f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
warpforthc always compiled a Forth kernel through to PTX. Inspecting an earlier stage meant splitting the compile across warpforth-translate and warpforth-opt. This adds one flag so the same driver can stop after parsing, after lowering, or at PTX.
What changed
warpforthc --emit=mlir|llvm|ptxwrites the parsed Forth module, the lowered module as MLIR, or PTX. The default isptx.buildWarpForthLoweringPipelineholds the stages before PTX emission. The full pipeline calls it, then emits PTX as before.Scope
Tradeoffs
--emit=llvmwrites the lowered module as MLIR text. A.llexport would add a second translator and a new link dependency for a debug stop.Blast Radius
--emitstill writes PTX. That output matched the canon binary on the new test kernel.warpforth-optis unchanged.Verification
warpforthc --emit=mlir,--emit=llvm,--emit=ptx, and a default run ontest/Pipeline/warpforthc-emit.forth. The default run and--emit=ptxmatched each other and the canon binary.--emit=cubinexited 1 withCannot find option named 'cubin'!.Closes #120