[llvm] [RISCV] Consider all subvector extracts within a single VREG cheap (PR #81032)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 19:50:00 PST 2024


================
@@ -2173,19 +2173,35 @@ bool RISCVTargetLowering::isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
   if (ResVT.isScalableVector() || SrcVT.isScalableVector())
     return false;
 
+  EVT EltVT = ResVT.getVectorElementType();
+  if (EltVT != SrcVT.getVectorElementType())
+    return false;
----------------
lukel97 wrote:

Is this possible with EXTRACT_SUBVECTOR? I can't see anything about widening elements in its definition in ISDOpcodes.h, but I'm aware EXTRACT_VECTOR_ELT does. Or is one of the users of `isExtractSubvectorCheap` just invoking it this way?

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


More information about the llvm-commits mailing list