From f805153a25b00d12072bd728e91bb1621bfcf1b1 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Fri, 19 Jun 2020 11:48:22 -0700 Subject: [PATCH] Fix regression that omitted -DNDEBUG in opt builds after toolchain refactoring. Not adding -DNDEBUG leads to enabling assertions which makes LLVM often 10x slower. PiperOrigin-RevId: 317349500 Change-Id: I52df6ab5013ad5a02101dd96f18220e054c3e94c --- third_party/gpus/crosstool/cc_toolchain_config.bzl.tpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/third_party/gpus/crosstool/cc_toolchain_config.bzl.tpl b/third_party/gpus/crosstool/cc_toolchain_config.bzl.tpl index 082ed950b04..eb320a94201 100644 --- a/third_party/gpus/crosstool/cc_toolchain_config.bzl.tpl +++ b/third_party/gpus/crosstool/cc_toolchain_config.bzl.tpl @@ -583,7 +583,11 @@ def _features(cpu, compiler, ctx): ), ], ), - feature(name = "opt"), + feature(name = "disable-assertions"), + feature( + name = "opt", + implies = ["disable-assertions"], + ), feature(name = "fastbuild"), feature(name = "dbg"), feature(name = "supports_dynamic_linker", enabled = True),