hanchenye-llvm-project/polly
David Peixotto a4817871d2 Safely generate new loop metadata node
Polly was accidently modifying a debug info metadata node when
attempting to generate a new unique metadata node for the loop id.
The problem was that we had dwarf metadata that referred to a
metadata node with a null value, like this:

  !6 = ... some dwarf metadata referring to !7 ...
  !7 = {null}

When we attempt to generate a new metadata node, we reserve the
first space for self-referential node by setting the first argument
to null and then mutating the node later to refer to itself.
However, because the nodes are uniqued based on pointer values, when
we get the new metadata node it actually referred to an existing
node (!7 in the example).  When we went to modify the metadata to
point to itself, we were accidently mutating the dwarf metatdata. We
ended up in this situation:

  !6 = ... some dwarf metadata referring to !7 ...
  !7 = {!7}

and this causes an assert when generating the debug info. The fix is
simple, we just need to use a unique value when getting a new
metadata node. The MDNode::getTemporary() provides exactly the API
we need (and it is used in clang to generate the unique nodes).

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

llvm-svn: 221550
2014-11-07 21:44:18 +00:00
..
autoconf Added arcanist linters and cleaned errors and warnings 2014-08-18 00:40:13 +00:00
cmake [Polly] Remove the PoCC and ScopLib support 2014-08-13 17:49:16 +00:00
docs
include [Refactor][NFC] Generalize the creation of ScopArrayInfo objects. 2014-11-07 08:31:31 +00:00
lib Safely generate new loop metadata node 2014-11-07 21:44:18 +00:00
test Safely generate new loop metadata node 2014-11-07 21:44:18 +00:00
tools
utils Revert "Temporary disable formatting error" 2014-11-03 22:11:20 +00:00
www [www] Update formatting of news feed 2014-09-22 07:37:12 +00:00
.arcconfig Added arcanist (arc) unit test support 2014-09-08 19:30:09 +00:00
.arclint Added arcanist linters and cleaned errors and warnings 2014-08-18 00:40:13 +00:00
.gitattributes
.gitignore Add test/lit.site.cfg to .gitignore 2014-09-07 15:03:30 +00:00
CMakeLists.txt Added arcanist linters and cleaned errors and warnings 2014-08-18 00:40:13 +00:00
CREDITS.txt Add myself to the credits 2014-08-10 03:37:29 +00:00
LICENSE.txt
Makefile
Makefile.common.in
Makefile.config.in [Polly] Remove the PoCC and ScopLib support 2014-08-13 17:49:16 +00:00
README
configure [Polly] Remove the PoCC and ScopLib support 2014-08-13 17:49:16 +00:00

README

Polly - Polyhedral optimizations for LLVM
-----------------------------------------
http://polly.llvm.org/

Polly uses a mathematical representation, the polyhedral model, to represent and
transform loops and other control flow structures. Using an abstract
representation it is possible to reason about transformations in a more general
way and to use highly optimized linear programming libraries to figure out the
optimal loop structure. These transformations can be used to do constant
propagation through arrays, remove dead loop iterations, optimize loops for
cache locality, optimize arrays, apply advanced automatic parallelization, drive
vectorization, or they can be used to do software pipelining.