Classify numeric conversions by source, destination, and mode - #10736
Draft
ESRogs wants to merge 1 commit into
Draft
Classify numeric conversions by source, destination, and mode#10736ESRogs wants to merge 1 commit into
ESRogs wants to merge 1 commit into
Conversation
ESRogs
force-pushed
the
llvm-conversion-explicit-dispatch
branch
2 times, most recently
from
August 11, 2026 23:47
bd7b858 to
07a898f
Compare
Implements projects/small/llvm-conversion-op-explicit-dispatch.md. The op names encode a source scalar, a destination scalar, and a mode. Parsing them once into that triple, at comptime, lets the LLVM backend dispatch on the sixteen families the ops form instead of re-reading the name at each use site. Two comptime rules run over the whole enum: the triple identifies the op, and every conversion belongs to a family, so an op whose shape no family covers fails the build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ESRogs
force-pushed
the
llvm-conversion-explicit-dispatch
branch
from
August 12, 2026 15:55
07a898f to
3edc20f
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.
Draft status: stacked on #10734. Still in-progress. Claude wrote all this code and I haven't finished reviewing it yet.
This PR implements
projects/small/llvm-conversion-op-explicit-dispatch.md: the conversion op names are parsed once, at comptime, into a source scalar, a destination scalar, and a mode, and the LLVM backend dispatches on the sixteen families they form instead of re-reading each op's name where it is used.Two comptime rules run over the whole enum: the triple identifies the op, and every conversion belongs to a family.
Two of the doc's criteria are not met here.
@tagName(op)still has four semantic uses in this file, in the hasher, crypto, and SIMD dispatches, which this PR does not touch. And the cross-backend totality test it asks for is not implemented; the dev and wasm backends still enumerate the ops by hand, which the doc lists as optional convergence.