Roman Lebedev
25aebe2ccf
[LoopIdiom] 'left-shift-until-bittest': keep no-wrap flags on shift, fix edge-case miscompilation for %x.next
...
While `%x.curr` is always safe to compute, because `LoopBackedgeTakenCount`
will always be smaller than `bitwidth(X)`, i.e. we never get poison,
rewriting `%x.next` is more complicated, however, because `X << LoopTripCount`
will be poison iff `LoopTripCount == bitwidth(X)` (which will happen
iff `BitPos` is `bitwidth(x) - 1` and `X` is `1`).
So unless we know that isn't the case (as alive2 notes, we know it's safe
to do iff shift had no-wrap flags, or bitpos does not indicate signbit,
or we know that %x is never `1`), we'll need to emit an alternative,
safe IR, by either just shifting the `%x.curr`, or conditionally selecting
between the computed `%x.next` and `0`..
Former IR looks better so let's do that.
While there, ensure that we don't drop no-wrap flags from said shift.
2020-12-24 21:20:52 +03:00
..
2020-12-17 01:03:49 +03:00
2020-12-21 15:22:27 +00:00
2020-09-12 15:36:06 +02:00
2020-12-09 08:51:38 -08:00
2020-11-20 13:30:12 +00:00
2020-12-24 11:46:17 +09:00
2020-12-24 11:46:17 +09:00
2020-10-21 12:51:11 -07:00
2020-12-18 00:37:22 +03:00
2020-11-19 11:22:23 -08:00
2020-12-18 17:06:17 -08:00
2020-12-24 11:46:17 +09:00
2020-11-13 23:29:58 -08:00
2020-12-06 20:19:15 +00:00
2020-12-22 10:52:28 -08:00
2020-12-13 21:00:32 +01:00
2020-11-17 20:41:05 -08:00
2020-11-20 17:58:26 -05:00
2020-12-18 20:26:53 +01:00
2020-11-20 17:58:26 -05:00
2020-10-09 09:22:09 -07:00
2020-11-23 21:09:41 -08:00
2020-11-13 09:28:21 -08:00
2020-09-13 00:07:31 -07:00
2020-12-17 01:03:49 +03:00
2020-12-04 11:05:01 -08:00
2020-12-24 11:46:17 +09:00
2020-12-20 00:18:32 +03:00
2020-12-09 08:51:38 -08:00
2020-09-14 16:06:19 -07:00
2020-12-18 17:06:17 -08:00
2020-12-20 00:18:33 +03:00
2020-12-24 11:46:17 +09:00
2020-12-24 11:46:17 +09:00
2020-12-17 01:03:49 +03:00
2020-12-24 21:20:50 +03:00
2020-11-20 17:58:26 -05:00
2020-10-22 12:08:36 -07:00
2020-12-24 11:46:17 +09:00
2020-11-09 13:12:40 +00:00
2020-12-14 12:01:19 +00:00
2020-12-23 19:42:35 -06:00
2020-12-23 22:47:36 +07:00
2020-12-17 16:17:32 +00:00
2020-12-17 01:03:49 +03:00
2020-12-24 11:46:17 +09:00
2020-12-22 17:49:20 +00:00
2020-10-24 21:40:46 +08:00
2020-12-07 19:34:31 -08:00
2020-12-07 17:37:42 -08:00
2020-12-24 21:20:52 +03:00
2020-12-17 01:03:49 +03:00
2020-11-26 10:51:11 +07:00
2020-10-25 18:00:22 +01:00
2020-12-08 09:59:31 -08:00
2020-12-17 01:03:49 +03:00
2020-09-21 08:27:19 -07:00
2020-12-24 11:46:17 +09:00
2020-12-24 11:46:17 +09:00
2020-11-23 13:04:05 -08:00
2020-12-18 17:37:17 +00:00
2020-12-22 09:47:19 -08:00
2020-12-18 17:59:12 +00:00
2020-12-07 21:54:38 -08:00
2020-11-14 13:12:38 +03:00
2020-11-19 18:16:35 -08:00
2020-09-15 18:18:31 -07:00
2020-12-09 08:51:38 -08:00
2020-12-09 08:51:38 -08:00
2020-11-20 17:58:26 -05:00
2020-12-01 16:50:55 +01:00
2020-11-20 17:58:26 -05:00
2020-11-19 11:22:23 -08:00
2020-12-04 16:17:50 +07:00
2020-12-24 11:46:17 +09:00
2020-12-18 16:59:06 -08:00
2020-12-15 16:51:34 -06:00
2020-11-02 14:32:45 -05:00
2020-12-24 11:46:17 +09:00
2020-12-24 11:46:17 +09:00
2020-10-26 20:07:37 -07:00
2020-10-29 18:17:55 -07:00
2020-11-18 17:55:02 +03:00
2020-11-08 11:14:05 +00:00
2020-12-24 11:46:17 +09:00
2020-11-20 14:00:46 -05:00
2020-12-16 15:57:18 -08:00
2020-12-24 11:46:17 +09:00
2020-12-17 01:03:49 +03:00
2020-11-09 17:42:36 -08:00
2020-11-20 17:58:26 -05:00
2020-12-24 11:46:17 +09:00
2020-10-09 16:20:26 -07:00
2020-12-24 11:46:17 +09:00
2020-12-24 11:46:17 +09:00
2020-11-29 21:19:48 +09:00
2020-11-17 14:41:01 +08:00
2020-09-15 18:25:12 -07:00
2020-12-24 11:46:17 +09:00
2020-11-20 17:58:26 -05:00
2020-11-19 14:59:05 -08:00
2020-10-20 10:33:58 -07:00
2020-10-20 10:46:57 -07:00
2020-11-09 12:54:13 -08:00
2020-11-16 14:57:11 +00:00
2020-12-24 11:46:17 +09:00
2020-09-30 17:27:37 -07:00
2020-12-09 08:51:38 -08:00