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
84714596
"vscode:/vscode.git/clone" did not exist on "6d92959ad3642754d0f6de85388a922d33651578"
Commit
84714596
authored
Jul 09, 2018
by
Paul
Browse files
Formatting
parent
e2de3cc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/program.cpp
src/program.cpp
+2
-1
test/dead_code_elimination_test.cpp
test/dead_code_elimination_test.cpp
+2
-2
No files found.
src/program.cpp
View file @
84714596
...
@@ -62,7 +62,8 @@ instruction_ref program::remove_instruction(instruction_ref ins)
...
@@ -62,7 +62,8 @@ instruction_ref program::remove_instruction(instruction_ref ins)
instruction_ref
program
::
remove_instructions
(
instruction_ref
first
,
instruction_ref
last
)
instruction_ref
program
::
remove_instructions
(
instruction_ref
first
,
instruction_ref
last
)
{
{
if
(
first
==
last
)
return
first
;
if
(
first
==
last
)
return
first
;
// TODO: Check every element
// TODO: Check every element
assert
(
has_instruction
(
first
));
assert
(
has_instruction
(
first
));
std
::
for_each
(
first
,
last
,
[
&
](
instruction
&
ins
)
{
ins
.
clear_arguments
();
});
std
::
for_each
(
first
,
last
,
[
&
](
instruction
&
ins
)
{
ins
.
clear_arguments
();
});
...
...
test/dead_code_elimination_test.cpp
View file @
84714596
...
@@ -66,8 +66,8 @@ void depth_test()
...
@@ -66,8 +66,8 @@ void depth_test()
auto
one
=
p
.
add_literal
(
1
);
auto
one
=
p
.
add_literal
(
1
);
auto
two
=
p
.
add_literal
(
2
);
auto
two
=
p
.
add_literal
(
2
);
auto
x1
=
p
.
add_instruction
(
sum_op
{},
one
,
two
);
auto
x1
=
p
.
add_instruction
(
sum_op
{},
one
,
two
);
auto
x2
=
p
.
add_instruction
(
sum_op
{},
one
,
two
);
auto
x2
=
p
.
add_instruction
(
sum_op
{},
one
,
two
);
p
.
add_instruction
(
minus_op
{},
x1
,
x2
);
p
.
add_instruction
(
minus_op
{},
x1
,
x2
);
p
.
add_instruction
(
minus_op
{},
x1
,
x2
);
p
.
add_instruction
(
minus_op
{},
x1
,
x2
);
p
.
add_instruction
(
sum_op
{},
one
,
two
);
p
.
add_instruction
(
sum_op
{},
one
,
two
);
...
...
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