diff options
| author | Adam Nemet <anemet@apple.com> | 2016-09-21 03:14:20 +0000 |
|---|---|---|
| committer | Adam Nemet <anemet@apple.com> | 2016-09-21 03:14:20 +0000 |
| commit | e3cef93727147603667ec33feba64f6de7955818 (patch) | |
| tree | 42763c354c66b4ffedc7472de70928f8de05d124 /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
| parent | 556894fb10b7f8b5fd9690954588be97ce593845 (diff) | |
| download | bcm5719-llvm-e3cef93727147603667ec33feba64f6de7955818.tar.gz bcm5719-llvm-e3cef93727147603667ec33feba64f6de7955818.zip | |
[LV] When reporting about a specific instruction without debug location use loop's
This can occur for example if some optimization drops the debug location.
llvm-svn: 282048
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
| -rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 6cf36a82fac..978e7a524df 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -99,7 +99,10 @@ void LoopAccessReport::emitAnalysis(const LoopAccessReport &Message, DebugLoc DL = TheLoop->getStartLoc(); const Value *V = TheLoop->getHeader(); if (const Instruction *I = Message.getInstr()) { - DL = I->getDebugLoc(); + // If there is no debug location attached to the instruction, revert back to + // using the loop's. + if (I->getDebugLoc()) + DL = I->getDebugLoc(); V = I->getParent(); } ORE.emitOptimizationRemarkAnalysis(PassName, DL, V, Message.str()); |

