Restore LLVM backend: fix bitrot, add tests#9292
Draft
lukewilliamboswell wants to merge 43 commits intolir-interpreterfrom
Draft
Restore LLVM backend: fix bitrot, add tests#9292lukewilliamboswell wants to merge 43 commits intolir-interpreterfrom
lukewilliamboswell wants to merge 43 commits intolir-interpreterfrom
Conversation
… up real backend The LLVM backend fell out of sync when .call was renamed to .proc_call and .lambda was removed in favor of LirProcSpec entries. Since llvmEvaluatorStr aliased devEvaluatorStr, the breakage went undetected. - Rename LirProc→LirProcSpec, getProcs→getProcSpecs throughout MonoLlvmCodeGen - Replace .call/.lambda dispatch with .proc_call via proc_registry lookup - Remove all lambda infrastructure (compileLambdaAsFunc, ClosureMeta, closure_bindings, callChainedExpr, resolveToClosureMeta, etc.) - Rewrite list_sort_with to use ll.callable_proc instead of lambda tracing - Add str_concat expression handler and generateEmptyString - Add monomorphization step to llvm_evaluator (was missing after API change) - Wire llvmEvaluatorStr to real LlvmEvaluator with fork-isolated pipeline - Harden error handling: convert orelse unreachable to error returns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The generateStrConcatExpr fold loop was passing (next_id, next_id) to callStrStr2Str, concatenating each element with itself instead of with the accumulator. Fix by loading the accumulated RocStr fields directly from dest_ptr for arg_a and only materializing the next element for arg_b. Also remove unused SortComparatorThunk struct. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
RocEnv callbacks (rocDbgFn, rocExpectFailedFn, rocCrashedFn) now use an optional Io for stderr output. When Io is null, callbacks are silent. This makes the LLVM evaluator pipeline WASM freestanding compatible. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add llvm_backend_test.zig with dev-vs-LLVM comparison tests and a runDevAndLlvmExpectStr helper. Remove dead `builtin` import from roc_env.zig. Document the steps needed to wire the LLVM backend into the CLI build pipeline (--opt=size/speed). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
MonoLlvmCodeGenwith current LIR proc_call architecture (LirProcSpecinstead ofLirProc), remove staleClosureRepresentation, and wire up the real backend inLlvmEvaluatorstr_concatfold bug: Correct constant-folding for string concatenation and remove deadSortComparatorThunkcodeRocEnvdiagnostics throughIo: Replacestd.debug.printwith properIo-based output for diagnostic messagesllvm_backend_test.zigwith test helpers exercising the LLVM codegen path end-to-end, plus documented TODO for CLI integration (--opt=size/--opt=speed)🤖 Generated with Claude Code