psyclone.psyir.transformations.intrinsics.max2code_trans#

Module providing a transformation from a PSyIR MAX intrinsic to PSyIR code. This could be useful if the MAX intrinsic is not supported by the back-end or if the performance of the inline code is better than the intrinsic.

Classes#

  • Max2CodeTrans: Provides a transformation from a PSyIR MAX Intrinsic node to

class psyclone.psyir.transformations.intrinsics.max2code_trans.Max2CodeTrans[source]#

Provides a transformation from a PSyIR MAX Intrinsic node to equivalent code in a PSyIR tree. Validity checks are also performed (by a parent class).

The transformation replaces

R = MAX(A, B, C ...)

with the following logic:

R = A
if B > R:
    R = B
if C > R:
    R = C
...

Inheritance

Inheritance diagram of Max2CodeTrans
apply(node, options=None, **kwargs)[source]#

Applies the Max2CodeTrans to the provided node.

Parameters: