loki.transformations.transform_region
Collection of utility routines that provide transformations for code regions.
Functions
|
Hoist one or multiple code regions annotated by pragma ranges and insert them at a specified target location. |
- region_hoist(routine)
Hoist one or multiple code regions annotated by pragma ranges and insert them at a specified target location.
The pragma syntax for annotating the regions to hoist is
!$loki region-hoist [group(group-name)] [collapse(n) [promote(var-name, var-name, ...)]]
and!$loki end region-hoist
. The optionalgroup(group-name)
can be provided when multiple regions are to be hoisted and inserted at different positions. Multiple pragma ranges can be specified for the same group, all of which are then moved to the target location in the same order as the pragma ranges appear. The optionalcollapse(n)
parameter specifies thatn
enclosing scopes (such as loops, conditionals, etc.) should be re-created at the target location. Optionally, this can be combined with variable promotion usingpromote(...)
.