sanitizer.assert.layout
← sanitizer dialect
Assert that a view satisfies a refined layout, shape, or encoding contract and return the same view on the continuing path. This is the executable counterpart to view.refine for diagnostics that must abort instead of trusting unchecked layout facts.
Operation contract
| Property |
Value |
| Semantic phase |
— |
| Traits |
UnknownEffects, RefinableResultTypeRefs, FactIdentity |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Operand |
view |
view |
required |
Source view to assert and refine. |
| Result |
result |
view |
required |
Same view on the path where the layout assertion held. |
Verification constraints
SameElementType(view, result)
RanksMatch(view, result)
Examples
%checked = sanitizer.assert.layout %view : view<[%M]x[%N]xf32, %layout> -> view<16x[%N]xf32, %layout>