diff options
| author | Adam Nemet <anemet@apple.com> | 2015-02-19 19:15:21 +0000 |
|---|---|---|
| committer | Adam Nemet <anemet@apple.com> | 2015-02-19 19:15:21 +0000 |
| commit | 57ac766ee995d717dc032ba35c9100bc7aa77652 (patch) | |
| tree | 94efcd95fb220071336bd30f21e686f60983f7cc /llvm/lib/Analysis | |
| parent | e91cc6ef9302e308a388b611a4855299458e59c7 (diff) | |
| download | bcm5719-llvm-57ac766ee995d717dc032ba35c9100bc7aa77652.tar.gz bcm5719-llvm-57ac766ee995d717dc032ba35c9100bc7aa77652.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: 229899
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index e9815eb379f..21d4d96ad3f 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -1198,7 +1198,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)); } @@ -1214,7 +1214,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); @@ -1326,7 +1326,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 |

