Skip to content
Merged
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
13 changes: 4 additions & 9 deletions llvm/lib/Target/NVPTX/NVPTXUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ static void cacheAnnotationFromMD(const MDNode *MetadataNode,
// assert: there can only exist one unique key value pair of
// the form (string key, MDNode node). Operands of such a node
// shall always be unsigned ints.
if (retval.find(Key) == retval.end()) {
readIntVecFromMDNode(VecMd, retval[Key]);
auto [It, Inserted] = retval.try_emplace(Key);
if (Inserted) {
readIntVecFromMDNode(VecMd, It->second);
continue;
}
} else {
Expand Down Expand Up @@ -122,13 +123,7 @@ static void cacheAnnotationFromMD(const Module *m, const GlobalValue *gv) {
if (tmp.empty()) // no annotations for this gv
return;

if (AC.Cache.find(m) != AC.Cache.end())
AC.Cache[m][gv] = std::move(tmp);
else {
global_val_annot_t tmp1;
tmp1[gv] = std::move(tmp);
AC.Cache[m] = std::move(tmp1);
}
AC.Cache[m][gv] = std::move(tmp);
}

static std::optional<unsigned> findOneNVVMAnnotation(const GlobalValue *gv,
Expand Down
Loading