Search in sources :

Example 1 with DependentTransformationGroup

use of cx2x.xcodeml.transformation.DependentTransformationGroup in project claw-compiler by C2SM-RCM.

the class IterationSpace method tryFusion.

/**
   * Analyze the dependence information at each level and try to merge
   * independent do statements.
   *
   * @param xcodeml     Current XcodeML/F program unit.
   * @param transformer Current transformer.
   * @param master      ClawLanguage that triggered this transformation.
   * @throws Exception If the fusion fails.
   */
public void tryFusion(XcodeProgram xcodeml, Transformer transformer, ClawLanguage master) throws Exception {
    for (int i = _levels.size() - 1; i >= 0; --i) {
        List<DependenceAnalysis> loopsAtLevel = getLevel(i);
        DependentTransformationGroup fusions = new DependentTransformationGroup("parallelize-fusion");
        for (DependenceAnalysis dep : loopsAtLevel) {
            if (dep.isIndependent()) {
                ClawLanguage l = ClawLanguage.createLoopFusionLanguage(master);
                LoopFusion fusion = new LoopFusion(dep.getDoStmt(), l);
                fusions.add(fusion);
            }
        }
        fusions.applyTranslations(xcodeml, transformer);
    }
}
Also used : LoopFusion(cx2x.translator.transformation.loop.LoopFusion) DependentTransformationGroup(cx2x.xcodeml.transformation.DependentTransformationGroup) ClawLanguage(cx2x.translator.language.base.ClawLanguage)

Aggregations

ClawLanguage (cx2x.translator.language.base.ClawLanguage)1 LoopFusion (cx2x.translator.transformation.loop.LoopFusion)1 DependentTransformationGroup (cx2x.xcodeml.transformation.DependentTransformationGroup)1