Skip to content

Commit

Permalink
[SYCL] Add sanity checks for spec constant metadata (#15420)
Browse files Browse the repository at this point in the history
Follow up from #15346.

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
  • Loading branch information
sarnex authored Sep 18, 2024
1 parent 9e39902 commit b65c3ed
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 b65c3ed

Please sign in to comment.