projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add additional patterns for @llvm.assume in ValueTracking
[oota-llvm.git]
/
lib
/
Analysis
/
AliasAnalysisEvaluator.cpp
diff --git
a/lib/Analysis/AliasAnalysisEvaluator.cpp
b/lib/Analysis/AliasAnalysisEvaluator.cpp
index 15bf9732b542c6571b69d625cc4adeeb20145f06..fe4bd4cc21099c0280824115be33a927c92d30ea 100644
(file)
--- a/
lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/
lib/Analysis/AliasAnalysisEvaluator.cpp
@@
-23,12
+23,11
@@
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
+#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Instructions.h"
-#include "llvm/IR/Writer.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/InstIterator.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
@@
-44,7
+43,7
@@
static cl::opt<bool> PrintMod("print-mod", cl::ReallyHidden);
static cl::opt<bool> PrintRef("print-ref", cl::ReallyHidden);
static cl::opt<bool> PrintModRef("print-modref", cl::ReallyHidden);
static cl::opt<bool> PrintRef("print-ref", cl::ReallyHidden);
static cl::opt<bool> PrintModRef("print-modref", cl::ReallyHidden);
-static cl::opt<bool> Eval
TBAA("evaluate-tba
a", cl::ReallyHidden);
+static cl::opt<bool> Eval
AAMD("evaluate-aa-metadat
a", cl::ReallyHidden);
namespace {
class AAEval : public FunctionPass {
namespace {
class AAEval : public FunctionPass {
@@
-57,12
+56,12
@@
namespace {
initializeAAEvalPass(*PassRegistry::getPassRegistry());
}
initializeAAEvalPass(*PassRegistry::getPassRegistry());
}
- v
irtual void getAnalysisUsage(AnalysisUsage &AU) const
{
+ v
oid getAnalysisUsage(AnalysisUsage &AU) const override
{
AU.addRequired<AliasAnalysis>();
AU.setPreservesAll();
}
AU.addRequired<AliasAnalysis>();
AU.setPreservesAll();
}
- bool doInitialization(Module &M) {
+ bool doInitialization(Module &M)
override
{
NoAlias = MayAlias = PartialAlias = MustAlias = 0;
NoModRef = Mod = Ref = ModRef = 0;
NoAlias = MayAlias = PartialAlias = MustAlias = 0;
NoModRef = Mod = Ref = ModRef = 0;
@@
-74,8
+73,8
@@
namespace {
return false;
}
return false;
}
- bool runOnFunction(Function &F);
- bool doFinalization(Module &M);
+ bool runOnFunction(Function &F)
override
;
+ bool doFinalization(Module &M)
override
;
};
}
};
}
@@
-94,8
+93,8
@@
static void PrintResults(const char *Msg, bool P, const Value *V1,
std::string o1, o2;
{
raw_string_ostream os1(o1), os2(o2);
std::string o1, o2;
{
raw_string_ostream os1(o1), os2(o2);
-
WriteAsOperand(os1, V
1, true, M);
-
WriteAsOperand(os2, V
2, true, M);
+
V1->printAsOperand(os
1, true, M);
+
V2->printAsOperand(os
2, true, M);
}
if (o2 < o1)
}
if (o2 < o1)
@@
-111,7
+110,7
@@
PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr,
Module *M) {
if (P) {
errs() << " " << Msg << ": Ptr: ";
Module *M) {
if (P) {
errs() << " " << Msg << ": Ptr: ";
-
WriteAsOperand(errs(), Ptr
, true, M);
+
Ptr->printAsOperand(errs()
, true, M);
errs() << "\t<->" << *I << '\n';
}
}
errs() << "\t<->" << *I << '\n';
}
}
@@
-154,9
+153,9
@@
bool AAEval::runOnFunction(Function &F) {
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
if (I->getType()->isPointerTy()) // Add all pointer instructions.
Pointers.insert(&*I);
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
if (I->getType()->isPointerTy()) // Add all pointer instructions.
Pointers.insert(&*I);
- if (Eval
TBAA
&& isa<LoadInst>(&*I))
+ if (Eval
AAMD
&& isa<LoadInst>(&*I))
Loads.insert(&*I);
Loads.insert(&*I);
- if (Eval
TBAA
&& isa<StoreInst>(&*I))
+ if (Eval
AAMD
&& isa<StoreInst>(&*I))
Stores.insert(&*I);
Instruction &Inst = *I;
if (CallSite CS = cast<Value>(&Inst)) {
Stores.insert(&*I);
Instruction &Inst = *I;
if (CallSite CS = cast<Value>(&Inst)) {
@@
-214,7
+213,7
@@
bool AAEval::runOnFunction(Function &F) {
}
}
}
}
- if (Eval
TBAA
) {
+ if (Eval
AAMD
) {
// iterate over all pairs of load, store
for (SetVector<Value *>::iterator I1 = Loads.begin(), E = Loads.end();
I1 != E; ++I1) {
// iterate over all pairs of load, store
for (SetVector<Value *>::iterator I1 = Loads.begin(), E = Loads.end();
I1 != E; ++I1) {