Search in sources :

Example 1 with LoopInterchange

use of claw.wani.transformation.ll.loop.LoopInterchange in project claw-compiler by C2SM-RCM.

the class ClawTranslator method applyInterchangeClause.

/**
 * Generate loop interchange transformation if the clause is present in the
 * directive.
 *
 * @param claw    ClawPragma object that tells encapsulates all information
 *                about the current directives and its clauses.
 * @param xcodeml Current XcodeML program.
 * @param stmt    Statement on which the transformation is attached. Must be a
 *                FdoStatement for the loop interchange transformation.
 */
private void applyInterchangeClause(ClawPragma claw, XcodeProgram xcodeml, Xnode stmt) throws IllegalTransformationException {
    if (claw.hasClause(ClawClause.INTERCHANGE) && Xnode.isOfCode(stmt, Xcode.F_DO_STATEMENT)) {
        Xnode p = xcodeml.createNode(Xcode.F_PRAGMA_STATEMENT);
        stmt.insertBefore(p);
        ClawPragma l = ClawPragma.createLoopInterchangeLanguage(claw, p);
        LoopInterchange interchange = new LoopInterchange(l);
        addTransformation(xcodeml, interchange);
        Message.debug(context(), "Loop interchange added: " + claw.values(ClawClause.INTERCHANGE_INDEXES));
    }
}
Also used : Xnode(claw.tatsu.xcodeml.xnode.common.Xnode) LoopInterchange(claw.wani.transformation.ll.loop.LoopInterchange) ClawPragma(claw.wani.language.ClawPragma)

Aggregations

Xnode (claw.tatsu.xcodeml.xnode.common.Xnode)1 ClawPragma (claw.wani.language.ClawPragma)1 LoopInterchange (claw.wani.transformation.ll.loop.LoopInterchange)1