psyclone.psyir.transformations.intrinsics.intrinsic2code_trans#
Module providing an abstract class which provides some generic functionality required by transformations of PSyIR intrinsic (such as MIN and MAX) to code.
Classes#
Intrinsic2CodeTrans: Provides support for transformations from PSyIR IntrinsicCall
- class psyclone.psyir.transformations.intrinsics.intrinsic2code_trans.Intrinsic2CodeTrans[source]#
Provides support for transformations from PSyIR IntrinsicCall nodes to equivalent PSyIR code in a PSyIR tree. Such transformations can be useful when the intrinsic is not supported by a particular backend or if it is more efficient to have explicit code.
Inheritance

- abstractmethod apply(node, options=None, **kwargs)[source]#
Apply the Intrinsic2CodeTrans transformation.
- Parameters:
node (
psyclone.psyir.nodes.IntrinsicCall) – the target intrinsic call.options (dict[str, Any]) – any options for the transformation.
- validate(node, options=None, **kwargs)[source]#
Perform various checks to ensure that it is valid to apply an intrinsic transformation to the supplied Node.
- Parameters:
node (
psyclone.psyir.nodes.IntrinsicCall) – the node that is being checked.options (Optional[Dict[str, Any]]) – a dictionary with options for transformations.
- Raises:
TransformationError – if the node argument is not the expected type.
TransformationError – if the IntrinsicCall node does not have an Assignment Node as an ancestor.