aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_dce.cc
diff options
context:
space:
mode:
authorGravatar Justin Lebar <jlebar@google.com>2017-09-28 23:07:12 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-09-28 23:14:07 -0700
commit9b1b5d85b9ce3c812dc772da1f3f5d09581e5b49 (patch)
tree798207232f7ae8240d5ee2e7f934669ed1318bef /tensorflow/compiler/xla/service/hlo_dce.cc
parent75e07e01a41434fdf40eea6291fe7bc47ad74312 (diff)
[XLA] Make HloComputation::instructions() return a view of HloInstruction*s.
Currently it returns a view of unique_ptr<HloInstruction>s. But the fact that these are unique_ptrs is an implementation detail, and it's ugly to leak it everywhere. PiperOrigin-RevId: 170445375
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_dce.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_dce.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_dce.cc b/tensorflow/compiler/xla/service/hlo_dce.cc
index 5b2c57da4f..d912d2b505 100644
--- a/tensorflow/compiler/xla/service/hlo_dce.cc
+++ b/tensorflow/compiler/xla/service/hlo_dce.cc
@@ -52,11 +52,11 @@ StatusOr<bool> HloDCE::Run(HloModule* module) {
// into a separate list first to avoid problems with iterating through the
// computation's instruction while simultaneously removing instructions.
std::vector<HloInstruction*> dead_roots;
- for (auto& instruction : computation->instructions()) {
+ for (auto* instruction : computation->instructions()) {
if (instruction->user_count() == 0 &&
- live_instructions.count(instruction.get()) == 0 &&
- computation->IsRemovable(instruction.get())) {
- dead_roots.push_back(instruction.get());
+ live_instructions.count(instruction) == 0 &&
+ computation->IsRemovable(instruction)) {
+ dead_roots.push_back(instruction);
}
}