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);
}
}
Aggregations