woruyu
bbcebec3af
[DAG] Refactor X86 combineVSelectWithAllOnesOrZeros fold into a generic DAG Combine ( #145298 )
...
This PR resolves https://github.com/llvm/llvm-project/issues/144513
The modification include five pattern :
1.vselect Cond, 0, 0 → 0
2.vselect Cond, -1, 0 → bitcast Cond
3.vselect Cond, -1, x → or Cond, x
4.vselect Cond, x, 0 → and Cond, x
5.vselect Cond, 000..., X -> andn Cond, X
1-4 have been migrated to DAGCombine. 5 still in x86 code.
The reason is that you cannot use the andn instruction directly in
DAGCombine, you can only use and+xor, which will introduce optimization
order issues. For example, in the x86 backend, select Cond, 0, x →
(~Cond) & x, the backend will first check whether the cond node of
(~Cond) is a setcc node. If so, it will modify the comparison operator
of the condition.So the x86 backend cannot complete the optimization of
andn.In short, I think it is a better choice to keep the pattern of
vselect Cond, 000..., X instead of and+xor in combineDAG.
For commit, the first is code changes and x86 test(note 1), the second
is tests in other backend(node 2).
---------
Co-authored-by: Simon Pilgrim <llvm-dev@redking.me.uk >
2025-07-02 15:07:48 +01:00
..
2025-03-30 22:03:14 -07:00
2025-02-14 09:28:57 +01:00
2025-04-04 16:02:39 -07:00
2024-10-17 20:25:06 +08:00
2024-10-17 20:25:06 +08:00
2024-12-02 11:46:49 +00:00
2024-10-25 09:34:08 +01:00
2024-10-25 09:34:08 +01:00
2024-12-07 10:14:36 +03:00
2025-02-05 23:29:02 +07:00
2025-06-11 22:19:31 -07:00
2025-06-11 22:19:31 -07:00
2025-06-29 21:28:42 +03:00
2024-12-07 10:14:36 +03:00
2025-05-30 19:36:29 +01:00
2025-02-05 23:29:02 +07:00
2025-02-01 20:40:50 +03:00
2025-02-25 15:29:12 -08:00
2025-02-05 23:29:02 +07:00
2024-12-07 10:14:36 +03:00
2024-10-17 20:25:06 +08:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2025-04-28 11:21:51 +01:00
2025-02-05 23:29:02 +07:00
2025-02-05 23:29:02 +07:00
2024-12-07 10:14:36 +03:00
2025-05-22 13:21:26 +01:00
2024-12-06 08:51:22 +00:00
2024-10-17 20:25:06 +08:00
2024-12-07 10:14:36 +03:00
2024-11-18 11:02:01 +05:30
2024-11-06 10:35:44 +00:00
2024-10-14 15:48:12 +01:00
2024-11-01 09:36:13 +00:00
2025-05-06 12:50:50 +01:00
2025-02-12 18:54:39 +05:30
2024-12-07 10:14:36 +03:00
2025-06-29 21:28:42 +03:00
2024-11-02 19:06:27 +08:00
2024-12-16 12:15:11 +01:00
2025-03-24 11:34:45 +05:30
2024-10-17 20:25:06 +08:00
2025-03-14 15:50:49 +00:00
2025-06-23 18:49:30 +02:00
2025-06-23 18:49:30 +02:00
2025-03-30 22:03:14 -07:00
2025-03-06 09:28:44 -08:00
2024-12-07 10:14:36 +03:00
2024-10-17 20:25:06 +08:00
2024-12-07 10:14:36 +03:00
2025-06-04 17:34:29 +09:00
2024-10-19 06:13:15 -07:00
2025-04-28 11:21:51 +01:00
2025-05-30 19:36:29 +01:00
2024-11-22 22:29:58 +03:00
2025-05-30 19:36:29 +01:00
2024-10-25 09:34:08 +01:00
2025-06-02 18:21:14 +08:00
2025-06-02 18:21:14 +08:00
2025-06-02 18:21:14 +08:00
2024-10-25 09:34:08 +01:00
2024-11-12 13:34:29 -08:00
2025-07-02 15:07:48 +01:00
2025-06-29 11:15:56 +01:00
2025-06-10 10:46:29 +09:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-10-17 20:25:06 +08:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2025-06-11 22:19:31 -07:00
2025-06-11 22:19:31 -07:00
2025-06-11 22:19:31 -07:00
2025-03-30 22:03:14 -07:00
2024-12-07 10:14:36 +03:00
2024-10-17 20:25:06 +08:00
2025-06-25 09:30:26 +02:00
2025-03-06 09:28:44 -08:00
2025-04-22 14:31:29 -05:00
2025-04-22 14:31:29 -05:00
2025-03-06 09:28:44 -08:00
2024-11-05 17:28:52 -08:00
2025-04-04 16:02:39 -07:00
2025-05-18 20:09:43 +01:00
2025-03-30 22:03:14 -07:00
2025-03-05 13:45:48 +00:00
2024-10-29 10:52:20 +00:00
2025-03-30 22:03:14 -07:00
2025-03-30 22:03:14 -07:00
2025-01-14 22:41:31 +00:00
2025-02-04 15:45:03 +05:30
2025-03-03 15:49:37 +05:30
2025-02-10 09:13:02 +00:00
2025-07-02 15:07:48 +01:00
2025-03-04 17:46:44 +01:00
2024-10-25 09:34:09 +01:00
2024-10-18 09:35:42 +04:00
2025-06-23 16:33:35 +09:00
2025-06-23 16:33:35 +09:00
2024-12-07 10:14:36 +03:00
2025-02-05 23:29:02 +07:00
2025-02-05 23:29:02 +07:00
2025-05-15 16:05:15 +08:00
2025-03-14 13:11:45 +01:00
2024-12-07 10:14:36 +03:00
2025-04-24 10:13:05 +03:00
2024-10-20 13:53:26 +01:00
2025-02-06 22:56:56 +07:00
2025-04-08 10:11:20 -07:00
2025-04-04 15:39:24 -07:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2025-01-11 16:29:06 +00:00
2024-12-07 10:14:36 +03:00
2025-06-29 21:28:42 +03:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2025-05-22 07:59:57 +03:00
2025-05-05 22:08:48 +02:00
2024-12-12 11:24:07 +08:00
2025-01-07 09:39:05 +01:00
2024-11-27 08:03:47 +03:00
2025-06-23 16:33:35 +09:00
2025-06-23 16:33:35 +09:00
2025-06-23 16:33:35 +09:00
2025-06-23 16:33:35 +09:00
2025-06-25 07:08:46 +01:00
2025-03-06 20:06:35 +07:00
2025-03-06 20:06:35 +07:00
2024-11-05 14:42:15 +00:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-10-17 20:25:06 +08:00
2025-03-30 22:03:14 -07:00
2025-03-30 22:03:14 -07:00
2024-10-17 20:25:06 +08:00
2025-06-29 21:28:42 +03:00
2024-12-07 10:14:36 +03:00
2025-06-29 21:28:42 +03:00
2025-05-22 07:59:57 +03:00
2025-05-18 20:09:43 +01:00
2024-10-23 09:06:12 +01:00
2025-02-03 23:48:28 +07:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-11-19 17:46:48 +03:00
2025-06-29 11:15:56 +01:00
2025-06-29 11:15:56 +01:00
2024-12-07 10:14:36 +03:00
2024-12-07 10:14:36 +03:00
2024-10-17 20:25:06 +08:00
2025-02-05 23:29:02 +07:00
2025-03-07 14:46:32 +00:00
2025-03-07 14:46:32 +00:00
2025-02-01 20:40:50 +03:00
2025-01-16 08:17:55 +00:00
2024-12-04 14:32:15 +00:00
2025-02-05 23:29:02 +07:00
2025-02-05 12:45:59 +05:30
2025-06-02 18:21:14 +08:00
2025-06-02 18:21:14 +08:00
2025-02-05 23:29:02 +07:00
2025-02-24 11:09:41 +00:00
2025-07-01 15:41:10 +01:00
2025-05-31 12:21:46 +01:00
2024-12-07 10:14:36 +03:00
2025-02-05 23:29:02 +07:00
2025-02-05 23:29:02 +07:00
2024-12-07 10:14:36 +03:00
2025-04-04 16:02:39 -07:00