Valery Pykhtin
f054947c0d
[SimplifyCFG] Prevent merging cbranch to cbranch if the branch probability from the first to second is too low. ( #69375 )
...
AMDGPU target has faced the situation which can be illustrated with the
following testcase:
define void @dont_merge_cbranches(i32 %V) {
%divergent_cond = icmp ne i32 %V, 0
%uniform_cond = call i1 @uniform_result(i1 %divergent_cond)
br i1 %uniform_cond, label %bb2, label %exit, !prof !0
bb2:
br i1 %divergent_cond, label %bb3, label %exit
bb3:
call void @bar( )
br label %exit
exit:
ret void
}
!0 = !{!"branch_weights", i32 1, i32 100000}
SimplifyCFG merges branches on %uniform_cond and %divergent_cond which is undesirable because the first branch to bb2 is taken extremely rare and the second branch is expensive. The merged branch becomes as expensive as the second.
This patch prevents such merging if the branch to the second branch is unlikely to happen.
2023-11-13 15:37:55 +01:00
..
2023-05-17 17:03:15 +02:00
2023-05-17 17:03:15 +02:00
2023-05-17 17:03:15 +02:00
2023-05-17 17:03:15 +02:00
2023-05-17 17:03:15 +02:00
2023-05-17 17:03:15 +02:00
2023-05-19 14:10:05 +09:00
2023-05-17 17:03:15 +02:00
2023-09-14 21:26:11 +09: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
2022-12-14 15:14:12 +01: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
2022-12-14 15:14:12 +01:00
2023-01-03 12:38:25 +01:00
2023-11-13 15:37:55 +01:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2023-06-28 14:31:48 +02: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
2022-12-14 15:14:12 +01:00
2023-10-28 17:10:20 +08:00
2023-01-03 14:52:48 +01: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
2023-02-16 17:58:33 -08: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
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-09 17:44:32 +07: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
2023-01-13 01:18:56 +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-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
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-05 21:12:20 +03:00
2023-06-30 21:24:05 +02:00
2022-12-14 15:14:12 +01:00
2023-09-22 18:29:59 +08:00
2023-09-22 18:29:59 +08:00
2022-09-05 15:13:46 +01:00
2023-09-22 18:29:59 +08:00
2022-12-14 15:14:12 +01:00
2022-12-20 18:36:42 +03:00
2022-12-14 15:14:12 +01:00
2023-08-17 09:59:07 +01:00
2023-09-22 18:29:59 +08:00
2023-10-30 09:04:04 +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
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-01-13 01:18:56 +03:00
2022-12-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2022-12-19 00:24:28 +03:00
2022-12-05 21:12:20 +03:00
2023-03-24 14:31:40 +01:00
2023-04-27 13:04:17 -07:00
2023-04-27 13:04:17 -07:00
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2023-10-28 17:10:20 +08:00
2023-10-28 17:10:20 +08: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
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
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-14 15:14:12 +01: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
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-08-21 12:05:32 +02: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-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
2023-05-19 14:10:05 +09: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-01-04 16:27:49 +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-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
2022-12-08 02:38:51 +03:00
2022-12-14 15:14:12 +01:00
2023-07-12 14:35:55 +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-05 21:12:20 +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-14 15:14:12 +01:00
2022-12-14 15:14:12 +01:00
2023-11-09 12:33:24 +08: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-05 21:12:20 +03:00
2022-02-17 12:13:55 +03:00
2022-12-05 21:12:20 +03: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
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-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
2022-12-05 21:12:20 +03:00
2022-12-05 21:12:20 +03:00
2023-07-31 13:44:52 -07: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
2023-01-13 21:04:17 +03:00