Commit 0cb1b351 authored by Linyu's avatar Linyu
Browse files

loop rotate 5.3: fusion胜利

No related merge requests found
Showing with 26 additions and 9 deletions
+26 -9
......@@ -79,14 +79,14 @@ public class Compiler {
// DeadBlockRemove.execute(functions);
// RemoveUseLessPhi.execute(functions);
//
// DFG.execute(functions);
// AnalysisLoop.execute(functions);
// LCSSA.execute(functions);
//// LoopFusion.execute(functions);
// OIS.execute(functions);
// DeadCodeRemove.execute(functions);
// DeadBlockRemove.execute(functions);
// RemoveUseLessPhi.execute(functions);
DFG.execute(functions);
AnalysisLoop.execute(functions);
LCSSA.execute(functions);
LoopFusion.execute(functions);
OIS.execute(functions);
DeadCodeRemove.execute(functions);
DeadBlockRemove.execute(functions);
RemoveUseLessPhi.execute(functions);
/*RemoveUselessPhi 会影响LCSSA吗 会的*/
DFG.execute(functions);
......
......@@ -103,6 +103,24 @@ public class LoopFusion {
//anon: 融合loopExit部分 由于removeUselessPhi, 所以这里只会在exit中存在phi,将exit1放到exit2中
BasicBlock loopExit2 = loop2.getExits().get(0);
BasicBlock loopExit1 = loop1.getExits().get(0);
Instruction phiInloopExit1 = loopExit1.getEndInstr();
Instruction lastPhi = (Instruction) loopExit2.getInstructions().getHead();
Instruction tmpIns;
while (phiInloopExit1 != null) {
tmpIns = (Instruction) phiInloopExit1.getPrev();
if (phiInloopExit1 instanceof PhiInstr) {
phiInloopExit1.removeFromListWithUseRemain();
phiInloopExit1.insertBefore(lastPhi);
((PhiInstr) phiInloopExit1).modifyPrtBlk(latch1, latch2);
lastPhi = phiInloopExit1;
}
phiInloopExit1 = tmpIns;
}
BasicBlock exit1 = null;
for (BasicBlock block : loopExit1.getSucs()) {
exit1 = block;
......@@ -127,7 +145,6 @@ public class LoopFusion {
}
Instruction instr = (Instruction) exit1.getEndInstr().getPrev();
Instruction tmpIns;
while (instr != null) {
tmpIns = (Instruction) instr.getPrev();
instr.removeFromListWithUseRemain();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment