You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Semantic naming update: TPARTVIEW/TASSEMBLY is the active model; see #74 (comment). The older as_subtiles / public commit() spelling below is superseded.
Status
Compiler RFC. Proposed only; no implementation exists.
PTO range implementation remains blocked on PTO-ISA/pto-spec#166, which must reconcile the Local B.IOT SizeCode-12 contract/ASL/AVS contradiction.
Motivation
The programming model should expose an aligned architectural parent Tile as a homogeneous SubTile array:
auto score =
as_subtiles<ScoreSubTile, 1, 4>(score_parent);
for (int j = 0; j < 4; ++j)
TROWMAX(local_max, score[0][j]);
Assembly uses a symmetric output array:
auto probability =
make_subtile_assembly<ProbParent, ProbSubTile, 1, 4>(scope);
for (int j = 0; j < 4; ++j)
TCVT(probability[0][j], normalized[j]);
ProbParent whole = probability.commit();
The proxy arrays are not arrays of independent architectural Tiles. They borrow or contribute ranges of one parent identity.
This must be kept distinct from LLVM issue #60, where a real Local Tile array plus runtime indexing enters dynamic Tile-register selection, descriptor mismatch, PHI/live-out, and ICE paths. This RFC is intended to avoid those paths entirely.
Source semantic contract
as_subtiles<SubTile,R,C>(parent) returns a compiler-recognized, non-addressable partition view.
parts[i][j] carries:
one immutable parent identity and frozen descriptor;
SSA indices i and j;
a constant partition descriptor (SubTile, R, C, layout order);
no independent Tile payload or allocation.
It is not a SubTile&, cannot expose data(), cannot be stored or passed through ABI, and cannot escape the consuming Tile operation.
make_subtile_assembly<Parent,SubTile,R,C>() owns one linear assembly session. A destination-aware TileOP consumes the previous session and produces the successor session. commit() consumes the final session and returns the complete parent value/handle.
Required static legality
The frontend/verifier must require:
SubTile capacity is at least 128 B and has an assigned range SizeCode.
ParentBytes == R * C * SubTileBytes.
Parent/SubTile dtype, layout, location, role, physical shape, and valid shape are compatible.
Every partition slot maps to one contiguous interval in PTO CELL order.
The partition is a bijection over parent CELL coverage: no gaps, duplicates, or overlaps.
Index bounds are proved: 0 <= i < R, 0 <= j < C.
Every assembly slot is written exactly once before commit.
The selected operation schema accepts the source/destination role and generated effect class.
The compiler must reject instead of falling back to a real Tile array, memory, raw range wrapper, or inline assembly.
Proposed LLVM IR model
Types
Use non-storable target extension types equivalent to:
partition, region, and assembly values cannot be allocated, loaded, stored, bitcast, frozen, selected, passed through varargs/unknown calls, or exposed in external ABI.
Multi-output operations use generated writeN forms that consume all destination sessions and return an immediately extracted successor-session struct atomically.
Convergence and optimizer contract
Session operations, Shared partition reads, and region-aware TileOP consumers must be convergent and noduplicate and carry the same LLVM convergencectrl domain.
The verifier must reject:
partition/region/session escape;
CSE, clone, speculation, or DCE that changes linear contribution count;
Status
Compiler RFC. Proposed only; no implementation exists.
This is the LLVM companion for:
PTO range implementation remains blocked on PTO-ISA/pto-spec#166, which must reconcile the Local B.IOT SizeCode-12 contract/ASL/AVS contradiction.
Motivation
The programming model should expose an aligned architectural parent Tile as a homogeneous SubTile array:
Assembly uses a symmetric output array:
The proxy arrays are not arrays of independent architectural Tiles. They borrow or contribute ranges of one parent identity.
This must be kept distinct from LLVM issue #60, where a real Local Tile array plus runtime indexing enters dynamic Tile-register selection, descriptor mismatch, PHI/live-out, and ICE paths. This RFC is intended to avoid those paths entirely.
Source semantic contract
as_subtiles<SubTile,R,C>(parent)returns a compiler-recognized, non-addressable partition view.parts[i][j]carries:iandj;SubTile,R,C, layout order);It is not a
SubTile&, cannot exposedata(), cannot be stored or passed through ABI, and cannot escape the consuming Tile operation.make_subtile_assembly<Parent,SubTile,R,C>()owns one linear assembly session. A destination-aware TileOP consumes the previous session and produces the successor session.commit()consumes the final session and returns the complete parent value/handle.Required static legality
The frontend/verifier must require:
ParentBytes == R * C * SubTileBytes.0 <= i < R,0 <= j < C.The compiler must reject instead of falling back to a real Tile array, memory, raw range wrapper, or inline assembly.
Proposed LLVM IR model
Types
Use non-storable target extension types equivalent to:
partition,region, andassemblyvalues cannot be allocated, loaded, stored, bitcast, frozen, selected, passed through varargs/unknown calls, or exposed in external ABI.Partition creation/access
Illustrative contract:
A frontend may fold
createintoget, provided parent identity and constants remain explicit in IR.The resulting offset is:
The extent/SizeCode is constant. Only the origin is an SSA value.
Region-aware consumers
A region token may be consumed only by the operation-schema-approved Tile source role, for example:
The region must fuse into the consuming binder's immediately contiguous B.SUBVIEW. It must never become a new Tile definition.
Indexed assembly producers
Prefer a combined producer/session intrinsic so destination identity cannot detach from the producing TileOP:
Multi-output operations use generated
writeNforms that consume all destination sessions and return an immediately extracted successor-session struct atomically.Convergence and optimizer contract
Session operations, Shared partition reads, and region-aware TileOP consumers must be
convergentandnoduplicateand carry the same LLVMconvergencectrldomain.The verifier must reject:
Run the verifier after Clang CodeGen, after the main scalar optimizer, and before ISel.
Loop lowering
Source partition loop
B.SUBVIEW has constant SizeCode and dynamic affine origin, so a canonical bounded loop may remain a loop:
ScalarEvolution or equivalent must prove bounds and no overflow.
Assembly partition loop
B.ASSEMBLE INIT/LAST are encoded constants. For
C > 1, LLVM must either fully unroll or transform a canonical complete-coverage loop to:For one slot, emit INIT_LAST. The source language does not expose phase flags.
Conditional skip, duplicate index, unknown trip count, non-canonical traversal, or unproved coverage is rejected in v1.
MachineIR and Blockify integration
Partition/region/session facts must be explicit MachineInstr operands, not discardable debug metadata.
Extend the current pipeline so that:
SrcSelect=0, independent of global operation ordinal.Diagnostics
Add stable diagnostics for at least:
Minimum test matrix
Clang
parts[i][j]syntax;LLVM IR/verifier
CodeGen/MC
Runtime/model/workload
32x64 -> [1][4] 32x16FlashAttention sentinel from TileOP RFC Issue: TMATMUL_ACC 每迭代插入两条冗余 TCOPY(TMOV) #36;Acceptance boundary
This issue is ready for implementation only after:
Do not add a header-only approximation that emits opaque inline assembly or materializes a real Tile array.