[llvm] [AsmParser] Add support for reading incomplete IR (part 1) (PR #78421)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 01:44:52 PST 2024


================
@@ -269,10 +330,14 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
 
   for (auto *Inst : InstsWithTBAATag) {
     MDNode *MD = Inst->getMetadata(LLVMContext::MD_tbaa);
-    assert(MD && "UpgradeInstWithTBAATag should have a TBAA tag");
-    auto *UpgradedMD = UpgradeTBAANode(*MD);
-    if (MD != UpgradedMD)
-      Inst->setMetadata(LLVMContext::MD_tbaa, UpgradedMD);
+    // With incomplete IR, the tbaa metadata may have been dropped.
+    if (!AllowIncompleteIR)
+      assert(MD && "UpgradeInstWithTBAATag should have a TBAA tag");
----------------
nikic wrote:

This is an internal consistency assertion -- it should not be possible to trigger such an error on any input.

https://github.com/llvm/llvm-project/pull/78421


More information about the llvm-commits mailing list