[llvm-commits] [llvm] r44626 - in /llvm/trunk/lib: Analysis/AliasAnalysis.cpp VMCore/Instruction.cpp
Duncan Sands
baldrick at free.fr
Wed Dec 5 13:03:29 PST 2007
Author: baldrick
Date: Wed Dec 5 15:03:28 2007
New Revision: 44626
URL: http://llvm.org/viewvc/llvm-project?rev=44626&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Analysis/AliasAnalysis.cpp
llvm/trunk/lib/VMCore/Instruction.cpp
Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=44626&r1=44625&r2=44626&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Wed Dec 5 15:03:28 2007
@@ -116,13 +116,17 @@
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::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;
}
Modified: llvm/trunk/lib/VMCore/Instruction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instruction.cpp?rev=44626&r1=44625&r2=44626&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Instruction.cpp (original)
+++ llvm/trunk/lib/VMCore/Instruction.cpp Wed Dec 5 15:03:28 2007
@@ -13,6 +13,7 @@
#include "llvm/Type.h"
#include "llvm/Instructions.h"
+#include "llvm/IntrinsicInst.h" // FIXME: remove
#include "llvm/Function.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/LeakDetector.h"
@@ -208,6 +209,8 @@
case Instruction::VAArg:
return true;
case Instruction::Call:
+ if (!isa<IntrinsicInst>(this))
+ return true; // FIXME: workaround gcc bootstrap breakage
return !cast<CallInst>(this)->onlyReadsMemory();
case Instruction::Load:
return cast<LoadInst>(this)->isVolatile();
More information about the llvm-commits
mailing list