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
0ebe4abe
Commit
0ebe4abe
authored
Mar 14, 2019
by
Khalique
Browse files
further simplifying
parent
5e60e66b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
12 deletions
+2
-12
src/eliminate_identity.cpp
src/eliminate_identity.cpp
+2
-12
No files found.
src/eliminate_identity.cpp
View file @
0ebe4abe
...
...
@@ -14,18 +14,8 @@ void eliminate_identity::apply(program& p) const
{
for
(
auto
ins
:
iterator_for
(
p
))
{
std
::
vector
<
instruction_ref
>
new_ins_inputs
=
ins
->
inputs
();
// check each input arg for identity ops,
// replace with the input of the respective identity
for
(
instruction_ref
&
input
:
new_ins_inputs
)
{
if
(
input
->
name
()
==
"identity"
)
{
input
=
input
->
inputs
().
at
(
0
);
}
}
if
(
new_ins_inputs
!=
ins
->
inputs
())
p
.
replace_instruction
(
ins
,
ins
->
get_operator
(),
new_ins_inputs
);
if
(
ins
->
name
()
==
"identity"
)
p
.
replace_instruction
(
ins
,
ins
->
inputs
().
front
());
}
}
...
...
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