Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
…ation. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…kends. Co-Authored-By: Claude <noreply@anthropic.com>
m4rs-mt
force-pushed
the
new_aot
branch
2 times, most recently
from
April 19, 2026 22:59
c744b51 to
c14e465
Compare
This was referenced Apr 30, 2026
MoFtZ
approved these changes
Jul 23, 2026
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.
Delivers a complete IR rewrite and the AOT compiler pipeline that runs on top of the runtime library from PRs #1355 and #1576. This is the largest of the four PRs by content and the core of the new compilation model. All changes land under
Src/ILGPUC/.The first commit is a PR-merge placeholder representing the runtime-library PRs; once that lands on
masterthis placeholder is replaced by the real merge.A note on authorship - AI warning
Some bits of the Roslyn-frontend work in this PR was done with AI-assistant pair programming (Claude via Claude Code).
What's in this PR
The IR is rewritten from scratch
IR/Constructionbuilders (25 files),IR/Typestype system (16 files), andIR/Valuesvalue nodes (28 files) are removed. All in total 69 files dropped — these had grown organically and did not fit the new pure-value / basic-block-value / method-value layering that the rest of the pipeline needs.IR/ModuleValues/— module-level values includingModule,MethodHandle, primitive / void / pointer / structure / array / handle / kind / object / padding type values, builders, and theUndefinedsentinel.IR/MethodValues/— method-scope parameters, return values, method calls, invocations.IR/PureValues/— the new side-effect-free value layer: arithmetic, cast, convert, compare, predicate, structure, array, view, primitive, constant, bitwise, interop, IO, thread, intrinsic, language, memory-read, load, and friends.IR/BasicBlockValues/— block-local values (phi, method call, load/store, atomic, debug, language, terminators, branches).Rewriter,BlockRewriter,ValueRewriter,MethodRewriter). New transformation base classes (Transformation,ModuleTransform,MethodTransform,BasicBlockTransform,PureValueTransform) plus SSA builder / cleanup, collective-op recognition, group / warp collective lowering, custom-atomic lowering, GC-init lowering, dead-load elimination, closure elimination, debug setter, and Metal kernel / split-view lowering. Obsolete passes retired (CleanupBlocks, CodePlacement, DeadCodeElimination, LoopInvariantCodeMotion, LoopUnrolling, UnreachableCodeElimination, LowerStructures, ImplementIntrinsics, and the legacyTransformation.cs).The frontend is updated end-to-end
Frontend/CodeGenerator/subsystem is updated to emit the new IR node kinds (arithmetic, comparison, cast, memory, branches, calls, structures, arrays, phi resolution).Frontend/Intrinsic/grows a new bitwise handler and refines the registry (Intrinsics,InterinsicProvider), the thread-hierarchy intrinsics (Accelerator,Grid,Group,Warp), math / compare / convert / atomic / arrays / views / activator / interop / compiler-services / debug / utility handlers.ILGPUC/Intrinsic/retired — its handlers have moved into the frontend structure above.All backends are rebuilt on a shared framework
Backends/PTX/(backend, code generator, emitter, terminators, values, views, function generator, debug info generator, instruction data, PTX API wrappers for LibDevice / NVVM, block-schedule analyses, and the PTX intrinsic set including math sub-family) are removed.EntryPoints/PointerViews/SeparateViewsbackends retired (9 files). Top-levelInvalidCodeGenerationException,NotSupportedIntrinsicException,PhiBindings,RegisterAllocator,VariableAllocatoralso retired (5 files).CodeGenerator,GenerationContext,MethodEmitter,ExpressionEmitter,TypeEmitter,LauncherEmitter,FlatStructLauncherEmitter,PerArgumentLauncherEmitter,CompiledKernelEmitter,CompiledKernelGenerator,CompiledKernelSourceGenerator,ControlFlowReconstructor,SSAVariableAllocator,IntrinsicEmitter,LanguageConfiguration, andRemoteCompilerManager.Backend.csrefined to use them.CodeGenerator,EntryPoint,CompiledKernel,IntrinsicEmitter, and per-backend specialisations.Roslyn source generator introduced
Roslyn/Analysis/, 6 files) — scans user code for kernel entry points, collects methods and attributes, resolves invocations.Roslyn/Generation/, 7 files) — rewrites kernel launch sites and emits strongly-typed wrappers so user code invokes the compiler-generated launcher rather than a reflection-based path.Command-line compiler and MSBuild wiring
ProgramOptions/) —ProgramOptionsbase,OptionParser,CompileOptions,BuildOptions, and the remaining command shapes.KernelCompilerfacade — bridges frontend, IR, and backends into a single entry point.Program.cs,CompilationProperties.cs).Src/ILGPUC/build/(ILGPUC.targets,ILGPU.Kernels.targets,README.md) so downstream projects can invokeilgpuc buildtransparently.Scope boundary
No changes to testing or other infrastructure to run and validate outputs. Those will land in follow-up PRs.
Depends on
PRs #1355 and #1576.
Fixes
Fixes #847, fixes #463, fixes #1538, fixes #1539, fixes #1479, fixes #1309, fixes #1240, fixes #1361, fixes #1359, fixes #1305, closes #1476, closes #415, closed #1364
closes #1012 - The new IR provides the basic building blocks to enable this
closes #996 - The new IR provides the basic building blocks to enable this
closes #923 - The new IR provides the basic building blocks to enable this; we want to revisit reduced precision in future releases
closes #1324 - The new frontend implementation supports deriving default interface implementations natively
closes #1296 - GC holes have been assessed and removed in the compilation pipelines
closes #1232 - Native AOT support has been enabled by design using the latest compilation improvements
closes #1545 - These fixes are no longer required :)
closes #1143 - Is considered out-of-scope for now
closes #1107 - Is considered out-of-scope for now
closes #1408 - Is considered out-of-scope for now
closes #1209 - is considered out-of-scope for now