[PATCH] D72330: [ARM][MVE] Enable masked gathers from base + vector of offsets

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 07:42:44 PST 2020


samparker added inline comments.


================
Comment at: llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp:131
 
-  if (Ty->getVectorNumElements() != 4)
-    // Can't build an intrinsic for this
-    return false;
-  if (match(Mask, m_One()))
-    Load = Builder.CreateIntrinsic(Intrinsic::arm_mve_vldr_gather_base,
-                                   {Ty, Ptr->getType()},
-                                   {Ptr, Builder.getInt32(0)});
-  else
-    Load = Builder.CreateIntrinsic(
-        Intrinsic::arm_mve_vldr_gather_base_predicated,
-        {Ty, Ptr->getType(), Mask->getType()},
-        {Ptr, Builder.getInt32(0), Mask});
+  unsigned Unsigned = 1;
+  Value *BasePtr = Ptr;
----------------
Doesn't look this needs to be a variable?


================
Comment at: llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp:170
+      }
+      if (isa<VectorType>(C->getType()))
+        C = C->getSplatValue();
----------------
I think you can just call C->isNullValue().


================
Comment at: llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp:178
+
+    Type *OffsType = VectorType::getInteger(cast<VectorType>(Ty));
+    // If the offset we found does not have the type the intrinsic expects,
----------------
How about moving this logic up to around line 155 so that all the offset stuff is together, it's quite hard to follow scrolling up and down!


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

https://reviews.llvm.org/D72330





More information about the llvm-commits mailing list