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

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 02:51:58 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:

There are 3 checks above this one

`if (isSoftF16(Op0.getValueType(), Subtarget))`, 
`if (Op0.getValueType() == MVT::f128)`, 
`if (Op0.getSimpleValueType().isInteger())`

So, it seems `f80` is the only type that can reach it. I will simplify the check for just this type.

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


More information about the llvm-commits mailing list