summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2015-02-18 03:44:33 +0000
committerAdam Nemet <anemet@apple.com>2015-02-18 03:44:33 +0000
commit85fd9f8d09b4f2626000fb3c96be7f09b3e7577b (patch)
treec9de532bba4176231eb9e9138917007efa3a54ba /llvm/lib
parent75bc2d111f02e650a1590b033a15228694bb241d (diff)
downloadbcm5719-llvm-85fd9f8d09b4f2626000fb3c96be7f09b3e7577b.tar.gz
bcm5719-llvm-85fd9f8d09b4f2626000fb3c96be7f09b3e7577b.zip
[LoopAccesses] Change LAA:getInfo to return a constant reference
As expected, this required a few more const-correctness fixes. Based on Hal's feedback on D7684. llvm-svn: 229634
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp7
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp6
2 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index a99d657ed31..c974b36d76e 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -1173,7 +1173,7 @@ void LoopAccessInfo::emitAnalysis(LoopAccessReport &Message) {
Report = Message;
}
-bool LoopAccessInfo::isUniform(Value *V) {
+bool LoopAccessInfo::isUniform(Value *V) const {
return (SE->isLoopInvariant(SE->getSCEV(V), TheLoop));
}
@@ -1189,7 +1189,7 @@ static Instruction *getFirstInst(Instruction *FirstInst, Value *V,
}
std::pair<Instruction *, Instruction *>
-LoopAccessInfo::addRuntimeCheck(Instruction *Loc) {
+LoopAccessInfo::addRuntimeCheck(Instruction *Loc) const {
Instruction *tnullptr = nullptr;
if (!PtrRtCheck.Need)
return std::pair<Instruction *, Instruction *>(tnullptr, tnullptr);
@@ -1301,7 +1301,8 @@ void LoopAccessInfo::print(raw_ostream &OS, unsigned Depth) const {
OS << "\n";
}
-LoopAccessInfo &LoopAccessAnalysis::getInfo(Loop *L, ValueToValueMap &Strides) {
+const LoopAccessInfo &LoopAccessAnalysis::getInfo(Loop *L,
+ ValueToValueMap &Strides) {
auto &LAI = LoopAccessInfoMap[L];
#ifndef NDEBUG
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index ed4210b5bcf..d75eead0683 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -756,11 +756,11 @@ public:
bool isUniformAfterVectorization(Instruction* I) { return Uniforms.count(I); }
/// Returns the information that we collected about runtime memory check.
- LoopAccessInfo::RuntimePointerCheck *getRuntimePointerCheck() {
+ const LoopAccessInfo::RuntimePointerCheck *getRuntimePointerCheck() const {
return LAI->getRuntimePointerCheck();
}
- LoopAccessInfo *getLAI() {
+ const LoopAccessInfo *getLAI() const {
return LAI;
}
@@ -877,7 +877,7 @@ private:
LoopAccessAnalysis *LAA;
// And the loop-accesses info corresponding to this loop. This pointer is
// null until canVectorizeMemory sets it up.
- LoopAccessInfo *LAI;
+ const LoopAccessInfo *LAI;
// --- vectorization state --- //
OpenPOWER on IntegriCloud