Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-fast
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mu
mu-impl-fast
Commits
1c69069c
Commit
1c69069c
authored
Oct 17, 2017
by
qinsoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wont generate mov from tmp_a to tmp_a in intermediate block. No longer
put binop/move as tree child
parent
e0dd25b3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
18 deletions
+28
-18
src/compiler/backend/arch/x86_64/asm_backend.rs
src/compiler/backend/arch/x86_64/asm_backend.rs
+7
-2
src/compiler/backend/reg_alloc/graph_coloring/liveness.rs
src/compiler/backend/reg_alloc/graph_coloring/liveness.rs
+3
-3
src/compiler/mod.rs
src/compiler/mod.rs
+2
-0
src/compiler/passes/gen_mov_phi.rs
src/compiler/passes/gen_mov_phi.rs
+13
-8
src/compiler/passes/tree_gen.rs
src/compiler/passes/tree_gen.rs
+3
-5
No files found.
src/compiler/backend/arch/x86_64/asm_backend.rs
View file @
1c69069c
...
...
@@ -4485,7 +4485,12 @@ pub fn spill_rewrite(
.clone_value
();
// maintain mapping
trace!
(
"reg {} used in Inst{} is replaced as {}"
,
val_reg
,
i
,
temp
);
trace!
(
"reg {} used in Inst{} is replaced as {}"
,
val_reg
.id
(),
i
,
temp
);
spilled_scratch_temps
.insert
(
temp
.id
(),
reg
);
// generate a load
...
...
@@ -4542,7 +4547,7 @@ pub fn spill_rewrite(
};
trace!
(
"reg {} defined in Inst{} is replaced as {}"
,
val_reg
,
val_reg
.id
()
,
i
,
temp
);
...
...
src/compiler/backend/reg_alloc/graph_coloring/liveness.rs
View file @
1c69069c
...
...
@@ -243,13 +243,13 @@ impl InterferenceGraph {
self
.adj_list
.get_mut
(
&
u
)
.unwrap
()
.insert
(
v
);
let
degree
=
self
.get_degree_of
(
u
);
self
.set_degree_of
(
u
,
degree
+
1
);
trace!
(
"increase degree of {} to {}"
,
u
,
degree
+
1
);
trace!
(
"
increase degree of {} to {}"
,
u
,
degree
+
1
);
}
if
!
is_precolored
(
v
)
{
self
.adj_list
.get_mut
(
&
v
)
.unwrap
()
.insert
(
u
);
let
degree
=
self
.get_degree_of
(
v
);
self
.set_degree_of
(
v
,
degree
+
1
);
trace!
(
"increase degree of {} to {}"
,
v
,
degree
+
1
);
trace!
(
"
increase degree of {} to {}"
,
v
,
degree
+
1
);
}
}
}
...
...
@@ -310,7 +310,7 @@ impl InterferenceGraph {
}
pub
fn
set_degree_of
(
&
mut
self
,
reg
:
MuID
,
degree
:
usize
)
{
debug!
(
"DEGREE({}) SET TO
{}"
,
reg
,
degree
);
trace!
(
" set degree({}) =
{}"
,
reg
,
degree
);
self
.degree
.insert
(
reg
,
degree
);
}
...
...
src/compiler/mod.rs
View file @
1c69069c
...
...
@@ -54,6 +54,7 @@ impl<'vm> Compiler<'vm> {
/// compiles a certain function version
pub
fn
compile
(
&
self
,
func
:
&
mut
MuFunctionVersion
)
{
info!
(
""
);
info!
(
"compilation_start {}"
,
func
.id
());
info!
(
"Start compiling {}"
,
func
);
info!
(
""
);
debug!
(
"{:?}"
,
func
);
...
...
@@ -78,6 +79,7 @@ impl<'vm> Compiler<'vm> {
// build exception table for this function
unimplemented!
()
}
info!
(
"compilation_end {}"
,
func
.id
());
}
}
...
...
src/compiler/passes/gen_mov_phi.rs
View file @
1c69069c
...
...
@@ -324,6 +324,10 @@ impl CompilerPass for GenMovPhi {
// move every from_arg to target_arg
let
mut
i
=
0
;
for
arg
in
block_info
.from_args
.iter
()
{
let
ref
target_arg
=
target_args
[
i
];
// when a block branches to itself, it is possible that
// arg is the same as target_arg
if
arg
.as_value
()
!=
target_arg
{
let
m
=
func
.new_inst
(
Instruction
{
hdr
:
MuEntityHeader
::
unnamed
(
vm
.next_id
()),
value
:
Some
(
vec!
[
target_args
[
i
]
.clone
()]),
...
...
@@ -332,6 +336,7 @@ impl CompilerPass for GenMovPhi {
});
vec
.push
(
m
);
}
i
+=
1
;
}
...
...
src/compiler/passes/tree_gen.rs
View file @
1c69069c
...
...
@@ -89,8 +89,8 @@ fn is_suitable_child(inst: &Instruction) -> bool {
AtomicRMW
{
..
}
|
Store
{
..
}
=>
false
,
BinOp
(
_
,
_
,
_
)
|
BinOpWithStatus
(
_
,
_
,
_
,
_
)
|
BinOp
(
_
,
_
,
_
)
|
BinOpWithStatus
(
_
,
_
,
_
,
_
)
|
CommonInst_GetThreadLocal
|
Move
(
_
)
=>
false
,
CmpOp
(
_
,
_
,
_
)
|
ConvOp
{
..
}
|
Load
{
..
}
|
...
...
@@ -98,9 +98,7 @@ fn is_suitable_child(inst: &Instruction) -> bool {
GetFieldIRef
{
..
}
|
GetElementIRef
{
..
}
|
ShiftIRef
{
..
}
|
GetVarPartIRef
{
..
}
|
CommonInst_GetThreadLocal
|
Move
(
_
)
=>
true
GetVarPartIRef
{
..
}
=>
true
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment