Skip to content

Commit

Permalink
Fix static analyzer issues (intel#1864)
Browse files Browse the repository at this point in the history
Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@32721e8
  • Loading branch information
asudarsa authored and FreddyLeaf committed Mar 22, 2023
1 parent 30f5b3b commit 4ce748e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm-spirv/lib/SPIRV/OCLToSPIRV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,9 @@ void OCLToSPIRVBase::visitSubgroupAVCBuiltinCallWithSampler(
return; // this is not a VME built-in

SmallVector<Type *, 4> ParamTys;
getParameterTypes(CI->getCalledFunction(), ParamTys);
[[maybe_unused]] bool DidDemangle =
getParameterTypes(CI->getCalledFunction(), ParamTys);
assert(DidDemangle && "Expected SPIR-V builtins to be properly mangled");
auto *TyIt = std::find_if(ParamTys.begin(), ParamTys.end(), isSamplerTy);
assert(TyIt != ParamTys.end() && "Invalid Subgroup AVC Intel built-in call");
unsigned SamplerIndex = TyIt - ParamTys.begin();
Expand Down

0 comments on commit 4ce748e

Please sign in to comment.