[PATCH] D105696: [AArch64][GlobalISel] Optimise lowering for some vector types for min/max

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 11:50:56 PDT 2021


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp:172
       .legalFor({v8s8, v16s8, v4s16, v8s16, v2s32, v4s32})
+      .clampNumElements(0, v8s8, v16s8)
+      .clampNumElements(0, v4s16, v8s16)
----------------
aemerson wrote:
> You can use clampMin/MaxNumElts instead to do these.
It looks like clampNumElements is a wrapper around clampMinNumElements(..).clampMaxNumElements(..);

Out of interest, what would make the individual methods better to use themselves? Is it something about how small types are widened?


================
Comment at: llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp:173
+      .clampNumElements(0, v2s32, v4s32)
+      .clampNumElements(0, v2s64, v2s64)
       .lower();
----------------
dmgreen wrote:
> I'm not sure you have to clamp the elements on a v2s64, as they are going to be expanded anyway.
> 
> Should it be dealing with vXi16 and vXi8 though?
It turns out that G_ICMP doesn't support splitting vectors yet, which is why v2s64 is here too. Otherwise it could be lowered.

(It might be worth added a FIXME to that extent.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105696



More information about the llvm-commits mailing list