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