diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-10-30 18:58:48 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-10-30 19:02:27 -0700 |
commit | a4b5356e476016e0f537766ac2ac891eab9900e1 (patch) | |
tree | ac16c36367a3cb7a6c2c570d051886d071357a7d /tensorflow/compiler/xla/service/logical_buffer_analysis.cc | |
parent | bb7ed1c889890ca68f531a3a7b4f56fc55b082df (diff) |
[TF:XLA] Reduce boilerplate code in HLO visitors.
Only pass the HloInstruction into visitor methods. This makes changing
instructions and visitors easier.
PiperOrigin-RevId: 173983398
Diffstat (limited to 'tensorflow/compiler/xla/service/logical_buffer_analysis.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/logical_buffer_analysis.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tensorflow/compiler/xla/service/logical_buffer_analysis.cc b/tensorflow/compiler/xla/service/logical_buffer_analysis.cc index bf3bb2ddf0..b92017c6cb 100644 --- a/tensorflow/compiler/xla/service/logical_buffer_analysis.cc +++ b/tensorflow/compiler/xla/service/logical_buffer_analysis.cc @@ -86,8 +86,7 @@ Status LogicalBufferAnalysis::DefaultAction(HloInstruction* hlo_instruction) { return Status::OK(); } -Status LogicalBufferAnalysis::HandleGetTupleElement( - HloInstruction* get_tuple_element, HloInstruction* operand) { +Status LogicalBufferAnalysis::HandleGetTupleElement(HloInstruction*) { // GetTupleElement does not create buffers. return Status::OK(); } @@ -99,24 +98,19 @@ Status LogicalBufferAnalysis::HandleCopy(HloInstruction* copy) { return Status::OK(); } -Status LogicalBufferAnalysis::HandleBitcast(HloInstruction* bitcast) { +Status LogicalBufferAnalysis::HandleBitcast(HloInstruction*) { // A kBitcast instruction aliases its operand. That is, the buffer of its // result *is* the buffer of its operand. return Status::OK(); } -Status LogicalBufferAnalysis::HandleTuple( - HloInstruction* tuple, - tensorflow::gtl::ArraySlice<HloInstruction*> operands) { +Status LogicalBufferAnalysis::HandleTuple(HloInstruction* tuple) { // A Tuple instruction only creates the top-level buffer. NewLogicalBuffer(tuple, /*index=*/{}); return Status::OK(); } -Status LogicalBufferAnalysis::HandleSelect(HloInstruction* select, - HloInstruction* /*pred*/, - HloInstruction* on_true, - HloInstruction* on_false) { +Status LogicalBufferAnalysis::HandleSelect(HloInstruction* select) { // Select allocates a new buffer and then shallow copies the on_true or // on_false buffer into this new buffer. NewLogicalBuffer(select, /*index=*/{}); |