Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
477e6c47
Commit
477e6c47
authored
Sep 19, 2018
by
mei-ye
Browse files
special treatment for intervals fed into output
parent
633741cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
src/opt/memory_coloring_impl.cpp
src/opt/memory_coloring_impl.cpp
+9
-0
src/opt/memory_coloring_impl.hpp
src/opt/memory_coloring_impl.hpp
+3
-0
No files found.
src/opt/memory_coloring_impl.cpp
View file @
477e6c47
...
...
@@ -83,6 +83,13 @@ bool memory_coloring_impl::allocate(interval_ptr interval)
offset
+=
(
element_size
-
(
offset
%
element_size
));
conflict_queue
.
pop
();
}
#if 1
if
(
interval
->
get_end
()
==
latest_end_point
)
{
offset
=
required_bytes
;
if
((
offset
%
element_size
)
!=
0
)
offset
+=
(
element_size
-
(
offset
%
element_size
));
}
#endif
segment
.
offset
=
offset
;
MIGRAPH_DEBUG
(
segment
.
dump
());
required_bytes
=
std
::
max
(
required_bytes
,
offset
+
segment
.
size
);
...
...
@@ -165,6 +172,8 @@ void memory_coloring_impl::build()
live_set
.
insert
(
max_value_number
);
live_ranges
[
max_value_number
]
=
&
(
interval
->
segment
);
earliest_end_point
=
cur_points
;
if
(
latest_end_point
==
-
1
)
latest_end_point
=
cur_points
;
}
else
{
...
...
src/opt/memory_coloring_impl.hpp
View file @
477e6c47
...
...
@@ -60,6 +60,7 @@ struct memory_coloring_impl
required_bytes
=
0
;
operand_alias
.
clear
();
earliest_end_point
=
-
1
;
latest_end_point
=
-
1
;
}
bool
allocate
(
interval_ptr
);
void
add_conflicts
(
std
::
set
<
int
>&
live_set
,
int
val
)
...
...
@@ -168,6 +169,8 @@ struct memory_coloring_impl
long
long
required_bytes
;
// The earliest program point where an live interval ends.
int
earliest_end_point
;
// The latest program point where an live interval ends.
int
latest_end_point
;
std
::
string
allocation_op
{};
};
}
// namespace migraph
...
...
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