Yingwei Zheng
4997af98a0
[SimplifyCFG] Simplify nested branches ( #97067 )
...
This patch folds the following pattern (I don't know what to call this):
```
bb0:
br i1 %cond1, label %bb1, label %bb2
bb1:
br i1 %cond2, label %bb3, label %bb4
bb2:
br i1 %cond2, label %bb4, label %bb3
bb3:
...
bb4:
...
```
into
```
bb0:
%cond = xor i1 %cond1, %cond2
br i1 %cond, label %bb4, label %bb3
bb3:
...
bb4:
...
```
Alive2: https://alive2.llvm.org/ce/z/5iOJEL
Closes https://github.com/llvm/llvm-project/issues/97022.
Closes https://github.com/llvm/llvm-project/issues/83417.
I found this pattern in some verilator-generated code, which is widely
used in RTL simulation. This fold will reduces branches and improves the
performance of CPU frontend. To my surprise, this pattern is also common
in C/C++ code base.
Affected libraries/applications:
cmake/cvc5/freetype/git/gromacs/jq/linux/openblas/openmpi/openssl/php/postgres/ruby/sqlite/wireshark/z3/...
2024-07-01 03:35:39 +08:00
..
2023-05-17 17:03:15 +02:00
2023-05-17 17:03:15 +02:00
2024-06-07 11:51:51 +02:00
2024-06-27 07:23:59 +08:00
2023-05-17 17:03:15 +02:00
2023-05-17 17:03:15 +02:00
2024-06-08 21:32:34 +08:00
2023-05-17 17:03:15 +02:00
2024-06-17 08:48:30 +02:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-20 18:36:42 +03:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2024-06-04 08:31:03 +02:00
2022-12-14 15:14:12 +01:00
2023-01-13 01:18:56 +03:00
2022-12-14 15:14:12 +01:00
2023-06-30 21:24:05 +02:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2024-06-05 17:06:25 +02:00
2023-01-03 12:38:25 +01:00
2023-11-15 12:07:58 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2024-06-14 15:07:27 +01:00
2022-10-25 12:15:39 -04:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2024-06-05 15:33:56 +01:00
2023-10-28 17:10:20 +08:00
2024-07-01 03:35:39 +08:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-11-23 08:49:44 -05:00
2024-06-05 17:06:25 +02:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2023-04-28 10:03:32 +01:00
2023-11-20 20:53:24 +00:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2023-11-29 13:19:50 +00:00
2022-12-05 21:12:20 +03:00
2022-12-09 17:44:32 +07:00
2022-12-05 21:12:20 +03:00
2024-06-05 17:06:25 +02:00
2022-12-05 21:12:20 +03:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2024-06-05 17:06:25 +02:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-20 18:36:42 +03:00
2022-12-05 21:12:20 +03:00
2023-01-04 16:27:49 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2022-12-05 21:12:20 +03:00
2024-06-27 07:23:59 +08:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2022-09-05 15:13:46 +01:00
2024-06-05 17:06:25 +02:00
2024-06-14 15:07:27 +01:00
2024-06-14 15:07:27 +01:00
2022-12-14 15:14:12 +01:00
2023-08-17 09:59:07 +01:00
2024-06-05 17:06:25 +02:00
2024-05-27 16:05:17 +02:00
2024-06-29 10:39:02 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2023-01-13 01:18:56 +03:00
2023-01-13 01:18:56 +03:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2024-06-14 15:07:27 +01:00
2024-06-05 17:06:25 +02:00
2023-01-13 01:18:56 +03:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2023-12-06 14:17:18 +01:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2023-04-27 13:04:17 -07:00
2023-04-27 13:04:17 -07:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2024-04-24 08:52:25 +02:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2023-07-12 14:35:55 +02:00
2022-12-14 15:14:12 +01:00
2023-06-28 12:09:27 +02:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2023-06-16 13:53:31 -07:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2023-08-21 12:05:32 +02:00
2022-12-05 21:12:20 +03:00
2023-11-20 20:53:24 +00:00
2022-12-05 21:12:20 +03:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2024-06-05 17:06:25 +02:00
2024-06-14 15:07:27 +01:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2024-06-05 17:06:25 +02:00
2022-12-05 21:12:20 +03:00
2024-06-05 17:06:25 +02:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2023-07-25 06:46:19 -07:00
2022-12-14 15:14:12 +01:00
2024-06-14 15:07:27 +01:00
2024-06-05 17:06:25 +02:00
2023-07-12 14:35:55 +02:00
2024-04-23 12:39:35 +09:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2024-04-15 10:19:49 +08:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2024-06-05 17:06:25 +02:00
2022-12-05 21:12:20 +03:00
2024-05-25 10:38:19 +08:00
2024-05-25 10:38:44 +08:00
2024-06-05 17:06:25 +02:00
2023-07-31 13:44:52 -07:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2023-10-28 17:10:20 +08:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2024-06-05 17:06:25 +02:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2024-06-14 15:07:27 +01:00
2024-06-05 17:06:25 +02:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2022-12-08 11:47:16 +01:00
2022-12-14 15:14:12 +01:00
2022-12-05 21:12:20 +03:00
2022-12-14 15:14:12 +01:00
2024-01-25 06:42:14 +08:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2024-04-25 20:47:56 +08:00
2022-12-05 21:12:20 +03:00
2023-01-04 16:27:49 +01:00
2022-12-14 15:14:12 +01:00
2024-06-05 17:06:25 +02:00