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
KernelParametersubclasses
Field Buffers
- Rename
PsLinearizedArraytoPsBuffer - move
PsBufferandPsSymbolto modulebackend.memory - Adapt
PsBufferconstructor to take all its pointer, shape and stride asPsSymbolorPsConstant
Buffers in the AST
- Replace
PsArrayAccessbyPsBufferAcc;PsBufferAcctakes an nd index tuple instead of a linearized index - Adapt freeze and typification to the above
- Introduce
LowerToCtransformation pass which lowers buffer accesses to raw memory accesses - Subsume
EraseAnonymousStructsintoLowerToC
Kernel Translation
- Add
LowerToCpass and late canonicalization and constant folding passes to thecreate_kernelpipeline
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)