OpenMP 5.1 introduced the first loop nest transformation directives unroll and tile, and more are expected to be included in OpenMP 6.0. We discuss the two Abstract Syntax Tree (AST) representations used by Clang's implementation that is currently under development. The first representation is designed for compatibility with the existing implementation and stores the transformed loop nest in a shadow AST next to the syntactical AST. The second representation introduces a new meta AST-node OMPCanonicalLoop that guarantees that the semantic requirements of an OpenMP loop are met, and a CanonicalLoopInfo type that the OpenMPIRBuilder uses to represent literal and transformed loops. This second approach provides a better abstraction of loop semantics, removes the need for shadow AST nodes that are only relevant for code generation, allows sharing the implementation with other front-ends such as flang, but depends on the OpenMPIRBuilder which is currently under development.
翻译:OpenMP 5.1 引入了第一个循环巢变换指令的无滚动和砖块,预计更多内容将包含在 OpenMP 6.0 中。 我们讨论了当前Clang 执行过程中所使用的两个简易语法树(AST) 演示。 第一个演示旨在与现有的执行兼容,并将已转变的环形巢存放在合成AST 的阴影中。 第二个演示引入了一个新的元的 AST-node OMP CanonicalLoop, 保证 OpenMP 循环的语义要求得到满足, 以及 OpenMPIRBuilder 用来代表轻度和变形环的 CanonicLoopInfo 类型。 第二个演示方法提供了更好的环形语义的抽象化, 排除了对仅与代码生成相关的阴影 AST 结点的需要, 允许与其他前端如 Flang 共享执行, 但取决于目前正在开发的 OpenMPIRBuilder 。