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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 11:02:01 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:

ok

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


More information about the llvm-commits mailing list