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

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 4 01:59:46 PDT 2021


SjoerdMeijer added inline comments.


================
Comment at: llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp:84
   void lookThroughBitcast(Value *&Ptr);
+  // Decompose a ptr into Base and Offsets, potentially using a GEP to
+  Value *decomposePtr(Value *Ptr, Value *&Offsets, int &Scale,
----------------
Typo? 
to -> too.


================
Comment at: llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp:220
 
+Value *MVEGatherScatterLowering::decomposePtr(Value *Ptr, Value *&Offsets,
+                                              int &Scale, FixedVectorType *Ty,
----------------
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`.


================
Comment at: llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp:237
+  FixedVectorType *PtrTy = cast<FixedVectorType>(Ptr->getType());
+  if (PtrTy->getNumElements() != 4 || MemoryTy->getScalarSizeInBits() == 32)
+    return nullptr;
----------------
Was wondering if this should be >= 32. Or does that not make any sense,  and we never see 64 bit types/values here?


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

https://reviews.llvm.org/D103674



More information about the llvm-commits mailing list