Mahesh-Attarde
e61a7dc256
[X86][AVX512] Use comx for compare (#113567)
We added AVX10.2 COMEF ISA in LLVM, This does not optimize correctly in
scenario mentioned below.
Summary
Input
```
define i1 @oeq(float %x, float %y) {
%1 = fcmp oeq float %x, %y
ret i1 %1
}define i1 @une(float %x, float %y) {
%1 = fcmp une float %x, %y
ret i1 %1
}define i1 @ogt(float %x, float %y) {
%1 = fcmp ogt float %x, %y
ret i1 %1
}
// Prior AVX10.2, default code generation
oeq: # @oeq
cmpeqss xmm0, xmm1
movd eax, xmm0
and eax, 1
ret
une: # @une
cmpneqss xmm0, xmm1
movd eax, xmm0
and eax, 1
ret
ogt: # @ogt
ucomiss xmm0, xmm1
seta al
ret
```
This patch will remove `cmpeqss` and `cmpneqss`. For complete transform
check unit test.
Continuing on what PR https://github.com/llvm/llvm-project/pull/113098
added
Earlier Legalization and combine expanded `setcc oeq:ch` node into `and`
and `setcc eq` , `setcc o`. From suggestions in community
new internal transform
```
Optimized type-legalized selection DAG: %bb.0 'hoeq:'
SelectionDAG has 11 nodes:
t0: ch,glue = EntryToken
t2: f16,ch = CopyFromReg t0, Register:f16 %0
t4: f16,ch = CopyFromReg t0, Register:f16 %1
t14: i8 = setcc t2, t4, setoeq:ch
t10: ch,glue = CopyToReg t0, Register:i8 $al, t14
t11: ch = X86ISD::RET_GLUE t10, TargetConstant:i32<0>, Register:i8 $al, t10:1
Optimized legalized selection DAG: %bb.0 'hoeq:'
SelectionDAG has 12 nodes:
t0: ch,glue = EntryToken
t2: f16,ch = CopyFromReg t0, Register:f16 %0
t4: f16,ch = CopyFromReg t0, Register:f16 %1
t15: i32 = X86ISD::UCOMX t2, t4
t17: i8 = X86ISD::SETCC TargetConstant:i8<4>, t15
t10: ch,glue = CopyToReg t0, Register:i8 $al, t17
t11: ch = X86ISD::RET_GLUE t10, TargetConstant:i32<0>, Register:i8 $al, t10:1
```
Earlier transform is mentioned here
https://github.com/llvm/llvm-project/pull/113098#discussion_r1810307663
---------
Co-authored-by: mattarde <mattarde@intel.com>
2024-10-30 16:17:25 +08:00
..
2024-10-08 13:16:06 +01:00
2024-10-29 12:26:33 -07:00
2023-08-24 19:21:36 -07:00
2024-04-24 09:19:18 +02:00
2020-05-28 09:36:24 +00:00
2018-11-29 18:20:08 +00:00
2018-03-06 13:49:01 +00:00
2024-10-03 18:18:10 -07:00
2020-10-28 12:27:53 -04:00
2022-06-30 10:37:58 -07:00
2023-01-17 11:56:43 -08:00
2017-07-07 05:50:45 +00:00
2021-06-23 13:27:37 +07:00
2024-10-04 13:21:50 -07:00
2022-06-10 19:13:59 -07:00
2020-09-12 16:26:32 -04:00
2021-03-17 09:28:50 +00:00
2020-09-12 16:26:32 -04:00
2018-03-06 13:48:47 +00:00
2015-07-31 01:12:06 +00:00
2018-10-10 10:52:57 +00:00
2021-01-14 10:20:35 -05:00
2013-11-10 14:26:08 +00:00
2024-06-25 16:42:29 -05:00
2020-12-03 10:19:11 -05:00
2020-07-27 09:41:10 -06:00
2020-11-13 09:57:27 -05:00
2022-09-19 14:22:43 +08:00
2024-03-27 12:19:28 -07:00
2019-01-25 10:25:25 +00:00
2020-10-31 10:54:33 -04:00
2019-01-25 10:25:25 +00:00
2020-09-12 16:26:32 -04:00
2019-01-25 10:25:25 +00:00
2021-11-03 11:55:07 +00:00
2019-01-25 10:25:25 +00:00
2020-11-05 09:07:21 -05:00
2022-09-27 23:48:16 -07:00
2022-09-27 23:48:16 -07:00
2024-03-20 13:32:38 -05:00
2022-09-27 23:48:16 -07:00
2022-09-27 23:48:16 -07:00
2022-09-27 23:48:16 -07:00
2022-09-27 23:48:16 -07:00
2024-03-20 13:32:38 -05:00
2018-11-28 11:43:49 +00:00
2024-04-24 09:19:18 +02:00
2013-11-10 14:25:44 +00:00
2018-03-14 11:00:48 +00:00
2024-01-11 15:28:12 +08:00
2024-08-01 01:19:14 +08:00
2023-12-12 17:45:32 +08:00
2023-11-27 11:08:28 +08:00
2018-06-04 14:26:05 +00:00
2023-12-12 17:45:32 +08:00
2024-04-16 20:34:20 -04:00
2024-04-24 09:19:18 +02:00
2021-11-03 11:55:07 +00:00
2013-11-10 14:26:08 +00:00
2013-11-10 14:26:08 +00:00
2020-09-12 16:26:32 -04:00
2023-05-24 12:44:14 +08:00
2024-09-19 12:42:46 -07:00
2024-09-19 12:42:46 -07:00
2021-03-23 09:16:53 -04:00
2024-08-19 21:05:39 +05:30
2019-11-20 18:24:10 -08:00
2019-11-20 18:24:10 -08:00
2021-09-23 23:07:35 -04:00
2020-10-19 09:22:20 -04:00
2018-03-14 11:00:57 +00:00
2018-03-14 11:00:57 +00:00
2022-06-23 11:11:47 +08:00
2022-06-23 11:11:47 +08:00
2022-06-23 11:11:47 +08:00
2023-03-03 11:29:47 -08:00
2018-05-22 14:36:58 +00:00
2021-04-13 15:14:56 -07:00
2018-03-06 13:48:39 +00:00
2021-04-28 09:51:00 -04:00
2018-03-06 13:49:16 +00:00
2018-03-05 15:21:04 +00:00
2021-01-29 10:25:33 -05:00
2020-11-05 09:07:21 -05:00
2019-05-22 21:28:20 +00:00
2019-05-22 21:28:20 +00:00
2019-05-22 21:28:20 +00:00
2019-05-22 21:28:20 +00:00
2019-05-22 21:28:20 +00:00
2020-09-12 16:26:32 -04:00
2018-03-05 15:21:04 +00:00
2018-03-09 12:24:30 +00:00
2020-09-12 16:26:32 -04:00
2014-05-09 08:18:33 +00:00
2024-07-11 10:54:31 -07:00
2023-09-25 19:32:59 +08:00
2024-01-10 06:59:38 -08:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-29 12:06:26 -04:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-10-18 10:50:44 +01:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-09-16 10:33:59 +01:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-05-16 13:39:00 +02:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-04-25 16:42:48 -04:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2024-06-13 11:52:22 +02:00
2024-05-04 20:08:26 -05:00
2024-05-04 20:08:26 -05:00
2024-04-01 17:19:46 +08:00
2024-05-04 20:08:26 -05:00
2024-02-19 13:14:22 +08:00
2023-03-14 13:00:38 -07:00
2024-03-27 12:19:28 -07:00
2014-06-10 20:10:08 +00:00
2021-11-03 11:55:07 +00:00
2024-04-24 09:19:18 +02:00
2024-04-24 09:19:18 +02:00
2013-11-10 14:25:44 +00:00
2020-12-28 12:17:24 -05:00
2024-10-01 09:08:47 -07:00
2024-09-19 05:21:00 -07:00
2024-09-04 15:04:10 -07:00
2024-10-15 08:15:57 -07:00
2024-09-07 05:13:54 -07:00
2024-09-05 14:52:30 -07:00
2024-09-25 12:01:17 -07:00
2019-03-12 09:28:19 +00:00
2024-10-29 12:26:33 -07:00
2024-10-01 11:17:00 +04:00
2021-03-04 14:08:19 +03:00
2021-11-03 11:55:07 +00:00
2023-05-17 10:48:52 +02:00
2024-01-24 17:07:20 +00:00
2024-01-24 17:07:20 +00:00
2013-08-22 20:46:05 +00:00
2013-11-10 14:26:08 +00:00
2018-06-04 14:26:05 +00:00
2020-09-12 16:26:32 -04:00
2018-03-14 11:00:43 +00:00
2024-09-24 12:24:17 -07:00
2024-09-24 12:24:17 -07:00
2013-11-10 14:26:08 +00:00
2019-03-05 17:16:07 +00:00
2022-12-09 15:03:18 +00:00
2023-04-26 23:47:16 +09:00
2023-04-26 23:47:16 +09:00
2019-04-10 18:26:36 +00:00
2024-10-25 13:06:02 -04:00
2013-11-10 14:26:08 +00:00
2024-04-01 18:32:55 +08:00
2022-10-26 09:16:32 -07:00
2023-03-07 15:04:09 -05:00
2021-06-30 10:53:39 +01:00
2019-03-26 10:49:09 +00:00
2018-03-21 17:12:53 +00:00
2018-03-05 14:01:38 +00:00
2013-11-10 14:26:08 +00:00
2018-03-05 15:21:04 +00:00
2024-10-01 11:17:00 +04:00
2023-07-20 16:03:17 +08:00
2023-09-07 12:42:22 -07:00
2023-09-07 12:42:22 -07:00
2023-09-07 12:42:22 -07:00
2013-11-10 14:25:44 +00:00
2018-06-21 13:35:44 +00:00
2020-11-05 09:07:21 -05:00
2018-03-14 11:00:43 +00:00
2021-11-03 11:55:07 +00:00
2024-05-20 06:18:49 -08:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2019-05-14 13:04:25 +00:00
2024-10-29 12:26:33 -07:00
2018-11-27 18:57:43 +00:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2018-11-27 18:57:43 +00:00
2024-10-29 12:26:33 -07:00
2018-11-27 18:57:43 +00:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2024-10-29 12:26:33 -07:00
2018-11-27 18:57:43 +00:00
2020-04-23 14:26:32 +09:00
2024-08-08 02:00:36 +03:00
2020-02-18 10:09:05 -08:00
2020-09-12 16:26:32 -04:00
2023-09-27 12:07:36 +08:00
2023-09-27 12:07:36 +08:00
2024-02-26 18:25:21 -08:00
2024-07-25 09:41:55 -04:00
2018-01-08 16:25:40 +00:00
2023-10-11 13:11:48 +02:00
2024-07-22 14:18:05 +08:00
2022-09-27 23:48:16 -07:00
2024-09-07 15:11:34 -07:00
2018-03-19 14:14:28 +00:00
2021-02-01 10:59:07 -05:00
2013-11-10 14:26:08 +00:00
2014-08-12 14:06:21 +00:00
2024-04-25 16:42:48 -04:00
2020-10-19 09:22:20 -04:00
2013-11-10 14:26:08 +00:00
2014-05-02 19:25:52 +00:00
2023-03-07 12:41:56 +00:00
2013-11-10 14:26:08 +00:00
2018-06-04 14:26:05 +00:00
2020-12-23 10:59:33 -05:00
2024-08-08 02:00:36 +03:00
2011-10-06 13:39:59 +00:00
2018-03-05 15:21:04 +00:00
2018-03-05 15:21:11 +00:00
2023-08-03 17:22:34 +08:00
2021-11-03 11:55:07 +00:00
2020-11-05 09:07:21 -05:00
2023-02-09 16:14:38 +08:00
2023-02-09 16:14:38 +08:00
2024-01-29 09:22:22 -05:00
2023-02-09 16:14:38 +08:00
2016-01-13 07:53:11 +00:00
2020-09-12 16:26:32 -04:00
2024-10-29 12:26:33 -07:00
2018-11-27 18:57:43 +00:00
2024-10-29 12:26:33 -07:00
2017-07-12 13:24:46 +00:00
2013-11-10 14:26:08 +00:00
2013-12-22 03:43:58 +00:00
2023-02-09 16:14:38 +08:00
2023-10-26 14:43:38 +02:00
2023-10-20 07:21:24 +02:00
2024-10-30 16:17:25 +08:00
2024-10-21 09:58:59 -07:00