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

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 01:56:28 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;
+      };
+      if (isValidType(Op0.getSimpleValueType()) &&
----------------
phoebewang wrote:

I think checking single operand should be enough.

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


More information about the llvm-commits mailing list