[PATCH] D117900: [AArch64][SVE] Fold gather/scatter with 32bits when possible

Caroline via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 09:00:42 PST 2022


CarolineConcatto added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:16180-16187
+  // Earlier returns because there is no fold change.
+  if (Stride == 0)
+    return false;
+
+  // Ensure all element can be represented as a signed i32 value.
+  if (Stride < std::numeric_limits<int32_t>::min() ||
+      Stride > std::numeric_limits<int32_t>::max())
----------------
sdesmalen wrote:
> nit: maybe just merge these conditions together:
> 
>   if (!Stride || Stride < std::numeric_limits<int32_t>::min() ||
>       Stride > std::numeric_limits<int32_t>::max())
>     return false?
I like that test for only zero and the other to only check overflow. 
They both have comments for why it returns early.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117900



More information about the llvm-commits mailing list