Clean up post fusion using DCE.
PiperOrigin-RevId: 317349120 Change-Id: I479d9967323d86e924315d2b1302bafd01ed4151
This commit is contained in:
parent
02d312b25e
commit
2417a15bf1
@ -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",
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user