@@ -5123,9 +5123,6 @@ void Verifier::visitInstruction(Instruction &I) {
51235123 if (MDNode *TBAA = I.getMetadata (LLVMContext::MD_tbaa))
51245124 TBAAVerifyHelper.visitTBAAMetadata (I, TBAA);
51255125
5126- if (MDNode *TBAA = I.getMetadata (LLVMContext::MD_tbaa_struct))
5127- TBAAVerifyHelper.visitTBAAStructMetadata (I, TBAA);
5128-
51295126 if (MDNode *MD = I.getMetadata (LLVMContext::MD_noalias))
51305127 visitAliasScopeListMetadata (MD);
51315128 if (MDNode *MD = I.getMetadata (LLVMContext::MD_alias_scope))
@@ -7462,35 +7459,6 @@ bool TBAAVerifier::visitTBAAMetadata(Instruction &I, const MDNode *MD) {
74627459 return true ;
74637460}
74647461
7465- bool TBAAVerifier::visitTBAAStructMetadata (Instruction &I, const MDNode *MD) {
7466- CheckTBAA (MD->getNumOperands () % 3 == 0 ,
7467- " tbaa.struct operands must occur in groups of three" , &I, MD);
7468-
7469- // Each group of three operands must consist of two integers and a
7470- // tbaa node. Moreover, the regions described by the offset and size
7471- // operands must be non-overlapping.
7472- std::optional<APInt> NextFree;
7473- for (unsigned int Idx = 0 ; Idx < MD->getNumOperands (); Idx += 3 ) {
7474- auto *OffsetCI =
7475- mdconst::dyn_extract_or_null<ConstantInt>(MD->getOperand (Idx));
7476- CheckTBAA (OffsetCI, " Offset must be a constant integer" , &I, MD);
7477-
7478- auto *SizeCI =
7479- mdconst::dyn_extract_or_null<ConstantInt>(MD->getOperand (Idx + 1 ));
7480- CheckTBAA (SizeCI, " Size must be a constant integer" , &I, MD);
7481-
7482- MDNode *TBAA = dyn_cast_or_null<MDNode>(MD->getOperand (Idx + 2 ));
7483- CheckTBAA (TBAA, " TBAA tag missing" , &I, MD);
7484- visitTBAAMetadata (I, TBAA);
7485-
7486- bool NonOverlapping = !NextFree || NextFree->ule (OffsetCI->getValue ());
7487- CheckTBAA (NonOverlapping, " Overlapping tbaa.struct regions" , &I, MD);
7488-
7489- NextFree = OffsetCI->getValue () + SizeCI->getValue ();
7490- }
7491- return true ;
7492- }
7493-
74947462char VerifierLegacyPass::ID = 0 ;
74957463INITIALIZE_PASS (VerifierLegacyPass, " verify" , " Module Verifier" , false , false )
74967464
0 commit comments