diff --git a/llvm/lib/SYCLLowerIR/ComputeModuleRuntimeInfo.cpp b/llvm/lib/SYCLLowerIR/ComputeModuleRuntimeInfo.cpp index 0bfcd53784af3..5f7678313087d 100644 --- a/llvm/lib/SYCLLowerIR/ComputeModuleRuntimeInfo.cpp +++ b/llvm/lib/SYCLLowerIR/ComputeModuleRuntimeInfo.cpp @@ -161,8 +161,18 @@ PropSetRegTy computeModuleProperties(const Module &M, std::vector DefaultValues; SpecConstantsPass::collectSpecConstantDefaultValuesMetadata(M, DefaultValues); + assert(!DefaultValues.empty() && + "Expected metadata for spec constant defaults."); PropSet.add(PropSetRegTy::SYCL_SPEC_CONSTANTS_DEFAULT_VALUES, "all", DefaultValues); + } else { +#ifndef NDEBUG + std::vector DefaultValues; + SpecConstantsPass::collectSpecConstantDefaultValuesMetadata(M, + DefaultValues); + assert(DefaultValues.empty() && + "Unexpected metadata for spec constant defaults."); +#endif } if (GlobProps.EmitKernelParamInfo) { // extract kernel parameter optimization info per module