Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
educg-net-26173-2487151
Compiler2024-SubmarineCompiler-2508
Commits
0cb1b351
Commit
0cb1b351
authored
7 months ago
by
Linyu
Browse files
Options
Download
Patches
Plain Diff
loop rotate 5.3: fusion胜利
parent
90720e82
main
grl_last
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Compiler.java
+8
-8
src/Compiler.java
src/midend/loop/LoopFusion.java
+18
-1
src/midend/loop/LoopFusion.java
with
26 additions
and
9 deletions
+26
-9
src/Compiler.java
+
8
−
8
View file @
0cb1b351
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
src/midend/loop/LoopFusion.java
+
18
−
1
View file @
0cb1b351
...
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets