Pedro Lobo
76d614b7c1
[InstSimplify] Extend icmp-of-add simplification to sle/sgt/sge ( #168900 )
...
When comparing additions with the same base where one has `nsw`, the
following simplification can be performed:
```llvm
icmp slt/sgt/sle/sge (x + C1), (x +nsw C2)
=>
icmp slt/sgt/sle/sge C1, C2
```
Previously this was only done for `slt`. This patch extends it to the
`sgt`, `sle`, and `sge` predicates when either of the conditions hold:
- `C1 <= C2 && C1 >= 0`, or
- `C2 <= C1 && C1 <= 0`
This patch also handles the `C1 == C2` case, which was previously
excluded.
Proof: https://alive2.llvm.org/ce/z/LtmY4f
2025-11-20 21:35:14 +00:00
..
2025-11-18 14:33:43 +00:00
2025-11-19 15:50:36 -08:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-07-16 11:40:04 +02:00
2024-11-06 11:53:33 +00:00
2025-02-04 22:53:33 +01:00
2024-12-10 15:42:05 +00:00
2024-11-06 11:53:33 +00:00
2025-07-04 22:55:07 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-14 11:55:19 +01:00
2024-11-21 11:21:12 +00:00
2025-11-20 21:35:14 +00:00
2025-08-22 17:33:00 +01:00
2025-08-22 17:33:00 +01:00
2025-09-25 16:19:11 +01:00
2025-09-25 16:19:11 +01:00
2025-08-22 17:33:00 +01:00
2025-01-16 14:38:51 +00:00
2025-08-22 17:33:00 +01:00
2025-08-01 10:31:43 +01:00
2024-06-13 20:20:27 +01:00
2025-01-30 20:58:38 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-15 14:19:50 +00:00
2025-05-30 11:27:18 +01:00
2024-11-06 11:53:33 +00:00
2025-10-05 16:15:51 +08:00
2025-07-19 19:37:21 -07:00
2024-11-21 12:39:53 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-03-09 21:10:35 +08:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-08-10 22:55:04 +08:00
2024-11-06 11:53:33 +00:00
2025-11-15 03:05:30 +08:00
2025-09-07 18:32:40 +01:00
2024-11-21 11:21:12 +00:00
2025-06-11 13:27:14 +02:00
2024-11-06 11:53:33 +00:00
2025-10-20 11:20:09 +01:00
2025-05-01 14:21:59 -07:00
2025-09-24 11:35:15 +01:00
2025-04-30 15:01:00 +02:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-03-01 12:02:57 -05:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-07-09 14:44:48 -07:00
2025-01-29 23:14:36 +08:00
2024-11-06 11:53:33 +00:00
2024-11-19 20:10:40 +08:00
2025-05-02 07:49:27 +08:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-12-09 16:44:05 +01:00
2024-11-07 14:09:45 +01:00
2024-11-06 11:53:33 +00:00
2025-01-20 12:19:07 -05:00
2025-10-10 08:03:25 +00:00
2025-10-14 13:55:04 +02:00
2025-10-21 09:27:07 +02:00
2025-10-07 17:19:48 +02:00
2024-11-06 11:53:33 +00:00
2024-11-15 14:19:50 +00:00
2024-11-06 11:53:33 +00:00
2025-07-04 22:55:07 +01:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2024-10-14 14:08:12 +01:00
2024-12-17 10:58:52 +01:00
2025-02-02 19:04:23 +08:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-02-01 08:48:32 +01:00
2025-08-04 14:51:03 +05:30
2024-11-06 11:53:33 +00:00
2025-04-10 19:29:28 +02:00
2024-11-06 11:53:33 +00:00
2025-06-10 12:50:16 -07:00
2024-12-09 16:44:05 +01:00
2025-07-16 08:35:13 -07:00
2024-11-06 11:53:33 +00:00
2025-01-11 15:10:42 -06:00
2025-06-22 13:32:19 +08:00
2024-11-06 11:53:33 +00:00
2024-11-06 11:53:33 +00:00
2025-04-03 18:03:16 +01:00
2024-11-06 11:53:33 +00:00
2025-06-16 10:07:56 -07:00
2025-04-03 16:24:56 +01:00
2025-04-03 16:24:56 +01:00
2024-11-06 11:53:33 +00:00