Clean up post fusion using DCE.

PiperOrigin-RevId: 317349120
Change-Id: I479d9967323d86e924315d2b1302bafd01ed4151
This commit is contained in:
A. Unique TensorFlower 2020-06-19 11:46:26 -07:00 committed by TensorFlower Gardener
parent 02d312b25e
commit 2417a15bf1
2 changed files with 6 additions and 0 deletions

View File

@ -1679,6 +1679,7 @@ cc_library(
hdrs = ["multi_output_fusion.h"],
deps = [
":hlo",
":hlo_dce",
":hlo_pass",
":hlo_reachability",
"//tensorflow/compiler/xla:debug_options_flags",

View File

@ -17,6 +17,7 @@ limitations under the License.
#include "absl/container/flat_hash_set.h"
#include "tensorflow/compiler/xla/debug_options_flags.h"
#include "tensorflow/compiler/xla/service/hlo_dce.h"
#include "tensorflow/compiler/xla/service/hlo_instruction.h"
#include "tensorflow/compiler/xla/service/hlo_opcode.h"
#include "tensorflow/compiler/xla/service/hlo_reachability.h"
@ -126,6 +127,10 @@ StatusOr<bool> MultiOutputFusion::Run(HloModule* module) {
candidates_index_.clear();
all_fusion_candidates_.clear();
reachability_.reset();
if (changed) {
HloDCE dce;
TF_RETURN_IF_ERROR(dce.Run(module).status());
}
return changed;
}