aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Justin Lebar <jlebar@google.com>2017-10-30 19:57:47 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-30 20:01:29 -0700
commit6d1263cdf8ee8323513f984553dbeb070865fd0c (patch)
tree1feeadf12ca9902e8e440daa3ace45cb851f1880
parenta4b5356e476016e0f537766ac2ac891eab9900e1 (diff)
[XLA] Remove dead opcode kIndex.
PiperOrigin-RevId: 173987428
-rw-r--r--tensorflow/compiler/xla/service/hlo_graph_dumper.cc1
-rw-r--r--tensorflow/compiler/xla/service/hlo_instruction.cc3
-rw-r--r--tensorflow/compiler/xla/service/hlo_matchers.h1
-rw-r--r--tensorflow/compiler/xla/service/hlo_opcode.cc3
-rw-r--r--tensorflow/compiler/xla/service/hlo_opcode.h1
-rw-r--r--tensorflow/compiler/xla/service/inliner.cc1
-rw-r--r--tensorflow/compiler/xla/service/instruction_fusion.cc1
-rw-r--r--tensorflow/compiler/xla/service/shape_inference.cc13
-rw-r--r--tensorflow/compiler/xla/service/user_computation.cc2
-rw-r--r--tensorflow/compiler/xla/tools/parser/hlo_parser.cc1
-rw-r--r--tensorflow/compiler/xla/xla_data.proto8
11 files changed, 0 insertions, 35 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_graph_dumper.cc b/tensorflow/compiler/xla/service/hlo_graph_dumper.cc
index 11edf49130..d7bdd4117d 100644
--- a/tensorflow/compiler/xla/service/hlo_graph_dumper.cc
+++ b/tensorflow/compiler/xla/service/hlo_graph_dumper.cc
@@ -849,7 +849,6 @@ ColorScheme HloDotDumper::GetInstructionColor(const HloInstruction* instr) {
case HloOpcode::kGe:
case HloOpcode::kGt:
case HloOpcode::kImag:
- case HloOpcode::kIndex:
case HloOpcode::kIsFinite:
case HloOpcode::kLe:
case HloOpcode::kLog:
diff --git a/tensorflow/compiler/xla/service/hlo_instruction.cc b/tensorflow/compiler/xla/service/hlo_instruction.cc
index 1de4c4a115..b1bfd3e674 100644
--- a/tensorflow/compiler/xla/service/hlo_instruction.cc
+++ b/tensorflow/compiler/xla/service/hlo_instruction.cc
@@ -1164,7 +1164,6 @@ std::unique_ptr<HloInstruction> HloInstruction::CloneWithNewOperands(
break;
case HloOpcode::kRecv:
case HloOpcode::kSend:
- case HloOpcode::kIndex:
case HloOpcode::kTrace:
LOG(FATAL) << "Not yet implemented, clone: " << HloOpcodeString(opcode_);
}
@@ -1551,7 +1550,6 @@ bool HloInstruction::IdenticalSlowPath(
return dimensions() == other.dimensions();
// These opcodes are not yet supported.
- case HloOpcode::kIndex:
case HloOpcode::kInfeed:
case HloOpcode::kOutfeed:
case HloOpcode::kSort:
@@ -2277,7 +2275,6 @@ Status HloInstruction::Visit(DfsHloVisitor* visitor) {
return visitor->HandleRecv(this);
// These opcodes are not handled here.
- case HloOpcode::kIndex:
case HloOpcode::kTrace:
break;
}
diff --git a/tensorflow/compiler/xla/service/hlo_matchers.h b/tensorflow/compiler/xla/service/hlo_matchers.h
index 5440ed2eda..bc5ed029a4 100644
--- a/tensorflow/compiler/xla/service/hlo_matchers.h
+++ b/tensorflow/compiler/xla/service/hlo_matchers.h
@@ -74,7 +74,6 @@ HLO_MATCHER(Fusion);
HLO_MATCHER(Ge);
HLO_MATCHER(GetTupleElement);
HLO_MATCHER(Gt);
-HLO_MATCHER(Index);
HLO_MATCHER(Infeed);
HLO_MATCHER(IsFinite);
HLO_MATCHER(Le);
diff --git a/tensorflow/compiler/xla/service/hlo_opcode.cc b/tensorflow/compiler/xla/service/hlo_opcode.cc
index d94c4da5ea..157d19f5a9 100644
--- a/tensorflow/compiler/xla/service/hlo_opcode.cc
+++ b/tensorflow/compiler/xla/service/hlo_opcode.cc
@@ -95,8 +95,6 @@ string HloOpcodeString(HloOpcode opcode) {
return "greater-than";
case HloOpcode::kImag:
return "imag";
- case HloOpcode::kIndex:
- return "index";
case HloOpcode::kInfeed:
return "infeed";
case HloOpcode::kIsFinite:
@@ -218,7 +216,6 @@ StatusOr<HloOpcode> StringToHloOpcode(const string& opcode_name) {
{"greater-than-or-equal-to", HloOpcode::kGe},
{"get-tuple-element", HloOpcode::kGetTupleElement},
{"greater-than", HloOpcode::kGt},
- {"index", HloOpcode::kIndex},
{"infeed", HloOpcode::kInfeed},
{"is-finite", HloOpcode::kIsFinite},
{"less-than-or-equal-to", HloOpcode::kLe},
diff --git a/tensorflow/compiler/xla/service/hlo_opcode.h b/tensorflow/compiler/xla/service/hlo_opcode.h
index 8090e4c82e..07c2d26f00 100644
--- a/tensorflow/compiler/xla/service/hlo_opcode.h
+++ b/tensorflow/compiler/xla/service/hlo_opcode.h
@@ -61,7 +61,6 @@ enum class HloOpcode {
kGetTupleElement,
kGt,
kImag,
- kIndex,
kInfeed,
kIsFinite,
kLe,
diff --git a/tensorflow/compiler/xla/service/inliner.cc b/tensorflow/compiler/xla/service/inliner.cc
index 9987ab4aee..5c193fceb9 100644
--- a/tensorflow/compiler/xla/service/inliner.cc
+++ b/tensorflow/compiler/xla/service/inliner.cc
@@ -71,7 +71,6 @@ Status InlinerVisitor::HandleMap(HloInstruction* map) {
// profitability model for inlining is defined.
if (hlo_query::AllOperandsAreParameters(root)) {
if (root.opcode() == HloOpcode::kFusion ||
- root.opcode() == HloOpcode::kIndex ||
root.opcode() == HloOpcode::kParameter ||
root.opcode() == HloOpcode::kTrace) {
// Cloning not supported for these instructions.
diff --git a/tensorflow/compiler/xla/service/instruction_fusion.cc b/tensorflow/compiler/xla/service/instruction_fusion.cc
index fae3ca8ad2..0d1b7bc109 100644
--- a/tensorflow/compiler/xla/service/instruction_fusion.cc
+++ b/tensorflow/compiler/xla/service/instruction_fusion.cc
@@ -99,7 +99,6 @@ namespace xla {
case HloOpcode::kDot:
case HloOpcode::kExp:
case HloOpcode::kFusion:
- case HloOpcode::kIndex:
case HloOpcode::kLog:
case HloOpcode::kMap:
case HloOpcode::kParameter:
diff --git a/tensorflow/compiler/xla/service/shape_inference.cc b/tensorflow/compiler/xla/service/shape_inference.cc
index 0458932a73..791d17365b 100644
--- a/tensorflow/compiler/xla/service/shape_inference.cc
+++ b/tensorflow/compiler/xla/service/shape_inference.cc
@@ -97,8 +97,6 @@ BinaryOperation OpcodeToBinaryOperation(HloOpcode opcode) {
return BINOP_ADD;
case HloOpcode::kSubtract:
return BINOP_SUB;
- case HloOpcode::kIndex:
- return BINOP_INDEX;
case HloOpcode::kDivide:
return BINOP_DIV;
case HloOpcode::kEq:
@@ -830,17 +828,6 @@ ShapeInference::InferDegenerateDimensionBroadcastShape(
broadcast_dimensions));
return ShapeUtil::ChangeElementType(shape, PRED);
}
- case BINOP_INDEX:
- if (ShapeUtil::Rank(lhs) > 0 && ShapeUtil::Rank(rhs) == 0) {
- tensorflow::gtl::ArraySlice<int64> dimensions =
- AsInt64Slice(lhs.dimensions());
- dimensions.pop_front();
- return ShapeUtil::MakeShape(lhs.element_type(), dimensions);
- }
- return Unimplemented("cannot infer shape for operation: %s <%s> %s",
- ShapeUtil::HumanString(lhs).c_str(),
- BinaryOperation_Name(operation).c_str(),
- ShapeUtil::HumanString(rhs).c_str());
default:
return Unimplemented(
"not yet implemented; infer binary op shape: %s; lhs: %s; rhs: %s",
diff --git a/tensorflow/compiler/xla/service/user_computation.cc b/tensorflow/compiler/xla/service/user_computation.cc
index 0bdeffaf25..006c814996 100644
--- a/tensorflow/compiler/xla/service/user_computation.cc
+++ b/tensorflow/compiler/xla/service/user_computation.cc
@@ -96,8 +96,6 @@ HloOpcode BinaryOperationToHloOpcode(BinaryOperation binop) {
return HloOpcode::kAdd;
case BINOP_SUB:
return HloOpcode::kSubtract;
- case BINOP_INDEX:
- return HloOpcode::kIndex;
case BINOP_DIV:
return HloOpcode::kDivide;
case BINOP_EQ:
diff --git a/tensorflow/compiler/xla/tools/parser/hlo_parser.cc b/tensorflow/compiler/xla/tools/parser/hlo_parser.cc
index 7c1eaa9f7f..5dd8ec6636 100644
--- a/tensorflow/compiler/xla/tools/parser/hlo_parser.cc
+++ b/tensorflow/compiler/xla/tools/parser/hlo_parser.cc
@@ -405,7 +405,6 @@ bool HloParser::ParseInstruction(HloComputation::Builder* builder,
case HloOpcode::kInfeed:
case HloOpcode::kOutfeed:
case HloOpcode::kBatchNormGrad:
- case HloOpcode::kIndex:
case HloOpcode::kTrace:
return TokenError(StrCat("parsing not yet implemented for op: ",
HloOpcodeString(opcode)));
diff --git a/tensorflow/compiler/xla/xla_data.proto b/tensorflow/compiler/xla/xla_data.proto
index 2a8dc682a1..080e3c4267 100644
--- a/tensorflow/compiler/xla/xla_data.proto
+++ b/tensorflow/compiler/xla/xla_data.proto
@@ -700,14 +700,6 @@ enum BinaryOperation {
// Dot product, matrix multiply.
BINOP_DOT = 12;
- // Indexes into the LHS with the RHS.
- //
- // If the RHS is higher-rank, this is a gather operation.
- //
- // Note: currently out of bounds indices may crash the underlying XLA
- // machine.
- BINOP_INDEX = 13;
-
// Element-wise maximum.
BINOP_MAX = 14;