Max Kazantsev
b074309e70
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311986 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-29 07:32:20 +00:00
..
2016-06-06 19:10:46 +00:00
2017-03-21 21:39:51 +00:00
2017-04-20 19:54:02 +00:00
2015-08-20 20:59:02 +00:00
2017-08-29 07:32:20 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 18:43:29 +00:00
2015-06-24 19:28:40 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2013-07-14 01:42:54 +00:00
2017-07-06 15:52:14 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 18:43:29 +00:00
2015-04-16 23:24:18 +00:00
2015-06-17 20:52:32 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 19:29:02 +00:00
2015-07-13 03:28:53 +00:00
2012-12-30 01:28:40 +00:00
2016-02-03 21:30:34 +00:00
2015-02-27 19:29:02 +00:00
2017-08-24 10:00:25 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2016-07-18 21:41:50 +00:00
2015-05-08 18:07:24 +00:00
2015-03-04 18:43:29 +00:00
2017-05-27 03:22:55 +00:00
2010-03-02 01:59:21 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2017-05-26 06:47:04 +00:00
2016-08-15 07:53:03 +00:00
2010-04-07 22:53:17 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2017-07-28 20:21:02 +00:00
2015-02-27 19:29:02 +00:00
2015-03-04 18:43:29 +00:00
2015-04-16 23:24:18 +00:00
2015-12-12 05:38:55 +00:00
2017-08-04 18:46:13 +00:00
2017-01-13 22:24:27 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-03-04 18:43:29 +00:00
2015-02-27 19:29:02 +00:00
2016-06-06 19:10:46 +00:00
2017-08-04 20:19:46 +00:00
2015-02-27 21:17:42 +00:00
2015-06-24 19:28:40 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-03-04 18:43:29 +00:00