Mirror of official llvm git repository located at http://llvm.org/git/llvm. Updated every five minutes.
Go to file
Hal Finkel d86e7af14a Look for a loop's starting location in the llvm.loop metadata
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
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. A companion Clang patch will cause Clang to insert
llvm.loop metadata with appropriate locations when generating debugging
information. With these changes, our loop remarks have much more accurate
locations.

Differential Revision: http://reviews.llvm.org/D19738

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 21:42:37 +00:00
bindings Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
cmake [CMake] LINK_LIBS need to be public for Darwin dylib targets 2016-05-25 17:08:43 +00:00
docs [libFuzzer] document the proposed FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION 2016-05-25 18:41:53 +00:00
examples Fix some Include What You Use warnings in examples; other minor fixes. 2016-05-25 01:18:36 +00:00
include Look for a loop's starting location in the llvm.loop metadata 2016-05-25 21:42:37 +00:00
lib Look for a loop's starting location in the llvm.loop metadata 2016-05-25 21:42:37 +00:00
projects Remove autoconf support 2016-01-26 21:29:08 +00:00
resources In MSVC builds embed a VERSIONINFO resource in our exe and DLL files. 2015-06-12 15:58:29 +00:00
test Look for a loop's starting location in the llvm.loop metadata 2016-05-25 21:42:37 +00:00
tools [codeview] Move StreamInterface and StreamReader to libcodeview. 2016-05-25 20:37:03 +00:00
unittests Port the strip-invalid-debuginfo logic to the legacy verifier pass, too. 2016-05-25 21:33:20 +00:00
utils TableGen: Use StringRef instead of std::string 2016-05-25 18:07:40 +00:00
.arcconfig Updated phabricator server. 2014-04-07 03:57:04 +00:00
.clang-format Test commit. 2014-03-02 13:08:46 +00:00
.clang-tidy Don't use misc-unused-parameters check on LLVM. 2016-04-13 08:58:52 +00:00
.gitignore Minor updates to gitignore so that symlinks are ignored in the projects dir. 2015-07-07 20:24:58 +00:00
CMakeLists.txt Remove LLVM_ENABLE_TIMESTAMPS 2016-05-05 19:57:03 +00:00
CODE_OWNERS.TXT CODE_OWNERS: Take ownership of SelectionDAG 2016-05-20 19:14:04 +00:00
configure Remove autoconf support 2016-01-26 21:29:08 +00:00
CREDITS.TXT Update my email address. 2016-05-10 16:23:54 +00:00
LICENSE.TXT Update copyright year to 2016. 2016-03-30 22:41:06 +00:00
llvm.spec.in [Sparc] Implement i64 load/store support for 32-bit sparc. 2015-08-10 19:11:39 +00:00
LLVMBuild.txt Remove the very substantial, largely unmaintained legacy PGO 2013-10-02 15:42:23 +00:00
README.txt Revert previous test commit. 2016-01-04 19:13:29 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.