diff --git a/tensorflow/compiler/xla/service/hlo_pass_pipeline.cc b/tensorflow/compiler/xla/service/hlo_pass_pipeline.cc index afc4d3733c8..119e2d79022 100644 --- a/tensorflow/compiler/xla/service/hlo_pass_pipeline.cc +++ b/tensorflow/compiler/xla/service/hlo_pass_pipeline.cc @@ -64,8 +64,7 @@ StatusOr HloPassPipeline::Run(HloModule* module) { bool changed = false; string message; for (auto& pass : passes_) { - if (!disabled_passes.empty() && - disabled_passes.count(pass->name().ToString()) > 0) { + if (disabled_passes.count(pass->name().ToString()) > 0) { VLOG(1) << " Skipping HLO pass " << pass->name() << ", disabled by --xla_disable_hlo_passes"; continue; diff --git a/tensorflow/compiler/xla/tests/convert_test.cc b/tensorflow/compiler/xla/tests/convert_test.cc index f6178608c89..6d379797250 100644 --- a/tensorflow/compiler/xla/tests/convert_test.cc +++ b/tensorflow/compiler/xla/tests/convert_test.cc @@ -38,8 +38,8 @@ class ConvertTest : public ClientLibraryTestBase { public: explicit ConvertTest(perftools::gputools::Platform* platform = nullptr) : ClientLibraryTestBase(platform) { - mutable_debug_options()->mutable_xla_disable_hlo_passes()->Add("algsimp"); - mutable_debug_options()->mutable_xla_disable_hlo_passes()->Add("inline"); + mutable_debug_options()->add_xla_disable_hlo_passes("algsimp"); + mutable_debug_options()->add_xla_disable_hlo_passes("inline"); } }; diff --git a/tensorflow/compiler/xla/tests/map_test.cc b/tensorflow/compiler/xla/tests/map_test.cc index 6c82460c7c4..e4dbd6864a3 100644 --- a/tensorflow/compiler/xla/tests/map_test.cc +++ b/tensorflow/compiler/xla/tests/map_test.cc @@ -43,8 +43,8 @@ class MapTest : public ClientLibraryTestBase { public: explicit MapTest(perftools::gputools::Platform* platform = nullptr) : ClientLibraryTestBase(platform) { - mutable_debug_options()->mutable_xla_disable_hlo_passes()->Add("algsimp"); - mutable_debug_options()->mutable_xla_disable_hlo_passes()->Add("inline"); + mutable_debug_options()->add_xla_disable_hlo_passes("algsimp"); + mutable_debug_options()->add_xla_disable_hlo_passes("inline"); } // Creates a function that adds its scalar argument with the constant 1.0. diff --git a/tensorflow/compiler/xla/tests/vector_ops_simple_test.cc b/tensorflow/compiler/xla/tests/vector_ops_simple_test.cc index a41c2797bf6..efde45375fd 100644 --- a/tensorflow/compiler/xla/tests/vector_ops_simple_test.cc +++ b/tensorflow/compiler/xla/tests/vector_ops_simple_test.cc @@ -43,8 +43,8 @@ class VecOpsSimpleTest : public ClientLibraryTestBase { public: explicit VecOpsSimpleTest(perftools::gputools::Platform* platform = nullptr) : ClientLibraryTestBase(platform) { - mutable_debug_options()->mutable_xla_disable_hlo_passes()->Add("algsimp"); - mutable_debug_options()->mutable_xla_disable_hlo_passes()->Add("inline"); + mutable_debug_options()->add_xla_disable_hlo_passes("algsimp"); + mutable_debug_options()->add_xla_disable_hlo_passes("inline"); } ErrorSpec error_spec_{0.0001};