[PATCH] D103674: [ARM] Use rq gather/scatters for smaller v4 vectors

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 00:12:13 PDT 2021


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp:220
 
+Value *MVEGatherScatterLowering::decomposePtr(Value *Ptr, Value *&Offsets,
+                                              int &Scale, FixedVectorType *Ty,
----------------
SjoerdMeijer wrote:
> Your description:
> 
> >  decompose Ptr into Base:0 + Offset:Ptr (with a scale of 1), if the Ptr could not be decomposed from a GEP. v4i32 gathers will already use qi gathers, this extends that to v4i8 and v4i16 gathers using the extending rq variants. A pointer will always fit into an i32, so a rq offset gather/scatter can be used with v4i8 and v4i16 gathers, using a base of 0 and the Ptr as the offsets.
> 
> would be useful here as a comment to describe `decomposePtr`.
Yeah, that was meant to be on the declaration above, the sentence just didn't get that far.


================
Comment at: llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp:237
+  FixedVectorType *PtrTy = cast<FixedVectorType>(Ptr->getType());
+  if (PtrTy->getNumElements() != 4 || MemoryTy->getScalarSizeInBits() == 32)
+    return nullptr;
----------------
SjoerdMeijer wrote:
> Was wondering if this should be >= 32. Or does that not make any sense,  and we never see 64 bit types/values here?
We have never supported i64 gathers in this pass before, mostly because the vectorizer doesn't usually vectorize i64's.  We will only get this far with i32, i16 or i8's.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103674/new/

https://reviews.llvm.org/D103674



More information about the llvm-commits mailing list