summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-12-05 21:03:28 +0000
committerDuncan Sands <baldrick@free.fr>2007-12-05 21:03:28 +0000
commitabba5e218c930f15753fa305479b16d141ebd751 (patch)
tree897315d582d0279a3281fa6c2e836c26587079ea /llvm/lib/Analysis
parent2968476c2d5a8c0430b6276ef58d9d15d02b33ba (diff)
downloadbcm5719-llvm-abba5e218c930f15753fa305479b16d141ebd751.tar.gz
bcm5719-llvm-abba5e218c930f15753fa305479b16d141ebd751.zip
Commit 44487 broke bootstrap of llvm-gcc-4.2. It is
not yet clear why, but in the meantime work around the problem by making less use of readnone/readonly info. llvm-svn: 44626
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/AliasAnalysis.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 12ea937fa92..fe3f41a9ce8 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -116,13 +116,17 @@ AliasAnalysis::getModRefInfo(StoreInst *S, Value *P, unsigned Size) {
AliasAnalysis::ModRefBehavior
AliasAnalysis::getModRefBehavior(CallSite CS,
std::vector<PointerAccessInfo> *Info) {
- if (CS.doesNotAccessMemory())
+ if (CS.doesNotAccessMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ CS.getCalledFunction() && CS.getCalledFunction()->isDeclaration())
// Can't do better than this.
return DoesNotAccessMemory;
ModRefBehavior MRB = UnknownModRefBehavior;
if (Function *F = CS.getCalledFunction())
MRB = getModRefBehavior(F, CS, Info);
- if (MRB != DoesNotAccessMemory && CS.onlyReadsMemory())
+ if (MRB != DoesNotAccessMemory && CS.onlyReadsMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ CS.getCalledFunction() && CS.getCalledFunction()->isDeclaration())
return OnlyReadsMemory;
return MRB;
}
@@ -130,11 +134,15 @@ AliasAnalysis::getModRefBehavior(CallSite CS,
AliasAnalysis::ModRefBehavior
AliasAnalysis::getModRefBehavior(Function *F,
std::vector<PointerAccessInfo> *Info) {
- if (F->doesNotAccessMemory())
+ if (F->doesNotAccessMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ F->isDeclaration())
// Can't do better than this.
return DoesNotAccessMemory;
ModRefBehavior MRB = getModRefBehavior(F, CallSite(), Info);
- if (MRB != DoesNotAccessMemory && F->onlyReadsMemory())
+ if (MRB != DoesNotAccessMemory && F->onlyReadsMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ F->isDeclaration())
return OnlyReadsMemory;
return MRB;
}
OpenPOWER on IntegriCloud