Skip to content

Commit

Permalink
Disable optimizers for now
Browse files Browse the repository at this point in the history
lsk567 committed Nov 12, 2024
1 parent a145e33 commit 0cca5dc
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -94,6 +94,9 @@ public class CStaticScheduleGenerator {
/** PretVM registers */
protected Registers registers = new Registers();

/** Flag indicating whether optimizers are used */
protected boolean optimize = false;

// Constructor
public CStaticScheduleGenerator(
CFileConfig fileConfig,
@@ -111,6 +114,7 @@ public CStaticScheduleGenerator(
this.reactors = reactorInstances;
this.reactions = reactionInstances;
this.triggers = reactionTriggers;
this.optimize = false;

// Create a directory for storing graph.
this.graphDir = fileConfig.getSrcGenPath().resolve("graphs");
@@ -219,8 +223,10 @@ public void generate() {
// Invoke the dag-based optimizer on each object file.
// It is invoked before linking because after linking,
// the DAG information is gone.
for (var objectFile : pretvmObjectFiles) {
DagBasedOptimizer.optimize(objectFile, workers, registers);
if (this.optimize) {
for (var objectFile : pretvmObjectFiles) {
DagBasedOptimizer.optimize(objectFile, workers, registers);
}
}

// Link multiple object files into a single executable (represented also in an object file
@@ -231,9 +237,11 @@ public void generate() {

// Invoke the peephole optimizer.
// FIXME: Should only apply to basic blocks!
var schedules = executable.getContent();
for (int i = 0; i < schedules.size(); i++) {
PeepholeOptimizer.optimize(schedules.get(i));
if (this.optimize) {
var schedules = executable.getContent();
for (int i = 0; i < schedules.size(); i++) {
PeepholeOptimizer.optimize(schedules.get(i));
}
}

// Generate C code.

0 comments on commit 0cca5dc

Please sign in to comment.