summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/StructRetPromotion.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-03-05 23:39:23 +0000
committerDevang Patel <dpatel@apple.com>2008-03-05 23:39:23 +0000
commite0a6a3f22d2d847237e802307c2e6cd036d3c0ac (patch)
tree29b7f7811153e4eb4f8f4d830a9f5613aaa157cd /lib/Transforms/IPO/StructRetPromotion.cpp
parent1f797a32fdc5e3841e9975756ff8c8e62cb41414 (diff)
downloadllvm-e0a6a3f22d2d847237e802307c2e6cd036d3c0ac.tar.gz
llvm-e0a6a3f22d2d847237e802307c2e6cd036d3c0ac.tar.bz2
llvm-e0a6a3f22d2d847237e802307c2e6cd036d3c0ac.tar.xz
Skip, for now, callsites where use of sret argument is not dominated by callsite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47980 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/StructRetPromotion.cpp')
-rw-r--r--lib/Transforms/IPO/StructRetPromotion.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp
index 54a34e8803..5275edaa16 100644
--- a/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/lib/Transforms/IPO/StructRetPromotion.cpp
@@ -171,6 +171,10 @@ bool SRETPromotion::isSafeToUpdateAllCallers(Function *F) {
// 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)) {
+ // TODO : Use dom info and insert PHINodes to collect get results
+ // from multiple call sites for this GEP.
+ if (GEP->getParent() != Call->getParent())
+ return false;
for (Value::use_iterator GEPI = GEP->use_begin(), GEPE = GEP->use_end();
GEPI != GEPE; ++GEPI)
if (!isa<LoadInst>(GEPI))