Skip to content

Commit

Permalink
[SYCL] Add sanity checks for spec constant metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
  • Loading branch information
sarnex committed Sep 17, 2024
1 parent 7989104 commit 17f467b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions llvm/lib/SYCLLowerIR/ComputeModuleRuntimeInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,18 @@ PropSetRegTy computeModuleProperties(const Module &M,
std::vector<char> 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<char> 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
Expand Down

0 comments on commit 17f467b

Please sign in to comment.