psyclone.psyir.transformations.loop_trans
This module contains the base class LoopTrans. All transformations which act on a loop sub-class this one.
Classes
LoopTrans
: This abstract class is a base class for all transformations that act
- class psyclone.psyir.transformations.loop_trans.LoopTrans
This abstract class is a base class for all transformations that act on a Loop node. It gives access to a validate function that makes sure that the supplied node is a Loop. We also check that all nodes to be enclosed are valid for this transformation - this requires that the sub-class populate the excluded_node_types tuple.
Inheritance
- property name
- Returns:
the name of this class.
- Return type:
str
- validate(node, options=None)
Checks that the supplied node is a valid target for a loop transformation.
- Parameters:
node (subclass of
psyclone.psyir.nodes.Node
) – target PSyIR node.options (Optional[Dict[str, Any]]) – a dictionary with options for transformations.
options["node-type-check"] (bool) – this flag controls if the type of the nodes enclosed in the loop should be tested to avoid including unsupported nodes in a transformation.
- Raises:
TransformationError – if the supplied node is not a (fully- formed) Loop.
TransformationError – if any of the nodes within the loop are of an unsupported type.
TransformationError – if the loop is of ‘null’ type.
TransformationError – if the supplied options are not a dictionary.