Selective code generation optimization for an advanced dual-representation polyhedral loop transformation framework
First Claim
1. A method, in a data processing system having a processor implemented in hardware, for optimizing program code, comprising:
- receiving, by the processor, source code for a program in a compiler;
transforming, by the processor, the source code into a program statement view of the source code;
transforming, by the processor, the program statement view of the source code into a program loop view of the source code, wherein the program loop view is an abstract syntax tree (AST) representation of the source code generated by applying a loop transformation on the program statement view, and wherein the AST of the program loop view comprises a plurality of nodes with each node representing a loop in the source code;
applying, by the processor, one or more code generation optimizations to the program loop view of the source code to generate optimized code; and
outputting, by the processor, the optimized code to a compiler for use in generating executable code for execution on a computing device, wherein the one or more code generation optimizations transform the program loop view of the source code into the optimized code while maintaining both program and schedule equivalence between the optimized code and the program statement view of the source code, wherein each code generation optimization of the one or more code generation optimizations visits a list of nodes of the AST in the program loop view for which the code generation optimization is to be applied and a propagation mode indicator that identifies a manner by which the list of nodes is to be processed by the code generation optimization.
2 Assignments
0 Petitions
Accused Products
Abstract
Mechanisms for selective code generation optimization for an advanced dual-representation polyhedral loop transformation framework are provided. The mechanisms of the illustrative embodiments address the weaknesses of the known polyhedral loop transformation based approaches by providing mechanisms for performing code generation transformations on individual statement instances in an intermediate representation generated by the polyhedral loop transformation optimization of the source code. These code generation transformations have the important property that they do not change program order of the statements in the intermediate representation. This property allows the result of the code generation transformations to be provided back to the polyhedral loop transformation mechanisms in a program statement view, via a new re-entrance path of the illustrative embodiments, for additional optimization.
104 Citations
20 Claims
-
1. A method, in a data processing system having a processor implemented in hardware, for optimizing program code, comprising:
-
receiving, by the processor, source code for a program in a compiler; transforming, by the processor, the source code into a program statement view of the source code; transforming, by the processor, the program statement view of the source code into a program loop view of the source code, wherein the program loop view is an abstract syntax tree (AST) representation of the source code generated by applying a loop transformation on the program statement view, and wherein the AST of the program loop view comprises a plurality of nodes with each node representing a loop in the source code; applying, by the processor, one or more code generation optimizations to the program loop view of the source code to generate optimized code; and outputting, by the processor, the optimized code to a compiler for use in generating executable code for execution on a computing device, wherein the one or more code generation optimizations transform the program loop view of the source code into the optimized code while maintaining both program and schedule equivalence between the optimized code and the program statement view of the source code, wherein each code generation optimization of the one or more code generation optimizations visits a list of nodes of the AST in the program loop view for which the code generation optimization is to be applied and a propagation mode indicator that identifies a manner by which the list of nodes is to be processed by the code generation optimization. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A computer program product comprising a computer useable storage medium having a computer readable program stored thereon, wherein the computer readable program, when executed on a computing device, causes the computing device to:
-
receive source code for a program in a compiler; transform the source code into a program statement view of the source code; transform the program statement view of the source code into a program loop view of the source code, wherein the program loop view is an abstract syntax tree (AST) representation of the source code generated by applying a loop transformation on the program statement view, and wherein the AST of the program loop view comprises a plurality of nodes with each node representing a loop in the source code; apply one or more code generation optimizations to the program loop view of the source code to generate optimized code; and output the optimized code to a compiler for use in generating executable code for execution on a computing device, wherein the one or more code generation optimizations transform the program loop view of the source code into the optimized code while maintaining both program and schedule equivalence between the optimized code and the program statement view of the source code, wherein each code generation optimization of the one or more code generation optimizations visits a list of nodes of the AST in the program loop view for which the code generation optimization is to be applied and a propagation mode indicator that identifies a manner by which the list of nodes is to be processed by the code generation optimization. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19)
-
-
20. A system, comprising:
-
a processor; and a memory coupled to the processor, wherein the memory comprises instructions which, when executed by the processor, cause the processor to; receive source code for a program in a compiler; transform the source code into a program statement view of the source code; transform the program statement view of the source code into a program loop view of the source code, wherein the program loop view is an abstract syntax tree (AST) representation of the source code generated by applying a loop transformation on the program statement view, and wherein the AST of the program loop view comprises a plurality of nodes with each node representing a loop in the source code; apply one or more code generation optimizations to the program loop view of the source code to generate optimized code; and output the optimized code to a compiler for use in generating executable code for execution on a computing device, wherein the one or more code generation optimizations transform the program loop view of the source code into the optimized code while maintaining both program and schedule equivalence between the optimized code and the program statement view of the source code, wherein each code generation optimization of the one or more code generation optimizations visits a list of nodes of the AST in the program loop view for which the code generation optimization is to be applied and a propagation mode indicator that identifies a manner by which the list of nodes is to be processed by the code generation optimization.
-
Specification