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
c95b39a4
Commit
c95b39a4
authored
Sep 21, 2017
by
qinsoon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug, and remove warnings
parent
9f41288e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
120 additions
and
20 deletions
+120
-20
src/compiler/backend/reg_alloc/graph_coloring/liveness.rs
src/compiler/backend/reg_alloc/graph_coloring/liveness.rs
+1
-3
src/compiler/passes/trace_gen.rs
src/compiler/passes/trace_gen.rs
+3
-1
tests/ir_macros.rs
tests/ir_macros.rs
+0
-1
tests/test_compiler/test_binop.rs
tests/test_compiler/test_binop.rs
+0
-1
tests/test_compiler/test_controlflow.rs
tests/test_compiler/test_controlflow.rs
+116
-1
tests/test_compiler/test_convop.rs
tests/test_compiler/test_convop.rs
+0
-2
tests/test_compiler/test_exception.rs
tests/test_compiler/test_exception.rs
+0
-4
tests/test_compiler/test_floatingpoint.rs
tests/test_compiler/test_floatingpoint.rs
+0
-1
tests/test_compiler/test_opt.rs
tests/test_compiler/test_opt.rs
+0
-6
No files found.
src/compiler/backend/reg_alloc/graph_coloring/liveness.rs
View file @
c95b39a4
...
...
@@ -249,10 +249,8 @@ impl InterferenceGraph {
}
/// prints current graph for debugging (via trace log)
#[allow(unused_variables)]
pub
fn
print
(
&
self
,
context
:
&
FunctionContext
)
{
use
compiler
::
backend
::
reg_alloc
::
graph_coloring
::
petgraph
::
dot
::
Dot
;
use
compiler
::
backend
::
reg_alloc
::
graph_coloring
::
petgraph
::
dot
::
Config
;
trace!
(
""
);
trace!
(
"Interference Graph"
);
...
...
src/compiler/passes/trace_gen.rs
View file @
c95b39a4
...
...
@@ -509,7 +509,9 @@ fn branch_adjustment(func: &mut MuFunctionVersion, vm: &VM) {
new_body
.push
(
new_cond_branch
);
// add new false block to trace (immediate after this block)
if
let
Some
(
next_block_index
)
=
next_block_in_trace
{
if
let
Some
(
next_block
)
=
next_block_in_trace
{
let
next_block_index
=
trace
.iter
()
.position
(|
x
|
*
x
==
next_block
)
.unwrap
();
trace
.insert
(
next_block_index
,
new_false_block
.id
());
}
else
{
trace
.push
(
new_false_block
.id
());
...
...
tests/ir_macros.rs
View file @
c95b39a4
...
...
@@ -930,7 +930,6 @@ macro_rules! emit_test {
);
consta!
((
$vm
,
$tester_name
)
int64_pass_local
=
int64_pass
);
consta!
((
$vm
,
$tester_name
)
int64_fail_local
=
int64_fail
);
inst!
((
$vm
,
$tester_name
)
blk_entry_inst_ret
:
SET_RETVAL
int64_pass_local
...
...
tests/test_compiler/test_binop.rs
View file @
c95b39a4
...
...
@@ -26,7 +26,6 @@ use mu::utils::LinkedHashMap;
use
std
::
sync
::
Arc
;
use
self
::
mu
::
linkutils
::
aot
;
use
self
::
mu
::
runtime
::
thread
::
check_result
;
use
self
::
mu
::
compiler
::
*
;
use
std
::
u64
;
...
...
tests/test_compiler/test_controlflow.rs
View file @
c95b39a4
...
...
@@ -24,7 +24,6 @@ use mu::utils::LinkedHashMap;
use
std
::
sync
::
Arc
;
use
mu
::
linkutils
::
aot
;
use
mu
::
runtime
::
thread
::
check_result
;
use
mu
::
compiler
::
*
;
#[test]
...
...
@@ -1155,3 +1154,119 @@ fn branch2_high_prob_branch_cannot_fallthrough() -> VM {
vm
}
#[test]
fn
test_branch_adjust_follow_by_neither
()
{
VM
::
start_logging_trace
();
linkutils
::
aot
::
compile_fnc
(
"branch_adjust_follow_by_neither"
,
&
branch_adjust_follow_by_neither
);
}
fn
branch_adjust_follow_by_neither
()
->
VM
{
let
vm
=
VM
::
new
();
typedef!
((
vm
)
int64
=
mu_int
(
64
));
typedef!
((
vm
)
int1
=
mu_int
(
1
));
constdef!
((
vm
)
<
int64
>
int64_0
=
Constant
::
Int
(
0
));
constdef!
((
vm
)
<
int64
>
int64_1
=
Constant
::
Int
(
1
));
funcsig!
((
vm
)
sig
=
()
->
(
int64
));
funcdecl!
((
vm
)
<
sig
>
branch_adjust_follow_by_neither
);
funcdef!
((
vm
)
<
sig
>
branch_adjust_follow_by_neither
VERSION
branch_adjust_follow_by_neither_v1
);
// blk_entry
block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_entry
);
block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_jmp
);
// BRANCH blk_jmp
inst!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_entry_branch
:
BRANCH
blk_jmp
()
);
define_block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_entry
()
{
blk_entry_branch
});
// blk_jmp
// BRANCH blk_check0 (1)
consta!
((
vm
,
branch_adjust_follow_by_neither_v1
)
int64_0_local
=
int64_0
);
consta!
((
vm
,
branch_adjust_follow_by_neither_v1
)
int64_1_local
=
int64_1
);
block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_check0
);
inst!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_jmp_branch
:
BRANCH
blk_check0
(
int64_1_local
)
);
define_block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_jmp
()
{
blk_jmp_branch
});
// blk_check0(a)
ssa!
((
vm
,
branch_adjust_follow_by_neither_v1
)
<
int64
>
a
);
// cond = EQ a 0
ssa!
((
vm
,
branch_adjust_follow_by_neither_v1
)
<
int1
>
cond
);
inst!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_check0_eq
:
cond
=
CMPOP
(
CmpOp
::
EQ
)
a
int64_0_local
);
// BRANCH2 cond TRUE: blk_ret0 () FALSE: blk_check1 (0)
block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_ret0
);
block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_check1
);
inst!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_check0_branch2
:
BRANCH2
(
cond
,
int64_0_local
)
IF
(
OP
0
)
THEN
blk_ret0
(
vec!
[])
WITH
0.6f32
,
ELSE
blk_check1
(
vec!
[
1
])
);
define_block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_check0
(
a
)
{
blk_check0_eq
,
blk_check0_branch2
});
// blk_check1(b)
ssa!
((
vm
,
branch_adjust_follow_by_neither_v1
)
<
int64
>
b
);
// cond = EQ b 1
ssa!
((
vm
,
branch_adjust_follow_by_neither_v1
)
<
int1
>
cond2
);
inst!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_check1_eq
:
cond2
=
CMPOP
(
CmpOp
::
EQ
)
b
int64_1_local
);
// BRANCH2 cond2 TRUE: blk_ret1() FALSE: blk_jmp
inst!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_check1_branch2
:
BRANCH2
(
cond2
)
IF
(
OP
0
)
THEN
blk_ret0
(
vec!
[])
WITH
0.4f32
,
ELSE
blk_jmp
(
vec!
[])
);
define_block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_check1
(
b
)
{
blk_check1_eq
,
blk_check1_branch2
});
// blk_ret0
inst!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_ret0_ret
:
RET
(
int64_0_local
)
);
define_block!
((
vm
,
branch_adjust_follow_by_neither_v1
)
blk_ret0
()
{
blk_ret0_ret
});
define_func_ver!
((
vm
)
branch_adjust_follow_by_neither_v1
(
entry
:
blk_entry
)
{
blk_entry
,
blk_jmp
,
blk_check0
,
blk_check1
,
blk_ret0
});
vm
}
tests/test_compiler/test_convop.rs
View file @
c95b39a4
...
...
@@ -21,12 +21,10 @@ use self::mu::ast::ir::*;
use
self
::
mu
::
ast
::
inst
::
*
;
use
self
::
mu
::
ast
::
op
::
*
;
use
self
::
mu
::
vm
::
*
;
use
self
::
mu
::
linkutils
;
use
mu
::
utils
::
LinkedHashMap
;
use
std
::
sync
::
Arc
;
use
self
::
mu
::
linkutils
::
aot
;
use
self
::
mu
::
runtime
::
thread
::
check_result
;
use
self
::
mu
::
compiler
::
*
;
use
std
::
f32
;
...
...
tests/test_compiler/test_exception.rs
View file @
c95b39a4
...
...
@@ -23,11 +23,7 @@ use mu::vm::*;
use
mu
::
compiler
::
*
;
use
mu
::
utils
::
LinkedHashMap
;
use
mu
::
linkutils
;
use
mu
::
linkutils
::
aot
;
use
test_compiler
::
test_call
::
gen_ccall_exit
;
use
std
::
sync
::
Arc
;
#[test]
...
...
tests/test_compiler/test_floatingpoint.rs
View file @
c95b39a4
...
...
@@ -26,7 +26,6 @@ use mu::utils::LinkedHashMap;
use
std
::
sync
::
Arc
;
use
mu
::
linkutils
::
aot
;
use
mu
::
runtime
::
thread
::
check_result
;
use
mu
::
compiler
::
*
;
#[test]
...
...
tests/test_compiler/test_opt.rs
View file @
c95b39a4
...
...
@@ -14,17 +14,11 @@
extern
crate
libloading
;
use
mu
::
ast
::
types
::
*
;
use
mu
::
ast
::
ir
::
*
;
use
mu
::
ast
::
ptr
::
*
;
use
mu
::
ast
::
inst
::
*
;
use
mu
::
ast
::
op
::
*
;
use
mu
::
vm
::
*
;
use
mu
::
compiler
::
*
;
use
std
::
sync
::
Arc
;
use
mu
::
linkutils
;
use
mu
::
linkutils
::
aot
;
use
mu
::
utils
::
LinkedHashMap
;
#[test]
...
...
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