From 65316d674914067bd0b6da080f8a7cf7c1aa0e78 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 11 Nov 2010 21:50:19 +0000 Subject: Add helper functions for computing the Location of load, store, and vaarg instructions. llvm-svn: 118845 --- llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp') diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp index bb3ee465716..95decec0f87 100644 --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -165,27 +165,20 @@ bool FunctionAttrs::AddReadAttrs(const CallGraphSCC &SCC) { } else if (LoadInst *LI = dyn_cast(I)) { // Ignore non-volatile loads from local memory. if (!LI->isVolatile()) { - AliasAnalysis::Location Loc(LI->getPointerOperand(), - AA->getTypeStoreSize(LI->getType()), - LI->getMetadata(LLVMContext::MD_tbaa)); + AliasAnalysis::Location Loc = AA->getLocation(LI); if (AA->pointsToConstantMemory(Loc, /*OrLocal=*/true)) continue; } } else if (StoreInst *SI = dyn_cast(I)) { // Ignore non-volatile stores to local memory. if (!SI->isVolatile()) { - const Type *StoredType = SI->getValueOperand()->getType(); - AliasAnalysis::Location Loc(SI->getPointerOperand(), - AA->getTypeStoreSize(StoredType), - SI->getMetadata(LLVMContext::MD_tbaa)); + AliasAnalysis::Location Loc = AA->getLocation(SI); if (AA->pointsToConstantMemory(Loc, /*OrLocal=*/true)) continue; } } else if (VAArgInst *VI = dyn_cast(I)) { // Ignore vaargs on local memory. - AliasAnalysis::Location Loc(VI->getPointerOperand(), - AliasAnalysis::UnknownSize, - VI->getMetadata(LLVMContext::MD_tbaa)); + AliasAnalysis::Location Loc = AA->getLocation(VI); if (AA->pointsToConstantMemory(Loc, /*OrLocal=*/true)) continue; } -- cgit v1.2.3