aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/tuple_points_to_analysis.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-07-03 14:07:02 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-03 14:12:38 -0700
commitbdd84aa59d3bdedc42647711e401229f489c7d25 (patch)
tree695399ae3fed6bc65177f38493dee35f5f74e116 /tensorflow/compiler/xla/service/tuple_points_to_analysis.cc
parenta6471888cc9dfe9c18d121149bc0516a3f423fbb (diff)
[TF:XLA] Split select HLO into array- and tuple-select.
Array select and tuple-select already are handled separately in all backends and HLO passes: Array select is an elementwise operation. The shapes of the to operands have the same dimensions. Tuple select does not define its own output, but instead forwards the true- or false- operand based on a scalar predicate operand. This CL reflects this by adding a new kTupleSelect HLO. The XLA builder interface stays the same and dispatches based on the operand shapes. No change in the operation semantics. This CL just splits the existing select operation into two opcodes and preserves the existing semantics. HLO cost analysis is fixed to handle the two ops appropriately. PiperOrigin-RevId: 203180342
Diffstat (limited to 'tensorflow/compiler/xla/service/tuple_points_to_analysis.cc')
-rw-r--r--tensorflow/compiler/xla/service/tuple_points_to_analysis.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/tensorflow/compiler/xla/service/tuple_points_to_analysis.cc b/tensorflow/compiler/xla/service/tuple_points_to_analysis.cc
index a1aa875009..990dfc410c 100644
--- a/tensorflow/compiler/xla/service/tuple_points_to_analysis.cc
+++ b/tensorflow/compiler/xla/service/tuple_points_to_analysis.cc
@@ -399,7 +399,7 @@ Status TuplePointsToAnalysis::HandleTuple(HloInstruction* tuple) {
return Status::OK();
}
-Status TuplePointsToAnalysis::HandleSelect(HloInstruction* select) {
+Status TuplePointsToAnalysis::HandleTupleSelect(HloInstruction* tuple_select) {
// Select allocates a new buffer and then shallow copies the on_true or
// on_false buffer into this new buffer. Which side is chosen cannot be
// determined statically so conservatively set the points-to set to the union
@@ -407,9 +407,9 @@ Status TuplePointsToAnalysis::HandleSelect(HloInstruction* select) {
//
// First create a copy of the on_true points-to set (and tuple sources), then
// add in elements of the on_false points-to set (tuple sources).
- auto on_true = select->operand(1);
- auto on_false = select->operand(2);
- PointsToSet& points_to_set = CreateCopiedPointsToSet(select, on_true);
+ auto on_true = tuple_select->operand(1);
+ auto on_false = tuple_select->operand(2);
+ PointsToSet& points_to_set = CreateCopiedPointsToSet(tuple_select, on_true);
const PointsToSet& false_points_to_set = *PerInst(on_false)->points_to_set;
points_to_set.ForEachMutableElement(
[&](const ShapeIndex& index, PointsToSet::BufferList* buffers) {
@@ -427,7 +427,7 @@ Status TuplePointsToAnalysis::HandleSelect(HloInstruction* select) {
// respective element in the points-to set should contain only itself.
points_to_set.mutable_element({})->clear();
points_to_set.AddPointedToBuffer(
- logical_buffer_analysis_->GetBuffer(select, /*index=*/{}),
+ logical_buffer_analysis_->GetBuffer(tuple_select, /*index=*/{}),
/*index=*/{});
return Status::OK();
}