Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/lib/Target/NVPTX/SYCL/GlobalOffset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ class GlobalOffset : public ModulePass {
continue;

// Get a pointer to the entry point function from the metadata.
auto FuncConstant =
dyn_cast<ConstantAsMetadata>(MetadataNode->getOperand(0));
const auto &FuncOperand = MetadataNode->getOperand(0);
if (!FuncOperand)
continue;
auto FuncConstant = dyn_cast<ConstantAsMetadata>(FuncOperand);
if (!FuncConstant)
continue;
auto Func = dyn_cast<Function>(FuncConstant->getValue());
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Target/NVPTX/SYCL/LocalAccessorToSharedMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class LocalAccessorToSharedMemory : public ModulePass {

// Get a pointer to the entry point function from the metadata.
const MDOperand &FuncOperand = MetadataNode->getOperand(0);
if (!FuncOperand)
continue;
auto FuncConstant = dyn_cast<ConstantAsMetadata>(FuncOperand);
if (!FuncConstant)
continue;
Expand Down