Example #1
0
  public void perform() {
    if (trace) System.out.println("** LP " + scribble.getRoutineDecl().getName());

    LoopHeaderChord lt = scribble.getLoopTree();
    Vector<LoopHeaderChord> innerLoops = lt.getInnerLoops();

    for (int li = 0; li < innerLoops.size(); li++) {
      LoopHeaderChord loop = innerLoops.elementAt(li);
      InductionVar ivar = loop.getPrimaryInductionVar();

      if (trace) System.out.println("   lp " + loop.nestedLevel() + " " + loop);

      if ((ivar == null) || !loop.isPerfectlyNested()) {
        innerLoops.addVectors(loop.getInnerLoops());
        continue;
      }

      if (loop.nestedLevel() < 2) // no need to check permutation for a simple nest
      continue;

      tryPermute(loop);
    }
  }