projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify this code; LoopInfo::getCanonicalInductionVariable will only
[oota-llvm.git]
/
lib
/
Analysis
/
AliasAnalysis.cpp
diff --git
a/lib/Analysis/AliasAnalysis.cpp
b/lib/Analysis/AliasAnalysis.cpp
index 92fa1df5c954c0446c6b9aeb519e30e440543fe9..503fbbdab8d67d73e5694f4a9b1ac64d2bedc461 100644
(file)
--- a/
lib/Analysis/AliasAnalysis.cpp
+++ b/
lib/Analysis/AliasAnalysis.cpp
@@
-116,28
+116,32
@@
AliasAnalysis::getModRefBehavior(Function *F,
return DoesNotAccessMemory;
if (F->onlyReadsMemory())
return OnlyReadsMemory;
return DoesNotAccessMemory;
if (F->onlyReadsMemory())
return OnlyReadsMemory;
- if (unsigned id = F->getIntrinsicID()) {
+ if (unsigned id = F->getIntrinsicID())
+ return getModRefBehavior(id);
+ }
+ return UnknownModRefBehavior;
+}
+
+AliasAnalysis::ModRefBehavior AliasAnalysis::getModRefBehavior(unsigned iid) {
#define GET_INTRINSIC_MODREF_BEHAVIOR
#include "llvm/Intrinsics.gen"
#undef GET_INTRINSIC_MODREF_BEHAVIOR
#define GET_INTRINSIC_MODREF_BEHAVIOR
#include "llvm/Intrinsics.gen"
#undef GET_INTRINSIC_MODREF_BEHAVIOR
- }
- }
- return UnknownModRefBehavior;
}
AliasAnalysis::ModRefResult
AliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
}
AliasAnalysis::ModRefResult
AliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- ModRefResult Mask = ModRef;
ModRefBehavior MRB = getModRefBehavior(CS);
if (MRB == DoesNotAccessMemory)
return NoModRef;
ModRefBehavior MRB = getModRefBehavior(CS);
if (MRB == DoesNotAccessMemory)
return NoModRef;
- else if (MRB == OnlyReadsMemory)
+
+ ModRefResult Mask = ModRef;
+ if (MRB == OnlyReadsMemory)
Mask = Ref;
else if (MRB == AliasAnalysis::AccessesArguments) {
bool doesAlias = false;
for (CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
AI != AE; ++AI)
Mask = Ref;
else if (MRB == AliasAnalysis::AccessesArguments) {
bool doesAlias = false;
for (CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
AI != AE; ++AI)
- if (
alias(*AI, ~0U, P, Size) != NoAlias
) {
+ if (
!isNoAlias(*AI, ~0U, P, Size)
) {
doesAlias = true;
break;
}
doesAlias = true;
break;
}
@@
-229,10
+233,12
@@
bool llvm::isNoAliasCall(const Value *V) {
/// NoAlias returns
///
bool llvm::isIdentifiedObject(const Value *V) {
/// NoAlias returns
///
bool llvm::isIdentifiedObject(const Value *V) {
- if (isa<AllocaInst>(V)
|| isNoAliasCall(V)
)
+ if (isa<AllocaInst>(V))
return true;
if (isa<GlobalValue>(V) && !isa<GlobalAlias>(V))
return true;
return true;
if (isa<GlobalValue>(V) && !isa<GlobalAlias>(V))
return true;
+ if (isNoAliasCall(V))
+ return true;
if (const Argument *A = dyn_cast<Argument>(V))
return A->hasNoAliasAttr() || A->hasByValAttr();
return false;
if (const Argument *A = dyn_cast<Argument>(V))
return A->hasNoAliasAttr() || A->hasByValAttr();
return false;