[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229634 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adam Nemet
2015-02-18 03:44:33 +00:00
parent f367b60abe
commit 5934863461
3 changed files with 16 additions and 12 deletions

View File

@@ -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