Search in sources :

Example 1 with LoopInterchange

use of cx2x.translator.transformation.loop.LoopInterchange in project claw-compiler by C2SM-RCM.

the class TransformationHelper method applyInterchangeClause.

/**
   * Generate loop interchange transformation if the clause is present in the
   * directive.
   *
   * @param claw        ClawLanguage object that tells encapsulates all
   *                    information about the current directives and its
   *                    clauses.
   * @param xcodeml     Current XcodeML program.
   * @param transformer Transformer object in which new transformation are
   *                    added.
   * @param stmt        Statement on which the transformation is attached. Must
   *                    be a FdoStatement for the loop interchange
   *                    transformation.
   */
private static void applyInterchangeClause(ClawLanguage claw, XcodeProgram xcodeml, Transformer transformer, Xnode stmt) {
    if (claw.hasInterchangeClause() && stmt.opcode() == Xcode.FDOSTATEMENT) {
        Xnode p = new Xnode(Xcode.FPRAGMASTATEMENT, xcodeml);
        stmt.insertBefore(p);
        ClawLanguage l = ClawLanguage.createLoopInterchangeLanguage(claw, p);
        LoopInterchange interchange = new LoopInterchange(l);
        transformer.addTransformation(interchange);
        if (XmOption.isDebugOutput()) {
            System.out.println("Loop interchange added: " + claw.getIndexes());
        }
    }
}
Also used : LoopInterchange(cx2x.translator.transformation.loop.LoopInterchange) ClawLanguage(cx2x.translator.language.base.ClawLanguage)

Aggregations

ClawLanguage (cx2x.translator.language.base.ClawLanguage)1 LoopInterchange (cx2x.translator.transformation.loop.LoopInterchange)1