[llvm] [RISCV][TTI] Add vp.cmp intrinsic cost with functionalOPC. (PR #107504)

Elvis Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 01:41:04 PDT 2024


================
@@ -1015,6 +1015,23 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
       return getArithmeticInstrCost(*FOp, ICA.getReturnType(), CostKind);
     break;
   }
+
+  // vp compare
+  case Intrinsic::vp_icmp:
+  case Intrinsic::vp_fcmp: {
+    Intrinsic::ID IID = ICA.getID();
+    std::optional<unsigned> FOp = VPIntrinsic::getFunctionalOpcodeForVP(IID);
+    CmpInst::Predicate Pred;
+
+    if (IID == Intrinsic::vp_icmp)
+      Pred = CmpInst::ICMP_SLT;
----------------
ElvisWang123 wrote:

Fixed, thanks.


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


More information about the llvm-commits mailing list