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

Inheritance diagram of LoopTrans
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: