[llvm] 7f133e7 - [AsmParser] Remove TBAA auto-upgrade in IR parser (#226914)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 28 03:36:21 PDT 2026
Author: Nikita Popov
Date: 2026-09-28T10:36:14Z
New Revision: 7f133e72828d68cbd8ce06bf64ea0fe8b8528c06
URL: https://github.com/llvm/llvm-project/commit/7f133e72828d68cbd8ce06bf64ea0fe8b8528c06
DIFF: https://github.com/llvm/llvm-project/commit/7f133e72828d68cbd8ce06bf64ea0fe8b8528c06.diff
LOG: [AsmParser] Remove TBAA auto-upgrade in IR parser (#226914)
At this point, the struct path TBAA format is more than a decade old, so
remove support for upgrading from the old format in the textual IR
parser. Bitcode upgrade support is retained, as bitcode is backwards
compatible.
This avoids introduction of new tests using the old format. Existing
tests were migrated in https://github.com/llvm/llvm-project/pull/226051.
Added:
llvm/test/Bitcode/upgrade-tbaa.ll.bc
Modified:
llvm/include/llvm/AsmParser/LLParser.h
llvm/lib/AsmParser/LLParser.cpp
llvm/test/Bitcode/upgrade-tbaa.ll
polly/test/CodeGen/OpenMP/single_loop_with_loop_invariant_baseptr.ll
Removed:
################################################################################
diff --git a/llvm/include/llvm/AsmParser/LLParser.h b/llvm/include/llvm/AsmParser/LLParser.h
index 2934df90bb7b3..70b98dae850fd 100644
--- a/llvm/include/llvm/AsmParser/LLParser.h
+++ b/llvm/include/llvm/AsmParser/LLParser.h
@@ -119,8 +119,6 @@ namespace llvm {
ModuleSummaryIndex *Index;
SlotMapping *Slots;
- SmallVector<Instruction*, 64> InstsWithTBAATag;
-
/// DIAssignID metadata does not support temporary RAUW so we cannot use
/// the normal metadata forward reference resolution method. Instead,
/// non-temporary DIAssignID are attached to instructions (recorded here)
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 408d79fe3402f..aaee06685fc2a 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -538,18 +538,6 @@ bool LLParser::validateEndOfModule(bool UpgradeDebugInfo) {
DISubprogram::cleanupRetainedNodes(NewDistinctSPs);
NewDistinctSPs.clear();
- for (auto *Inst : InstsWithTBAATag) {
- MDNode *MD = Inst->getMetadata(LLVMContext::MD_tbaa);
- // With incomplete IR, the tbaa metadata may have been dropped.
- if (!AllowIncompleteIR)
- assert(MD && "UpgradeInstWithTBAATag should have a TBAA tag");
- if (MD) {
- auto *UpgradedMD = UpgradeTBAANode(*MD);
- if (MD != UpgradedMD)
- Inst->setMetadata(LLVMContext::MD_tbaa, UpgradedMD);
- }
- }
-
// Look for intrinsic functions and CallInst that need to be upgraded. We use
// make_early_inc_range here because we may remove some functions.
for (Function &F : llvm::make_early_inc_range(*M))
@@ -2552,9 +2540,6 @@ bool LLParser::parseInstructionMetadata(Instruction &Inst) {
else
Inst.setMetadata(MDK, N);
- if (MDK == LLVMContext::MD_tbaa)
- InstsWithTBAATag.push_back(&Inst);
-
// If this is the end of the list, we're done.
} while (EatIfPresent(lltok::comma));
return false;
diff --git a/llvm/test/Bitcode/upgrade-tbaa.ll b/llvm/test/Bitcode/upgrade-tbaa.ll
index 893ba69052265..17d8204261c9c 100644
--- a/llvm/test/Bitcode/upgrade-tbaa.ll
+++ b/llvm/test/Bitcode/upgrade-tbaa.ll
@@ -1,5 +1,4 @@
-; RUN: llvm-as < %s | llvm-dis | FileCheck %s
-; RUN: verify-uselistorder < %s
+; RUN: llvm-dis < %s.bc | FileCheck %s
; Function Attrs: nounwind
define void @_Z4testPiPf(i32* nocapture %pI, float* nocapture %pF) {
diff --git a/llvm/test/Bitcode/upgrade-tbaa.ll.bc b/llvm/test/Bitcode/upgrade-tbaa.ll.bc
new file mode 100644
index 0000000000000..1887cf0aed0ad
Binary files /dev/null and b/llvm/test/Bitcode/upgrade-tbaa.ll.bc
diff er
diff --git a/polly/test/CodeGen/OpenMP/single_loop_with_loop_invariant_baseptr.ll b/polly/test/CodeGen/OpenMP/single_loop_with_loop_invariant_baseptr.ll
index 95324793f4fa4..658e5b434e984 100644
--- a/polly/test/CodeGen/OpenMP/single_loop_with_loop_invariant_baseptr.ll
+++ b/polly/test/CodeGen/OpenMP/single_loop_with_loop_invariant_baseptr.ll
@@ -42,7 +42,9 @@ exit:
ret void
}
-!2 = !{!"float", !3, i64 0}
+!1 = !{!"float", !3, i64 0}
+!2 = !{!1, !1, i64 0}
!3 = !{!"omnipotent char", !4, i64 0}
!4 = !{!"Simple C/C++ TBAA"}
-!6 = !{!"float *ptr", !3, i64 0}
+!5 = !{!"float *ptr", !3, i64 0}
+!6 = !{!5, !5, i64 0}
More information about the llvm-commits
mailing list