[llvm] [RISCV][TTI] Implement cost of intrinsic active_lane_mask (PR #87931)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 17:42:37 PDT 2024


================
@@ -863,6 +863,21 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     }
     break;
   }
+  case Intrinsic::get_active_lane_mask: {
+    if (ST->hasVInstructions()) {
+      Type *ExpRetTy = VectorType::get(
+          ICA.getArgTypes()[0], cast<VectorType>(RetTy)->getElementCount());
+      auto LT = getTypeLegalizationCost(ExpRetTy);
+
+      // vid.v   v8  // considered hoisted
----------------
topperc wrote:

Don't we need to count it for code size?

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


More information about the llvm-commits mailing list