[feat] Final partial unroll phase
@@ -42,17 +42,19 @@ import uk.ac.manchester.tornado.runtime.common.Tornado;
*
* @see org.graalvm.compiler.loop.phases.LoopTransformations
*/
+
public class TornadoPartialLoopUnroll extends BasePhase<MidTierContext> {
private static final int LOOP_UNROLL_FACTOR_DEFAULT = 2;
private static final int LOOP_BOUND_UPPER_LIMIT = 16384;
@Override
protected void run(StructuredGraph graph, MidTierContext context) {
- int initialNodeCount = graph.getNodeCount();
if (!graph.hasLoops()) {
return;
}
+
+ int initialNodeCount = graph.getNodeCount();
int unrollFactor = getUnrollFactor();
for (int i = 0; Math.pow(2, i) < unrollFactor; i++) {
