[PATCH] D133292: [Assignment Tracking][9/*] Don't drop DIAssignID in dropUnknownNonDebugMetadata
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 9 03:01:44 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG02f50d05d5fe: [Assignment Tracking][9/*] Don't drop DIAssignID in dropUnknownNonDebugMetadata (authored by Orlando).
Changed prior to commit:
https://reviews.llvm.org/D133292?vs=458710&id=474212#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133292/new/
https://reviews.llvm.org/D133292
Files:
llvm/lib/IR/Metadata.cpp
llvm/unittests/IR/DebugInfoTest.cpp
Index: llvm/unittests/IR/DebugInfoTest.cpp
===================================================================
--- llvm/unittests/IR/DebugInfoTest.cpp
+++ llvm/unittests/IR/DebugInfoTest.cpp
@@ -665,6 +665,17 @@
EXPECT_EQ(NewID0, NewID1);
EXPECT_EQ(Markers[0]->getAssignID(), NewID0);
}
+
+ // Test 5 - dropUnknownNonDebugMetadata.
+ //
+ // Input store0->dropUnknownNonDebugMetadata()
+ // ----- -------------------------
+ // store0 !x store0 !x
+ {
+ Stores[0]->dropUnknownNonDebugMetadata();
+ Metadata *NewID0 = Stores[0]->getMetadata(LLVMContext::MD_DIAssignID);
+ EXPECT_NE(NewID0, nullptr);
+ }
}
} // end namespace
Index: llvm/lib/IR/Metadata.cpp
===================================================================
--- llvm/lib/IR/Metadata.cpp
+++ llvm/lib/IR/Metadata.cpp
@@ -1403,15 +1403,12 @@
if (!Value::hasMetadata())
return; // Nothing to remove!
- if (KnownIDs.empty()) {
- // Just drop our entry at the store.
- clearMetadata();
- return;
- }
-
SmallSet<unsigned, 4> KnownSet;
KnownSet.insert(KnownIDs.begin(), KnownIDs.end());
+ // A DIAssignID attachment is debug metadata, don't drop it.
+ KnownSet.insert(LLVMContext::MD_DIAssignID);
+
auto &MetadataStore = getContext().pImpl->ValueMetadata;
auto &Info = MetadataStore[this];
assert(!Info.empty() && "bit out of sync with hash table");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133292.474212.patch
Type: text/x-patch
Size: 1411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221109/4b20152d/attachment.bin>
More information about the llvm-commits
mailing list