[llvm] [RISCV][TTI] Add instruction cost for vp.select. (PR #109381)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 07:10:22 PDT 2024


================
@@ -1065,6 +1065,13 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
         *FOp, ICA.getArgTypes()[0], UI->getPointerAlignment(),
         UI->getOperand(1)->getType()->getPointerAddressSpace(), CostKind);
   }
+  case Intrinsic::vp_select: {
+    Intrinsic::ID IID = ICA.getID();
+    std::optional<unsigned> FOp = VPIntrinsic::getFunctionalOpcodeForVP(IID);
+    assert(FOp.has_value());
----------------
lukel97 wrote:

I think you're right that getFunctionalOpcodeForVP is doing two things, checking if a VP intrinsic has a non VP equivalent and then also returning the opcode for said non VP equivalent 

We should probably refactor it in a separate PR.

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


More information about the llvm-commits mailing list