aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_ordering_test.cc
diff options
context:
space:
mode:
authorGravatar Mark Heffernan <meheff@google.com>2017-09-18 23:34:22 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-09-18 23:37:38 -0700
commit23da21150d988f7cf5780488f24adbb116675586 (patch)
tree916db234da382bf5cf2815f913ee5c358c720be5 /tensorflow/compiler/xla/service/hlo_ordering_test.cc
parentf08ec5722b68da94cf7bea1186337f82620fe60e (diff)
Add liveness_util functions which use dataflow analysis. Also make the analysis argument (TuplePointsToAnalysis or HloDataflowAnalysis) non-optional as all callers were passing in the analysis.
PiperOrigin-RevId: 169200824
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_ordering_test.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_ordering_test.cc35
1 files changed, 19 insertions, 16 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_ordering_test.cc b/tensorflow/compiler/xla/service/hlo_ordering_test.cc
index dbd63eceed..33bafd05c1 100644
--- a/tensorflow/compiler/xla/service/hlo_ordering_test.cc
+++ b/tensorflow/compiler/xla/service/hlo_ordering_test.cc
@@ -269,29 +269,32 @@ TEST_F(HloOrderingTest, ValuesInWhileComputations) {
// while because of the use of the init value in the add.
EXPECT_TRUE(ordering.IsDefinedBefore(dataflow->GetValueDefinedAt(constant),
dataflow->GetValueDefinedAt(xla_while)));
- EXPECT_FALSE(
- ordering.LiveRangeStrictlyBefore(dataflow->GetValueDefinedAt(constant),
- dataflow->GetValueDefinedAt(xla_while)));
+ EXPECT_FALSE(ordering.LiveRangeStrictlyBefore(
+ dataflow->GetValueDefinedAt(constant),
+ dataflow->GetValueDefinedAt(xla_while), *dataflow));
EXPECT_TRUE(ordering.MayInterfere(dataflow->GetValueDefinedAt(constant),
- dataflow->GetValueDefinedAt(xla_while)));
+ dataflow->GetValueDefinedAt(xla_while),
+ *dataflow));
// Any value defined in the body or condition is defined before the while, and
// has a live range strictly before the while.
EXPECT_TRUE(ordering.IsDefinedBefore(dataflow->GetValueDefinedAt(negate),
dataflow->GetValueDefinedAt(xla_while)));
- EXPECT_TRUE(
- ordering.LiveRangeStrictlyBefore(dataflow->GetValueDefinedAt(negate),
- dataflow->GetValueDefinedAt(xla_while)));
+ EXPECT_TRUE(ordering.LiveRangeStrictlyBefore(
+ dataflow->GetValueDefinedAt(negate),
+ dataflow->GetValueDefinedAt(xla_while), *dataflow));
EXPECT_FALSE(ordering.MayInterfere(dataflow->GetValueDefinedAt(negate),
- dataflow->GetValueDefinedAt(xla_while)));
+ dataflow->GetValueDefinedAt(xla_while),
+ *dataflow));
EXPECT_TRUE(ordering.IsDefinedBefore(dataflow->GetValueDefinedAt(convert),
dataflow->GetValueDefinedAt(xla_while)));
- EXPECT_TRUE(
- ordering.LiveRangeStrictlyBefore(dataflow->GetValueDefinedAt(convert),
- dataflow->GetValueDefinedAt(xla_while)));
+ EXPECT_TRUE(ordering.LiveRangeStrictlyBefore(
+ dataflow->GetValueDefinedAt(convert),
+ dataflow->GetValueDefinedAt(xla_while), *dataflow));
EXPECT_FALSE(ordering.MayInterfere(dataflow->GetValueDefinedAt(convert),
- dataflow->GetValueDefinedAt(xla_while)));
+ dataflow->GetValueDefinedAt(xla_while),
+ *dataflow));
// The live range of the while should be before the add.
EXPECT_TRUE(ordering.IsDefinedBefore(dataflow->GetValueDefinedAt(xla_while),
@@ -301,10 +304,10 @@ TEST_F(HloOrderingTest, ValuesInWhileComputations) {
const HloUse& while_use = dataflow->GetValueDefinedAt(xla_while).uses()[0];
EXPECT_EQ(while_use.instruction, add);
EXPECT_TRUE(ordering.UseIsBeforeValueDefinition(
- while_use, dataflow->GetValueDefinedAt(add)));
- EXPECT_TRUE(
- ordering.LiveRangeStrictlyBefore(dataflow->GetValueDefinedAt(xla_while),
- dataflow->GetValueDefinedAt(add)));
+ while_use, dataflow->GetValueDefinedAt(add), *dataflow));
+ EXPECT_TRUE(ordering.LiveRangeStrictlyBefore(
+ dataflow->GetValueDefinedAt(xla_while), dataflow->GetValueDefinedAt(add),
+ *dataflow));
}
} // namespace