1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/Transforms
Max Kazantsev 4e5297ed76 [LSR] Fix Shadow IV in case of integer overflow
When LSR processes code like

  int accumulator = 0;
  for (int i = 0; i < N; i++) {
    accummulator += i;
    use((double) accummulator);
  }

It may decide to replace integer `accumulator` with a double Shadow IV to get rid
of casts.  The problem with that is that the `accumulator`'s value may overflow.
Starting from this moment, the behavior of integer and double accumulators
will differ.

This patch strenghtens up the conditions of Shadow IV mechanism applicability.
We only allow it for IVs that are proved to be `AddRec`s with `nsw`/`nuw` flag.

Differential Revision: https://reviews.llvm.org/D37209

llvm-svn: 311986
2017-08-29 07:32:20 +00:00
..
Coroutines [coroutines] Add support for symmetric control transfer (musttail on coro.resumes followed by a suspend) 2017-08-25 02:25:10 +00:00
Hello
InstCombine [InstCombine] Teach foldSelectICmpAndOr to handle vector splats 2017-08-29 00:13:49 +00:00
Instrumentation [sanitizer-coverage] Mark the guard and 8-bit counter arrays as used 2017-08-29 00:11:05 +00:00
IPO [Inliner] Only compute fully inline cost when remarks are enabled. 2017-08-25 22:01:42 +00:00
ObjCARC Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
Scalar [LSR] Fix Shadow IV in case of integer overflow 2017-08-29 07:32:20 +00:00
Utils [LoopUnroll] Properly update loop structure in case of successful peeling. 2017-08-28 20:29:33 +00:00
Vectorize [LV] Fix PR34248 - recommit D32871 after revert r311304 2017-08-27 12:55:46 +00:00
CMakeLists.txt
LLVMBuild.txt