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