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-06-25 21:00:29 +08:00
2025-07-02 15:07:48 +01:00
2025-07-02 15:07:48 +01:00
2025-05-07 14:30:47 +08:00
2025-05-20 18:28:08 +08:00
2025-05-20 18:28:08 +08:00
2025-03-21 10:15:31 +08:00
2024-07-22 15:10:21 +08:00
2025-05-20 18:28:08 +08:00
2025-05-20 18:28:08 +08:00
2025-05-20 18:28:08 +08:00
2025-06-09 11:15:41 +08:00
2025-06-09 11:15:41 +08:00
2025-05-20 18:28:08 +08:00
2024-08-08 23:05:38 +08:00
2024-05-14 20:23:04 +08:00
2025-05-20 18:28:08 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2025-05-20 18:28:08 +08:00
2024-05-14 20:23:04 +08:00
2025-05-28 11:06:08 +08:00
2024-05-14 20:23:04 +08:00
2025-05-20 18:28:08 +08:00
2025-05-20 18:28:08 +08:00
2025-05-20 18:28:08 +08:00
2025-05-20 18:28:08 +08:00
2025-03-21 10:15:31 +08:00
2025-06-03 14:25:46 +08:00
2025-06-25 21:00:29 +08:00
2025-03-21 10:15:31 +08:00
2025-03-21 10:15:31 +08:00
2025-03-21 10:15:31 +08:00
2023-10-19 09:20:27 +08:00
2024-03-05 09:15:44 +08:00
2025-05-07 14:30:47 +08:00
2024-05-14 20:23:04 +08:00
2024-07-23 15:14:20 +08:00
2025-05-23 09:30:29 +08:00
2025-06-16 15:55:26 +01:00
2025-05-20 18:28:08 +08:00
2025-05-07 14:30:47 +08:00
2023-11-29 15:21:21 +08:00
2024-10-31 15:58:15 +08:00
2025-03-21 10:15:31 +08:00
2025-03-21 10:15:31 +08:00
2024-05-14 20:23:04 +08:00
2024-11-11 16:46:22 +08:00
2025-05-07 14:30:47 +08:00
2024-05-14 20:23:04 +08:00
2024-06-12 17:41:26 +08:00
2025-05-20 18:28:08 +08:00
2024-11-21 16:52:38 +08:00
2025-03-21 10:15:31 +08:00
2025-05-20 18:28:08 +08:00
2025-05-20 18:28:08 +08:00
2025-05-07 14:30:47 +08:00
2025-05-20 18:28:08 +08:00
2025-05-07 14:30:47 +08:00
2023-11-29 15:21:21 +08:00
2024-08-09 14:08:32 +08:00
2024-08-08 23:05:38 +08:00
2025-03-21 10:15:31 +08:00
2025-06-03 14:25:46 +08:00
2025-05-07 14:30:47 +08:00
2025-05-09 16:26:08 +08:00
2025-05-07 14:30:47 +08:00
2025-05-07 14:30:47 +08:00
2025-03-21 10:15:31 +08:00
2025-05-07 14:30:47 +08:00
2025-03-21 10:15:31 +08:00
2024-05-14 20:23:04 +08:00
2025-05-07 14:30:47 +08:00
2025-05-07 14:30:47 +08:00
2025-05-07 14:30:47 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-10-31 15:58:15 +08:00
2025-03-21 10:15:31 +08:00
2024-08-08 23:05:38 +08:00
2024-08-08 23:05:38 +08:00
2024-08-30 16:38:42 +08:00
2023-10-19 09:20:27 +08:00
2024-10-31 15:58:15 +08:00
2025-06-25 21:00:29 +08:00
2024-05-14 20:23:04 +08:00
2024-08-08 23:05:38 +08:00
2025-05-23 11:14:41 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2025-05-20 18:28:08 +08:00
2024-10-31 15:58:15 +08:00
2024-01-23 14:24:58 +08:00
2024-01-23 14:24:58 +08:00
2025-03-21 10:15:31 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-06-07 15:39:05 +08:00
2024-10-31 15:58:15 +08:00
2024-05-14 20:23:04 +08:00
2024-06-07 15:39:05 +08:00
2025-06-07 15:33:58 +08:00
2025-06-03 14:25:46 +08:00
2025-06-03 14:25:46 +08:00
2025-01-31 14:05:34 -08:00
2025-05-20 18:28:08 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2025-03-21 10:15:31 +08:00
2025-01-20 10:00:05 +08:00
2024-05-14 20:23:04 +08:00
2025-06-29 21:28:42 +03:00
2025-03-21 10:15:31 +08:00
2025-02-10 19:44:24 +08:00
2025-02-10 16:40:07 +08:00
2024-11-06 19:30:57 +08:00
2025-01-20 10:00:05 +08:00
2025-01-20 10:00:05 +08:00
2025-03-21 10:15:31 +08:00
2025-03-21 10:15:31 +08:00
2024-05-14 20:23:04 +08:00
2025-05-07 14:30:47 +08:00
2025-06-07 15:33:58 +08:00
2025-03-14 13:11:45 +01:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2025-04-16 14:12:00 +08:00
2025-01-20 16:11:09 +08:00
2025-01-03 16:43:39 +08:00
2024-06-12 22:02:47 +08:00
2024-05-14 20:23:04 +08:00
2025-05-20 18:28:08 +08:00
2024-07-16 20:56:18 +01:00
2024-05-14 20:23:04 +08:00
2025-05-20 18:28:08 +08:00
2024-05-14 20:23:04 +08:00
2025-03-21 10:15:31 +08:00
2025-05-20 18:28:08 +08:00
2025-03-21 10:15:31 +08:00
2025-05-20 18:28:08 +08:00
2025-05-07 14:30:47 +08:00
2025-06-07 15:33:58 +08:00
2025-05-07 14:30:47 +08:00
2025-03-21 10:15:31 +08:00
2025-05-20 18:28:08 +08:00
2025-05-07 14:30:47 +08:00
2024-10-31 15:58:15 +08:00
2025-05-07 14:30:47 +08:00
2024-05-14 20:23:04 +08:00
2025-03-21 10:15:31 +08:00
2025-03-21 10:15:31 +08:00
2024-10-31 15:58:15 +08:00
2024-05-16 16:54:18 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00
2025-05-07 14:30:47 +08:00
2024-05-14 20:23:04 +08:00
2025-05-20 18:28:08 +08:00
2024-07-31 17:18:27 -07:00
2024-05-14 20:23:04 +08:00
2025-05-07 14:30:47 +08:00
2025-03-21 10:15:31 +08:00
2025-05-21 14:21:12 +08:00
2024-05-14 20:23:04 +08:00
2024-05-14 20:23:04 +08:00