[llvm] [LV] Check early for supported interleave factors with scalable types [nfc] (PR #111592)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 08:04:01 PDT 2024


================
@@ -3743,7 +3743,7 @@ InstructionCost AArch64TTIImpl::getInterleavedMemoryOpCost(
   assert(Factor >= 2 && "Invalid interleave factor");
   auto *VecVTy = cast<VectorType>(VecTy);
 
-  if (VecTy->isScalableTy() && (!ST->hasSVE() || Factor != 2))
+  if (VecTy->isScalableTy() && !ST->hasSVE())
----------------
david-arm wrote:

If I understand correctly, I think all @fhahn is worried about here is a situation where the vectoriser may support larger interleave factors for scalable vectors but relies on the cost model returning Invalid for factors they don't support. So having an assert that Factor == 2 with scalable vectors for both RISC and AArch64 seems reasonable I guess?

The intent of this patch seems reasonable to me - by bailing out early in interleavedAccessCanBeWidened we can avoid doing unnecessary work. It's perhaps worth pointing that there is currently a patch (https://github.com/llvm/llvm-project/pull/89018) to add support for factors > 2.

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


More information about the llvm-commits mailing list