Skip to content

Commit c67d56a

Browse files
Update llvm/tools/sycl-post-link/CUDASpecConstantToSymbol.cpp
Co-authored-by: Alexey Sachkov <[email protected]>
1 parent a972d5b commit c67d56a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/tools/sycl-post-link/CUDASpecConstantToSymbol.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ void CUDASpecConstantToSymbolPass::allocatePerKernelGlobals(NamedMDNode *MD) {
125125
LLVM_DEBUG(llvm::dbgs() << "Working on: " << KernelName << "\n");
126126
unsigned PerKernelSize = 0;
127127
// Loop over all spec constants of a kernel
128-
for (unsigned i = 1; i < Node->getNumOperands(); ++i) {
129-
MDNode *SC = dyn_cast<MDNode>(Node->getOperand(i));
130-
assert(SC && SC->getNumOperands() >= 4 && "Invalid node.");
128+
for (unsigned I = 1; I < Node->getNumOperands(); ++I) {
129+
MDNode *SC = cast<MDNode>(Node->getOperand(I));
130+
assert(SC->getNumOperands() >= 4 && "Invalid node.");
131131
// get the size and offset node to calculate the total size of spec
132132
// constants (size of type + offset in the composite - if any);
133133
PerKernelSize += uintFromMDNode(SC, SC->getNumOperands() - 1);

0 commit comments

Comments
 (0)