Alon Kom
8e5aa969d0
[SCEV] Preserve divisibility and min/max information in applyLoopGuards
...
applyLoopGuards doesn't always preserve information when there are multiple assumes.
This patch tries to deal with multiple assumes regarding a SCEV's divisibility and min/max values, and rewrite it into a SCEV that still preserves all of the information.
For example, let the trip count of the loop be TC. Consider the 3 following assumes:
1. __builtin_assume(TC % 8 == 0);
2. __builtin_assume(TC > 0);
3. __builtin_assume(TC < 100);
Before this patch, depending on the assume processing order applyLoopGuards could create the following SCEV:
max(min((8 * (TC / 8)) , 99), 1)
Looking at this SCEV, it doesn't preserve the divisibility by 8 information.
After this patch, depending on the assume processing order applyLoopGuards could create the following SCEV:
max(min((8 * (TC / 8)) , 96), 8)
By aligning up 1 to 8, and aligning down 99 to 96, the new SCEV still preserves all of the original assumes.
Differential Revision: https://reviews.llvm.org/D144947
2023-03-20 12:04:05 +02:00
..
2022-12-15 10:00:45 +01:00
2022-12-09 01:04:45 +03:00
2022-12-01 21:25:59 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-11-24 18:43:42 +07:00
2022-11-24 18:43:42 +07:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-01 21:25:59 +01:00
2022-10-07 14:54:34 -07:00
2022-12-15 10:00:45 +01:00
2022-10-07 14:54:34 -07:00
2022-12-09 01:04:45 +03:00
2022-12-16 13:12:27 +01:00
2022-12-12 20:41:56 +03:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-09 01:04:45 +03:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-11-24 19:29:58 +07:00
2022-11-24 18:43:42 +07:00
2023-03-07 17:10:34 +01:00
2023-03-07 17:10:34 +01:00
2022-12-01 21:25:59 +01:00
2022-12-15 10:00:45 +01:00
2023-02-20 16:12:58 +07:00
2022-12-01 21:25:59 +01:00
2023-03-14 10:55:02 +01:00
2022-12-15 10:00:45 +01:00
2022-11-24 19:29:58 +07:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2023-02-20 18:38:07 +07:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-11-24 18:43:42 +07:00
2022-12-01 21:25:59 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-16 13:12:27 +01:00
2023-03-16 10:32:08 +01:00
2022-12-15 10:00:45 +01:00
2023-03-14 00:06:08 +07:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-11-24 19:29:58 +07:00
2023-02-18 23:58:23 -08:00
2022-12-16 14:32:36 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-10-07 14:54:34 -07:00
2022-12-15 10:00:45 +01:00
2023-02-23 19:59:25 +00:00
2022-12-16 13:12:27 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-11-25 11:41:36 +07:00
2022-11-25 11:41:36 +07:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-01 21:25:59 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-11-24 18:43:42 +07:00
2022-12-15 10:00:45 +01:00
2022-12-01 21:25:59 +01:00
2022-12-15 10:00:45 +01:00
2022-11-25 11:41:36 +07:00
2022-12-15 10:00:45 +01:00
2022-12-09 22:14:04 +00:00
2022-12-15 10:00:45 +01:00
2022-12-16 13:12:27 +01:00
2023-02-20 16:12:58 +07:00
2023-02-20 16:12:58 +07:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2023-03-17 10:07:39 +01:00
2022-12-16 14:32:36 +01:00
2022-12-01 21:25:59 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-01 21:25:59 +01:00
2023-03-17 14:27:03 +01:00
2022-12-09 01:04:45 +03:00
2022-12-15 10:00:45 +01:00
2022-12-09 01:04:45 +03:00
2022-12-15 10:00:45 +01:00
2022-12-16 13:12:27 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-12-16 14:32:36 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-11-24 19:29:58 +07:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-16 13:12:27 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-11-24 19:29:58 +07:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2022-11-24 18:43:42 +07:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-11-24 19:29:58 +07:00
2022-11-24 19:29:58 +07:00
2022-12-15 10:00:45 +01:00
2023-02-20 13:05:00 +07:00
2022-12-15 10:00:45 +01:00
2022-11-25 11:41:36 +07:00
2022-11-24 18:43:42 +07:00
2022-11-24 18:43:42 +07:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2023-03-20 12:04:05 +02:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2023-03-07 17:10:34 +01:00
2022-12-15 10:00:45 +01:00
2023-03-07 17:10:34 +01:00
2023-02-18 23:58:23 -08:00
2022-12-15 10:00:45 +01:00