Dice Question Streamline Icon: https://streamlinehq.com

Feasibility of achieving automatic view construction solely via C++ reflections

Determine whether C++ compilers can, using only C++ reflection facilities, implement an automatic, multi-step transformation pipeline that constructs temporary local data views by performing out-of-place AoS-to-SoA reordering, eliminating unused (dead) data accesses based on program analysis, and enabling aggressive vectorization, without requiring additional annotations or code rewrites beyond reflections.

Information Square Streamline Icon: https://streamlinehq.com

Background

The paper proposes compiler-guided, annotation-based AoS-to-SoA conversions with automatically constructed data views for improved performance. It notes that, in theory, similar transformations might be realized via C++ reflections, where compiler optimization passes could leverage reflection metadata to reorder data out-of-place, eliminate dead data access, and vectorize.

However, the authors state that it remains uncertain whether compilers will be able to provide such complex, multi-step code transformations solely via reflections in the near future, and point out that reflections currently require code rewrites and no automatic view constructions are available.

References

However, it remains uncertain whether compilers will be able to offer such a complex, multi-step code transformation solely through reflections in the near future.

Annotation-guided AoS-to-SoA conversions and GPU offloading with data views in C++ (2502.16517 - Radtke et al., 23 Feb 2025) in Section 1 Introduction