Draft
Conversation
When both `solc` and `mlir` features are active, solc's internal MLIR pipeline produces final EVM bytecode. solx becomes a thin wrapper that calls solc via FFI and extracts the result directly, bypassing the normal LLVM codegen path. Key changes: - Decouple `mlir` feature into a marker (`mlir = []`) to avoid inkwell feature poisoning; actual MLIR codegen gated behind `solx-mlir` - Add `Build::from_solc_output()` to extract bytecode/abi/metadata from solc standard JSON output - Split `standard_output_evm()` and `standard_json_evm()` with cfg guards for passthrough vs normal compilation paths - Guard CLI flags that would panic in passthrough mode (--asm, --debug-info, --emit-llvm-ir, --evmla, --ethir) - Wire CLI -O flag to solc's optimizer.mode in passthrough CLI mode - Strip optimizer.size_fallback before passing to solc (unrecognized); keep optimizer.mode (solc-mlir uses it for opt level) - Skip retain_solc() and set_selector(via_ir) in passthrough so user output selection passes through to solc unchanged - Add missing MLIR link libraries to build.rs - Fix relative path resolution for MLIR cmake args in solx-dev - Add cargo aliases: build-mlir, test-mlir - Update solx-solidity and solx-llvm submodules for MLIR support
342f06a to
bc609f3
Compare
Wire `mlir` feature to enable `dep:solx-mlir` directly, replacing the separate `solx-mlir` implicit feature. Simplify redundant `cfg(all(solc, mlir))` to `cfg(mlir)` in solc-only modules. Replace `Object::new` with purpose-built `new_passthrough` and `from_build` constructors. Fix optimizer settings mutation leak in solc frontend. Scope `build-mlir` alias to `-p solx` to prevent inkwell feature poisoning.
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
solcandmlirfeatures are active, solc's internal MLIR pipeline produces final EVM bytecode — solx becomes a thin wrappermlirfeature into a marker (mlir = []) to avoid inkwell feature poisoning; actual MLIR codegen gated behindsolx-mlirBuild::from_solc_output()to extract bytecode/abi/metadata from solc standard JSON outputstandard_output_evm()andstandard_json_evm()with cfg guards for passthrough vs normal paths-Oflag to solc'soptimizer.modeviamiddle_end_as_char()optimizer.size_fallback(solc doesn't recognize it); keepsoptimizer.mode(solc-mlir uses it)build-mlir/test-mlircargo aliasessolx-solidityandsolx-llvmsubmodules for MLIR supportTest plan
cargo build-mlircompilescargo clippy --no-default-features --features solc,mlircleancargo fmtclean--binproduces bytecode (tests/solidity/simple/default.sol)--versionshows "Backend: MLIR (passthrough)"-O1/-O2/-O3/-Os/-Ozall produce bytecode;-O1produces different (larger) output confirming mode reaches solc-mlir--asm,--debug-info,--emit-llvm-ir,--evmla,--ethir) bail with clear error messagescargo build/cargo testrequires non-MLIR solc)