[llvm-commits] [poolalloc] r128983 - in /poolalloc/trunk: include/assistDS/TypeAnalysis.h lib/AssistDS/TypeAnalysis.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Tue Apr 5 20:07:43 PDT 2011
Author: aggarwa4
Date: Tue Apr 5 22:07:43 2011
New Revision: 128983
URL: http://llvm.org/viewvc/llvm-project?rev=128983&view=rev
Log:
Checked in header.
Modified:
poolalloc/trunk/include/assistDS/TypeAnalysis.h
poolalloc/trunk/lib/AssistDS/TypeAnalysis.cpp
Modified: poolalloc/trunk/include/assistDS/TypeAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/TypeAnalysis.h?rev=128983&r1=128982&r2=128983&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/TypeAnalysis.h (original)
+++ poolalloc/trunk/include/assistDS/TypeAnalysis.h Tue Apr 5 22:07:43 2011
@@ -39,6 +39,8 @@
bool isCopyingLoad(ExtractValueInst *);
bool isCopyingStore(StoreInst *);
bool isCopyingStore(InsertValueInst *);
+ Value *getStoreSource(StoreInst *SI);
+ Value *getStoreSource(InsertValueInst *IVI);
};
}
Modified: poolalloc/trunk/lib/AssistDS/TypeAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeAnalysis.cpp?rev=128983&r1=128982&r2=128983&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeAnalysis.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeAnalysis.cpp Tue Apr 5 22:07:43 2011
@@ -113,18 +113,16 @@
return LI->getOperand(0);
}
else if(ExtractValueInst *EVI = dyn_cast<ExtractValueInst>(IVI->getInsertedValueOperand())) {
- // TODO: create a GEPInst instead
- /*SmallVector<Constant*, 8> Indices;
+ SmallVector<Value*, 8> Indices;
Indices.reserve(EVI->getNumIndices());
for (unsigned i = 1, e = EVI->getNumOperands(); i != e; ++i) {
- Constant *Val = EVI->getOperand(i);
+ Value *Val = EVI->getOperand(i);
Indices.push_back(Val);
}
-
- Value *GEPExpr = ConstantExpr::getGetElementPtr(EVI, &Indices[0], EVI->getNumIndices(), true);
- return GEPExpr;*/
- return NULL;
+ GetElementPtrInst *GEPInst =
+ GetElementPtrInst::Create(EVI->getOperand(0), &Indices[0],&Indices[0] + EVI->getNumIndices(), "", EVI);
+ return GEPInst;
}
return NULL;
}
More information about the llvm-commits
mailing list