llvm / clangir

A new (MLIR based) high-level IR for clang.
https://clangir.org
Other
386 stars 98 forks source link

Data layout modeling for CIR types #710

Open Lancern opened 4 months ago

Lancern commented 4 months ago

The data layout of some types are target-specific. For example, the size of a pointer could be 4 or 8 depending on the target. However, the current DataLayoutTypeInterface implementation for all CIR types only return a fixed data layout regardless of the target.

The data layout subsystem of MLIR allows customization of data layouts of types within a specific region. The module op and each region can be attached with data layout properties, typically in the form of data layout specifications, that affect the layout of the types within them. We can leverage this mechanism to make the CIR types aware of the target when computing data layout, by attaching the module op with data layout information computed for the target.

bcardosolopes commented 2 months ago

@Lancern are you currently working on this one? @sitio-couto might be able to take it

Lancern commented 2 months ago

@bcardosolopes No I have not started working on this. @sitio-couto Feel free to take it!