File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 15
15
// ===----------------------------------------------------------------------===//
16
16
17
17
#include " llvm/SYCLLowerIR/LocalAccessorToSharedMemory.h"
18
+ #include " llvm/ADT/SmallSet.h"
18
19
#include " llvm/IR/Constants.h"
19
20
#include " llvm/IR/GlobalValue.h"
20
21
#include " llvm/IR/Instructions.h"
@@ -248,8 +249,12 @@ class LocalAccessorToSharedMemory : public ModulePass {
248
249
if (!NvvmMetadata)
249
250
return ;
250
251
252
+ // It is possible that the annotations node contains multiple pointers to
253
+ // the same metadata, recognise visited ones.
254
+ SmallSet<MDNode *, 4 > Visited;
251
255
for (auto *MetadataNode : NvvmMetadata->operands ()) {
252
- if (MetadataNode->getNumOperands () != 3 )
256
+ Visited.insert (MetadataNode);
257
+ if (Visited.contains (MetadataNode) || MetadataNode->getNumOperands () != 3 )
253
258
continue ;
254
259
255
260
// NVPTX identifies kernel entry points using metadata nodes of the form:
You can’t perform that action at this time.
0 commit comments