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

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 7 21:30:42 PDT 2024


================
@@ -863,6 +863,25 @@ 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
----------------
wangpc-pp wrote:

`vid.v v8` will always be hoisted I think, should we take this into consideration?

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


More information about the llvm-commits mailing list