Refactor Field Modelling
This MR introduces a significant refactoring of the backend handling of fields. This comprises several parts:
Symbol Properties
- Introduce a system of symbol properties used to add arbitrary information to symbols
- Remove subclasses for field-associated symbols
- Introduce properties for marking field shape, stride, and pointer symbols
- Refactor kernel parameters to hold symbol properties; remove field-specific
KernelParameter
subclasses
Field Buffers
- Rename
PsLinearizedArray
toPsBuffer
- move
PsBuffer
andPsSymbol
to modulebackend.memory
- Adapt
PsBuffer
constructor to take all its pointer, shape and stride asPsSymbol
orPsConstant
Buffers in the AST
- Replace
PsArrayAccess
byPsBufferAcc
;PsBufferAcc
takes an nd index tuple instead of a linearized index - Adapt freeze and typification to the above
- Introduce
LowerToC
transformation pass which lowers buffer accesses to raw memory accesses - Subsume
EraseAnonymousStructs
intoLowerToC
Kernel Translation
- Add
LowerToC
pass and late canonicalization and constant folding passes to thecreate_kernel
pipeline
Bugfixes
A number of bugs revealed during development are being fixed:
-
clone()
on expression nodes used to forget the nodes' data type; now keeps it - RHS expression in array declarations was not assigned a data type if the type was dictated by the LHS
Closes #101 (closed)
Continues work from !408 (merged)