diff options
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/AliasAnalysis.cpp | 6 | ||||
-rw-r--r-- | lib/Analysis/AliasAnalysisEvaluator.cpp | 6 | ||||
-rw-r--r-- | lib/Analysis/AliasSetTracker.cpp | 9 | ||||
-rw-r--r-- | lib/Analysis/BasicAliasAnalysis.cpp | 4 | ||||
-rw-r--r-- | lib/Analysis/ConstantFolding.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/LoadValueNumbering.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/MemoryDependenceAnalysis.cpp | 22 |
7 files changed, 26 insertions, 25 deletions
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp index 5ae2342404..2a3ac5ae17 100644 --- a/lib/Analysis/AliasAnalysis.cpp +++ b/lib/Analysis/AliasAnalysis.cpp @@ -95,7 +95,7 @@ AliasAnalysis::getModRefInfo(CallSite CS1, CallSite CS2) { AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo(LoadInst *L, Value *P, unsigned Size) { - return alias(L->getOperand(0), TD->getTypeSize(L->getType()), + return alias(L->getOperand(0), TD->getTypeStoreSize(L->getType()), P, Size) ? Ref : NoModRef; } @@ -103,8 +103,8 @@ AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo(StoreInst *S, Value *P, unsigned Size) { // If the stored address cannot alias the pointer in question, then the // pointer cannot be modified by the store. - if (!alias(S->getOperand(1), TD->getTypeSize(S->getOperand(0)->getType()), - P, Size)) + if (!alias(S->getOperand(1), + TD->getTypeStoreSize(S->getOperand(0)->getType()), P, Size)) return NoModRef; // If the pointer is a pointer to constant memory, then it could not have been diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp index 30965c2fb3..e0457b1778 100644 --- a/lib/Analysis/AliasAnalysisEvaluator.cpp +++ b/lib/Analysis/AliasAnalysisEvaluator.cpp @@ -137,12 +137,12 @@ bool AAEval::runOnFunction(Function &F) { I1 != E; ++I1) { unsigned I1Size = 0; const Type *I1ElTy = cast<PointerType>((*I1)->getType())->getElementType(); - if (I1ElTy->isSized()) I1Size = TD.getTypeSize(I1ElTy); + if (I1ElTy->isSized()) I1Size = TD.getTypeStoreSize(I1ElTy); for (std::set<Value *>::iterator I2 = Pointers.begin(); I2 != I1; ++I2) { unsigned I2Size = 0; const Type *I2ElTy =cast<PointerType>((*I2)->getType())->getElementType(); - if (I2ElTy->isSized()) I2Size = TD.getTypeSize(I2ElTy); + if (I2ElTy->isSized()) I2Size = TD.getTypeStoreSize(I2ElTy); switch (AA.alias(*I1, I1Size, *I2, I2Size)) { case AliasAnalysis::NoAlias: @@ -169,7 +169,7 @@ bool AAEval::runOnFunction(Function &F) { V != Ve; ++V) { unsigned Size = 0; const Type *ElTy = cast<PointerType>((*V)->getType())->getElementType(); - if (ElTy->isSized()) Size = TD.getTypeSize(ElTy); + if (ElTy->isSized()) Size = TD.getTypeStoreSize(ElTy); switch (AA.getModRefInfo(*C, *V, Size)) { case AliasAnalysis::NoModRef: diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp index 366909c0eb..fcdd1b3399 100644 --- a/lib/Analysis/AliasSetTracker.cpp +++ b/lib/Analysis/AliasSetTracker.cpp @@ -269,7 +269,7 @@ bool AliasSetTracker::add(Value *Ptr, unsigned Size) { bool AliasSetTracker::add(LoadInst *LI) { bool NewPtr; AliasSet &AS = addPointer(LI->getOperand(0), - AA.getTargetData().getTypeSize(LI->getType()), + AA.getTargetData().getTypeStoreSize(LI->getType()), AliasSet::Refs, NewPtr); if (LI->isVolatile()) AS.setVolatile(); return NewPtr; @@ -279,7 +279,7 @@ bool AliasSetTracker::add(StoreInst *SI) { bool NewPtr; Value *Val = SI->getOperand(0); AliasSet &AS = addPointer(SI->getOperand(1), - AA.getTargetData().getTypeSize(Val->getType()), + AA.getTargetData().getTypeStoreSize(Val->getType()), AliasSet::Mods, NewPtr); if (SI->isVolatile()) AS.setVolatile(); return NewPtr; @@ -395,7 +395,7 @@ bool AliasSetTracker::remove(Value *Ptr, unsigned Size) { } bool AliasSetTracker::remove(LoadInst *LI) { - unsigned Size = AA.getTargetData().getTypeSize(LI->getType()); + unsigned Size = AA.getTargetData().getTypeStoreSize(LI->getType()); AliasSet *AS = findAliasSetForPointer(LI->getOperand(0), Size); if (!AS) return false; remove(*AS); @@ -403,7 +403,8 @@ bool AliasSetTracker::remove(LoadInst *LI) { } bool AliasSetTracker::remove(StoreInst *SI) { - unsigned Size = AA.getTargetData().getTypeSize(SI->getOperand(0)->getType()); + unsigned Size = + AA.getTargetData().getTypeStoreSize(SI->getOperand(0)->getType()); AliasSet *AS = findAliasSetForPointer(SI->getOperand(1), Size); if (!AS) return false; remove(*AS); diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 89b5d5c3cb..6aeaec23fa 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -364,7 +364,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size, // global/alloca/malloc, it cannot be accessing the global (it's // undefined to load or store bytes before or after an object). const Type *ElTy = cast<PointerType>(O1->getType())->getElementType(); - unsigned GlobalSize = getTargetData().getTypeSize(ElTy); + unsigned GlobalSize = getTargetData().getABITypeSize(ElTy); if (GlobalSize < V2Size && V2Size != ~0U) return NoAlias; } @@ -382,7 +382,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size, // global/alloca/malloc, it cannot be accessing the object (it's // undefined to load or store bytes before or after an object). const Type *ElTy = cast<PointerType>(O2->getType())->getElementType(); - unsigned GlobalSize = getTargetData().getTypeSize(ElTy); + unsigned GlobalSize = getTargetData().getABITypeSize(ElTy); if (GlobalSize < V1Size && V1Size != ~0U) return NoAlias; } diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 599c7697a3..886dd9f4f7 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -74,7 +74,7 @@ static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV, Offset += TD.getStructLayout(ST)->getElementOffset(CI->getZExtValue()); } else { const SequentialType *SQT = cast<SequentialType>(*GTI); - Offset += TD.getTypeSize(SQT->getElementType())*CI->getSExtValue(); + Offset += TD.getABITypeSize(SQT->getElementType())*CI->getSExtValue(); } } return true; diff --git a/lib/Analysis/LoadValueNumbering.cpp b/lib/Analysis/LoadValueNumbering.cpp index f1ade951f3..3af92bc11c 100644 --- a/lib/Analysis/LoadValueNumbering.cpp +++ b/lib/Analysis/LoadValueNumbering.cpp @@ -293,7 +293,7 @@ void LoadVN::getEqualNumberNodes(Value *V, Function *F = LoadBB->getParent(); // Find out how many bytes of memory are loaded by the load instruction... - unsigned LoadSize = getAnalysis<TargetData>().getTypeSize(LI->getType()); + unsigned LoadSize = getAnalysis<TargetData>().getTypeStoreSize(LI->getType()); AliasAnalysis &AA = getAnalysis<AliasAnalysis>(); // Figure out if the load is invalidated from the entry of the block it is in diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index 538a394d46..5375d52c33 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -78,20 +78,20 @@ Instruction* MemoryDependenceAnalysis::getCallSiteDependency(CallSite C, uint64_t pointerSize = 0; if (StoreInst* S = dyn_cast<StoreInst>(QI)) { pointer = S->getPointerOperand(); - pointerSize = TD.getTypeSize(S->getOperand(0)->getType()); + pointerSize = TD.getTypeStoreSize(S->getOperand(0)->getType()); } else if (LoadInst* L = dyn_cast<LoadInst>(QI)) { pointer = L->getPointerOperand(); - pointerSize = TD.getTypeSize(L->getType()); + pointerSize = TD.getTypeStoreSize(L->getType()); } else if (AllocationInst* AI = dyn_cast<AllocationInst>(QI)) { pointer = AI; if (ConstantInt* C = dyn_cast<ConstantInt>(AI->getArraySize())) pointerSize = C->getZExtValue() * \ - TD.getTypeSize(AI->getAllocatedType()); + TD.getABITypeSize(AI->getAllocatedType()); else pointerSize = ~0UL; } else if (VAArgInst* V = dyn_cast<VAArgInst>(QI)) { pointer = V->getOperand(0); - pointerSize = TD.getTypeSize(V->getType()); + pointerSize = TD.getTypeStoreSize(V->getType()); } else if (FreeInst* F = dyn_cast<FreeInst>(QI)) { pointer = F->getPointerOperand(); @@ -287,15 +287,15 @@ Instruction* MemoryDependenceAnalysis::getDependency(Instruction* query, bool queryIsVolatile = false; if (StoreInst* S = dyn_cast<StoreInst>(query)) { dependee = S->getPointerOperand(); - dependeeSize = TD.getTypeSize(S->getOperand(0)->getType()); + dependeeSize = TD.getTypeStoreSize(S->getOperand(0)->getType()); queryIsVolatile = S->isVolatile(); } else if (LoadInst* L = dyn_cast<LoadInst>(query)) { dependee = L->getPointerOperand(); - dependeeSize = TD.getTypeSize(L->getType()); + dependeeSize = TD.getTypeStoreSize(L->getType()); queryIsVolatile = L->isVolatile(); } else if (VAArgInst* V = dyn_cast<VAArgInst>(query)) { dependee = V->getOperand(0); - dependeeSize = TD.getTypeSize(V->getType()); + dependeeSize = TD.getTypeStoreSize(V->getType()); } else if (FreeInst* F = dyn_cast<FreeInst>(query)) { dependee = F->getPointerOperand(); @@ -330,7 +330,7 @@ Instruction* MemoryDependenceAnalysis::getDependency(Instruction* query, } pointer = S->getPointerOperand(); - pointerSize = TD.getTypeSize(S->getOperand(0)->getType()); + pointerSize = TD.getTypeStoreSize(S->getOperand(0)->getType()); } else if (LoadInst* L = dyn_cast<LoadInst>(QI)) { // All volatile loads/stores depend on each other if (queryIsVolatile && L->isVolatile()) { @@ -343,17 +343,17 @@ Instruction* MemoryDependenceAnalysis::getDependency(Instruction* query, } pointer = L->getPointerOperand(); - pointerSize = TD.getTypeSize(L->getType()); + pointerSize = TD.getTypeStoreSize(L->getType()); } else if (AllocationInst* AI = dyn_cast<AllocationInst>(QI)) { pointer = AI; if (ConstantInt* C = dyn_cast<ConstantInt>(AI->getArraySize())) pointerSize = C->getZExtValue() * \ - TD.getTypeSize(AI->getAllocatedType()); + TD.getABITypeSize(AI->getAllocatedType()); else pointerSize = ~0UL; } else if (VAArgInst* V = dyn_cast<VAArgInst>(QI)) { pointer = V->getOperand(0); - pointerSize = TD.getTypeSize(V->getType()); + pointerSize = TD.getTypeStoreSize(V->getType()); } else if (FreeInst* F = dyn_cast<FreeInst>(QI)) { pointer = F->getPointerOperand(); |