Loop Transformations using Clang's Abstract Syntax Tree
Michael Kruse

TL;DR
This paper discusses two AST representations in Clang for OpenMP loop transformations, enhancing semantic abstraction and compatibility, with implications for future compiler support and front-end integration.
Contribution
It introduces a new meta AST-node and a canonical loop info type that improve loop semantics abstraction and facilitate shared implementation across front-ends.
Findings
Two AST representations are compared for OpenMP loop transformations.
The new approach improves semantic abstraction and code sharing.
It supports future OpenMP directives like unroll and tile.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
