[llvm] [X86][AVX512] Check input-types to COMX (PR #118606)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 21:29:43 PST 2024


================
@@ -24228,8 +24228,13 @@ SDValue X86TargetLowering::LowerSETCC(SDValue Op, SelectionDAG &DAG) const {
   if (Subtarget.hasAVX10_2()) {
     if (CC == ISD::SETOEQ || CC == ISD::SETUNE) {
       auto NewCC = (CC == ISD::SETOEQ) ? X86::COND_E : (X86::COND_NE);
-      return getSETCC(NewCC, DAG.getNode(X86ISD::UCOMX, dl, MVT::i32, Op0, Op1),
-                      dl, DAG);
+      auto isValidType = [&](MVT Type) {
+        return Type == MVT::f16 || Type == MVT::f32 || Type == MVT::f64;
----------------
abhishek-kaushik22 wrote:

I wasn't able to create an example with `bf16` that reaches this code, in my example I see `bfloat` bitcasted to a `i16` and then promoted to `f32` during legalization.
```
Legalizing node: t4: f16,ch = CopyFromReg t0, Register:f16 %1
Legalizing node: t28: i16 = bitcast t4
Legalizing node: t31: f32 = bf16_to_fp t28
```
 

https://github.com/llvm/llvm-project/pull/118606


More information about the llvm-commits mailing list