forked from OSchip/llvm-project
c07e19b2c1
Getting accurate locations for loops is important, because those locations are used by the frontend to generate optimization remarks. Currently, optimization remarks for loops often appear on the wrong line, often the first line of the loop body instead of the loop itself. This is confusing because that line might itself be another loop, or might be somewhere else completely if the body was an inlined function call. This happens because of the way we find the loop's starting location. First, we look for a preheader, and if we find one, and its terminator has a debug location, then we use that. Otherwise, we look for a location on an instruction in the loop header. The fallback heuristic is not bad, but will almost always find the beginning of the body, and not the loop statement itself. The preheader location search often fails because there's often not a preheader, and even when there is a preheader, depending on how it was formed, it sometimes carries the location of some preceeding code. I don't see any good theoretical way to fix this problem. On the other hand, this seems like a straightforward solution: Put the debug location in the loop's llvm.loop metadata. When emitting debug information, this commit causes us to add the debug location as an operand to each loop's llvm.loop metadata. Thus, we now generate this metadata for all loops (not just loops with optimization hints) when we're otherwise generating debug information. The remark test case changes depend on the companion LLVM commit r270771. llvm-svn: 270772 |
||
---|---|---|
.. | ||
Inputs | ||
ast-dump-arm-attr.c | ||
ast-dump-attr.cpp | ||
ast-dump-color.cpp | ||
ast-dump-comment.cpp | ||
ast-dump-decl.c | ||
ast-dump-decl.cpp | ||
ast-dump-decl.m | ||
ast-dump-decl.mm | ||
ast-dump-invalid.cpp | ||
ast-dump-lookups.cpp | ||
ast-dump-msp430-attr.c | ||
ast-dump-pipe.cl | ||
ast-dump-stmt.c | ||
ast-dump-stmt.cpp | ||
ast-dump-stmt.m | ||
ast-dump-templates.cpp | ||
ast-dump-wchar.cpp | ||
ast-print-char-literal.cpp | ||
ast-print-objectivec.m | ||
ast-print-pragmas-xfail.cpp | ||
ast-print-pragmas.cpp | ||
attr-source-range.cpp | ||
backend-optimization-failure-nodbg.cpp | ||
backend-optimization-failure.cpp | ||
backend-stack-frame-diagnostics-fallback.cpp | ||
backend-stack-frame-diagnostics.cpp | ||
caret-diags-macros.c | ||
caret-diags-scratch-buffer.c | ||
cc1as-asm.s | ||
dev-fd-fs.c | ||
diag-aka-types.cpp | ||
diag-format.c | ||
diag-line-wrapping.cpp | ||
diag-macro-backtrace.c | ||
diag-macro-backtrace2.c | ||
diag-mapping.c | ||
diag-mapping2.c | ||
diag-null-bytes-in-line.cpp | ||
diag-presumed.c | ||
diag-special-chars.c | ||
diag-template-diffing-color.cpp | ||
diag-template-diffing-cxx98.cpp | ||
diag-template-diffing.cpp | ||
diag-trailing-null-bytes.cpp | ||
diag-verify.cpp | ||
diagnostic-crash.cpp | ||
driver-verify.c | ||
emit-html-insert.c | ||
emit-html.c | ||
error-limit-multiple-notes.cpp | ||
error-limit.c | ||
freebsd-arm-size_t.c | ||
include-stack-for-note-flag.cpp | ||
integer-literal-printing.cpp | ||
interpreter.c | ||
languageOptsOpenCL.cl | ||
macro-backtrace.c | ||
message-length.c | ||
permissions.cpp | ||
predefines.c | ||
reduced-diags-macros-backtrace.cpp | ||
reduced-diags-macros.cpp | ||
remap-file.c | ||
serialized-diags-driver.c | ||
serialized-diags-frontend.c | ||
serialized-diags-no-category.c | ||
serialized-diags-no-issue.c | ||
serialized-diags-really-long-text.cpp | ||
serialized-diags-single-issue.c | ||
serialized-diags-stable.c | ||
serialized-diags.c | ||
serialized-diags.h | ||
serialized-diags.m | ||
show-diag-options.c | ||
tabstop.c | ||
target-parser.c | ||
thinlto.c | ||
unnecessary-elipses.cpp | ||
unprintable.c | ||
verify.c | ||
warn-in-system-header.c | ||
warn-in-system-header.h | ||
warn-sysheader.cpp | ||
warning-flags-enabled.c | ||
warning-flags-tree.c | ||
warning-flags.c | ||
win32-macho.c | ||
working-directory.c | ||
wrong-encoding.c | ||
wrong-encoding2.c |