llvm-project/llvm/lib/Transforms
Sanjoy Das 7a2e2bed67 [LICM] Keep metadata on control equivalent hoists
Summary:
If the instruction we're hoisting out of a loop into its preheader is
guaranteed to have executed in the loop, then the metadata associated
with the instruction (e.g. !range or !dereferenceable) is valid in the
preheader.  This is because once we're in the preheader, we know we're
eventually going to reach the location the metadata was valid at.

This change makes LICM smarter around this, and helps it recognize cases
like these:

```
  do {
    int a = *ptr; !range !0
    ...
  } while (i++ < N);
```

to

```
  int a = *ptr; !range !0
  do {
    ...
  } while (i++ < N);
```

Earlier we'd drop the `!range` metadata after hoisting the load from
`ptr`.

Reviewers: igor-laevsky

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 259053
2016-01-28 15:51:58 +00:00
..
Hello Remove autoconf support 2016-01-26 21:29:08 +00:00
IPO Remove autoconf support 2016-01-26 21:29:08 +00:00
InstCombine less indenting; NFCI 2016-01-28 00:03:16 +00:00
Instrumentation Move SafeStack to CodeGen. 2016-01-27 16:53:42 +00:00
ObjCARC Add support for objc_unsafeClaimAutoreleasedReturnValue to the 2016-01-27 19:05:08 +00:00
Scalar [LICM] Keep metadata on control equivalent hoists 2016-01-28 15:51:58 +00:00
Utils Minor code formatting cleanup. NFC. 2016-01-28 01:23:18 +00:00
Vectorize Reapply commit r258404 with fix 2016-01-27 13:43:27 +00:00
CMakeLists.txt
LLVMBuild.txt