Skip to content

Commit

Permalink
Fix incorrect CFG fetch in LocalOptimizationPass
Browse files Browse the repository at this point in the history
* Now -X-C runs with all passes again.
  • Loading branch information
subbuss committed Mar 3, 2015
1 parent 8e1e2f8 commit 6ec9f98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -93,9 +93,6 @@ public void generateInstructionsForIntepretation() {

cfg.getExitBB().getLabel().setTargetPC(ipc + 1); // Exit BB ipc

// System.out.println("SCOPE: " + getName());
// System.out.println("INSTRS: " + cfg().toStringInstrs());

Instr[] linearizedInstrArray = newInstrs.toArray(new Instr[newInstrs.size()]);

// Pass 2: Use ipc info from previous to mark all linearized instrs rpc
Expand All @@ -115,6 +112,9 @@ public void generateInstructionsForIntepretation() {

instructions = linearizedInstrArray;
temporaryVariablecount = getScope().getTemporaryVariablesCount();

// System.out.println("SCOPE: " + getScope().getName());
// System.out.println("INSTRS: " + cfg.toStringInstrs());
}

@Override
Expand Down
Expand Up @@ -26,7 +26,7 @@ public Object execute(IRScope s, Object... data) {
run(c, false, true);
}

for (BasicBlock b: ((CFG) data[0]).getBasicBlocks()) {
for (BasicBlock b: s.getCFG().getBasicBlocks()) {
runLocalOptsOnInstrList(s, b.getInstrs().listIterator(), false);
}

Expand Down

0 comments on commit 6ec9f98

Please sign in to comment.