diff --git a/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h b/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h --- a/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h +++ b/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h @@ -163,7 +163,7 @@ /// Combined layout spec at the given scope. const DataLayoutSpecInterface originalLayout; -#ifndef NDEBUG +#if LLVM_ENABLE_ABI_BREAKING_CHECKS /// List of enclosing layout specs. SmallVector layoutStack; #endif diff --git a/mlir/lib/Interfaces/DataLayoutInterfaces.cpp b/mlir/lib/Interfaces/DataLayoutInterfaces.cpp --- a/mlir/lib/Interfaces/DataLayoutInterfaces.cpp +++ b/mlir/lib/Interfaces/DataLayoutInterfaces.cpp @@ -269,7 +269,7 @@ mlir::DataLayout::DataLayout(DataLayoutOpInterface op) : originalLayout(getCombinedDataLayout(op)), scope(op) { -#ifndef NDEBUG +#if LLVM_ENABLE_ABI_BREAKING_CHECKS checkMissingLayout(originalLayout, op); collectParentLayouts(op, layoutStack); #endif @@ -277,7 +277,7 @@ mlir::DataLayout::DataLayout(ModuleOp op) : originalLayout(getCombinedDataLayout(op)), scope(op) { -#ifndef NDEBUG +#if LLVM_ENABLE_ABI_BREAKING_CHECKS checkMissingLayout(originalLayout, op); collectParentLayouts(op, layoutStack); #endif @@ -297,7 +297,7 @@ } void mlir::DataLayout::checkValid() const { -#ifndef NDEBUG +#if LLVM_ENABLE_ABI_BREAKING_CHECKS SmallVector specs; collectParentLayouts(scope, specs); assert(specs.size() == layoutStack.size() &&