From 2ff97832e593926ea8dbdd5fc5bcf367475638a9 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Mon, 22 Apr 2013 23:00:44 +0000 Subject: Struct-path aware TBAA: update getMostGenericTBAA The tag is of type TBAANode when flag EnableStructPathTBAA is off. Move implementation of MDNode::getMostGenericTBAA to TypeBasedAliasAnalysis.cpp since it depends on how to interprete the MDNodes for scalar TBAA and struct-path aware TBAA. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180068 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Metadata.cpp | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'lib/IR') diff --git a/lib/IR/Metadata.cpp b/lib/IR/Metadata.cpp index 0228aeb31f..6a6b7af5cb 100644 --- a/lib/IR/Metadata.cpp +++ b/lib/IR/Metadata.cpp @@ -403,42 +403,6 @@ void MDNode::replaceOperand(MDNodeOperand *Op, Value *To) { } } -MDNode *MDNode::getMostGenericTBAA(MDNode *A, MDNode *B) { - if (!A || !B) - return NULL; - - if (A == B) - return A; - - SmallVector PathA; - MDNode *T = A; - while (T) { - PathA.push_back(T); - T = T->getNumOperands() >= 2 ? cast_or_null(T->getOperand(1)) : 0; - } - - SmallVector PathB; - T = B; - while (T) { - PathB.push_back(T); - T = T->getNumOperands() >= 2 ? cast_or_null(T->getOperand(1)) : 0; - } - - int IA = PathA.size() - 1; - int IB = PathB.size() - 1; - - MDNode *Ret = 0; - while (IA >= 0 && IB >=0) { - if (PathA[IA] == PathB[IB]) - Ret = PathA[IA]; - else - break; - --IA; - --IB; - } - return Ret; -} - MDNode *MDNode::getMostGenericFPMath(MDNode *A, MDNode *B) { if (!A || !B) return NULL; -- cgit v1.2.3-18-g5258