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
药枣杞组
Compiler2023-6,药枣杞组,北航
Commits
8e224ea7
Commit
8e224ea7
authored
1 year ago
by
鹿煜恒
Browse files
Options
Download
Plain Diff
Merge remote-tracking branch 'public/testInline2'
# Conflicts: # src/Compiler.java
parents
ddf7c370
fb3a9289
main
addLd
cryptoTest
fixArrayTypeConvert
inlineFunctionPhi
loopPeepHole
mulitiple
testDataFlowProcess
testLoopCompute
testNewLoopLiftOut
testOpenInlineFunction
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Compiler.java
+2
-5
src/Compiler.java
src/ir/pass/opt/ArrayEliminate.java
+3
-1
src/ir/pass/opt/ArrayEliminate.java
with
5 additions
and
6 deletions
+5
-6
src/Compiler.java
+
2
−
5
View file @
8e224ea7
...
...
@@ -71,7 +71,7 @@ public class Compiler {
try
(
FileWriter
fileWriter
=
new
FileWriter
(
"./llvmIRPreInlineFunction.ll"
))
{
fileWriter
.
append
(
visitor
.
module
.
toString
());
}
//
InlineFunction inlineFunction = new InlineFunction();
InlineFunction
inlineFunction
=
new
InlineFunction
();
// inlineFunction.run(module, visitor);
ModuleFlattener
.
flattenModule
(
module
);
...
...
@@ -102,9 +102,6 @@ public class Compiler {
// }
// }
// }
try
(
FileWriter
fileWriter
=
new
FileWriter
(
"./llvmIRAfterMem2Reg.ll"
))
{
fileWriter
.
append
(
visitor
.
module
.
toString
());
}
DeadCodeEmit
deadCodeEmitAfterMem2reg
=
new
DeadCodeEmit
();
deadCodeEmitAfterMem2reg
.
run
(
module
);
new
BrRemoving
().
run
(
module
);
...
...
@@ -135,7 +132,7 @@ public class Compiler {
}
DeadCodeEmit
deadCodeEmitAfterGCM
=
new
DeadCodeEmit
();
deadCodeEmitAfterGCM
.
run
(
module
);
deadCodeEmitAfterGCM
.
run
Strong
(
module
);
RemovePhi
removePhi
=
new
RemovePhi
();
removePhi
.
run
(
module
);
System
.
out
.
printf
(
"removePHI:%f s%n"
,
gettime
());
...
...
This diff is collapsed.
Click to expand it.
src/ir/pass/opt/ArrayEliminate.java
+
3
−
1
View file @
8e224ea7
...
...
@@ -10,6 +10,7 @@ import ir.instr.Load;
import
ir.instr.Phi
;
import
ir.instr.Store
;
import
ir.pass.analyze.AccessAnalyzer
;
import
ir.type.IntType
;
import
ir.value.Arg
;
import
ir.value.BasicBlock
;
import
ir.value.ConstNumber
;
...
...
@@ -383,7 +384,8 @@ public class ArrayEliminate {
conflictStores
.
forEach
(
s
->
storeCount
.
put
(
s
,
storeCount
.
get
(
s
)
+
1
));
}
else
{
if
(
ptr
.
getOP
(
0
)
instanceof
Alloca
)
{
instr
.
replaceAllUsers
(
new
ConstNumber
(
0
));
instr
.
replaceAllUsers
(
instr
.
type
instanceof
IntType
?
new
ConstNumber
(
0
):
new
ConstNumber
(
0.0
));
needrepeat
=
true
;
}
else
if
(
ptr
.
getOP
(
0
)
instanceof
Global
)
{
if
(!((
Global
)
ptr
.
getOP
(
0
)).
isInit
)
{
...
...
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