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
7013e195
Commit
7013e195
authored
Jul 14, 2022
by
charlie
Browse files
Comment fix
parent
79c38ace
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/dead_code_elimination.cpp
src/dead_code_elimination.cpp
+4
-2
No files found.
src/dead_code_elimination.cpp
View file @
7013e195
...
...
@@ -48,9 +48,11 @@ void dead_code_elimination::apply(module& m) const
// Skip the last instruction
if
(
i
==
last
)
break
;
// Skip instruction with empty shape as output unless its a builtin or undefined or identity
// Skip instruction with empty shape as output unless its [dynamic, builtin, undefined,
// identity, allocate]
if
((
not
i
->
get_shape
().
dynamic
()
and
i
->
get_shape
().
elements
()
==
0
)
and
i
->
name
().
front
()
!=
'@'
and
not
contains
({
"undefined"
,
"identity"
,
"allocate"
},
i
->
name
()))
i
->
name
().
front
()
!=
'@'
and
not
contains
({
"undefined"
,
"identity"
,
"allocate"
},
i
->
name
()))
continue
;
assert
(
std
::
distance
(
m
.
begin
(),
i
)
<=
std
::
distance
(
m
.
begin
(),
last
));
std
::
unordered_set
<
instruction_ref
>
visited
;
...
...
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