[llvm] [LV] Support float and pointer conditional scalar assignments (PR #184101)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 03:09:44 PST 2026


================
@@ -627,6 +627,13 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
     if (VTy->getElementCount() == ElementCount::getScalable(1))
       return InstructionCost::getInvalid();
 
+  // Likewise if any of the operands is a <vscale x 1 x eltty>.
+  for (const Type *ArgTy : ICA.getArgTypes()) {
+    if (auto *ArgVTy = dyn_cast<ScalableVectorType>(ArgTy))
+      if (ArgVTy->getElementCount() == ElementCount::getScalable(1))
+        return InstructionCost::getInvalid();
+  }
+
----------------
huntergr-arm wrote:

I imagine it's due to the result of `experimental_vector_extract_last_active` being a scalar, so we need to check the arguments instead for a VF of `vscale x 1` in order to avoid choosing that over better options when costing plans?

But we only need to check the type of one of the vector arguments instead of all arguments.

@sdesmalen-arm Is there a test that exposes this case?

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


More information about the llvm-commits mailing list