1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

cache dereferenced iterators

llvm-svn: 108134
This commit is contained in:
Gabor Greif 2010-07-12 11:19:24 +00:00
parent 95805d51b8
commit f420d43bf6

View File

@ -171,16 +171,16 @@ bool SRETPromotion::isSafeToUpdateAllCallers(Function *F) {
// Check FirstArg's users.
for (Value::use_iterator ArgI = FirstArg->use_begin(),
ArgE = FirstArg->use_end(); ArgI != ArgE; ++ArgI) {
User *U = *ArgI;
// If FirstArg user is a CallInst that does not correspond to current
// call site then this function F is not suitable for sret promotion.
if (CallInst *CI = dyn_cast<CallInst>(ArgI)) {
if (CallInst *CI = dyn_cast<CallInst>(U)) {
if (CI != Call)
return false;
}
// If FirstArg user is a GEP whose all users are not LoadInst then
// this function F is not suitable for sret promotion.
else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(ArgI)) {
else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
// TODO : Use dom info and insert PHINodes to collect get results
// from multiple call sites for this GEP.
if (GEP->getParent() != Call->getParent())