@@ -953,46 +953,5 @@ TEST_F(WhileLoopAnalysisTest,
953953 EXPECT_EQ (trip_count, std::nullopt );
954954}
955955
956- TEST_F (WhileLoopAnalysisTest, GetIndvarIndexShouldWorkWhenParamIsCopied) {
957- const char * hlo = R"(
958- HloModule test
959-
960- fused_copy {
961- param.1 = (s32[],s32[]) parameter(0)
962- ROOT copy = (s32[], s32[]) copy(param.1)
963- }
964-
965- body {
966- param.1 = (s32[], s32[]) parameter(0)
967- copy_fusion = (s32[], s32[]) fusion(param.1), kind=kInput, calls=fused_copy
968- iter.1 = s32[] get-tuple-element(copy_fusion), index=0
969- c.1 = s32[] constant(1)
970- add.1 = s32[] add(iter.1, c.1)
971- data.1 = s32[] get-tuple-element(copy_fusion), index=1
972- ROOT tuple = (s32[], s32[]) tuple(add.1, data.1)
973- }
974-
975- condition {
976- param = (s32[], s32[]) parameter(0)
977- iter = s32[] get-tuple-element(param), index=0
978- c.10 = s32[] constant(10)
979- ROOT compare = pred[] compare(iter, c.10), direction=LT
980- }
981-
982- ENTRY main {
983- c0 = s32[] constant(0)
984- data = s32[] parameter(0)
985- tuple = (s32[], s32[]) tuple(c0, data)
986- ROOT while = (s32[], s32[]) while(tuple), body=body, condition=condition
987- }
988- )" ;
989-
990- TF_ASSERT_OK_AND_ASSIGN (std::unique_ptr<HloModule> m,
991- ParseAndReturnVerifiedModule (hlo));
992- HloInstruction* while_op = m->entry_computation ()->root_instruction ();
993- ASSERT_EQ (while_op->opcode (), HloOpcode::kWhile );
994- EXPECT_EQ (GetLoopInductionVarTupleIdx (while_op), 0 );
995- }
996-
997956} // namespace
998957} // namespace xla
0 commit comments