[PATCH] D120953: [AArch64][SelectionDAG] Prevent legality of extloads nxv4i64 from nxv4i32

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 4 03:12:56 PST 2022


paulwalker-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:1238
 
+    setLoadExtAction(ISD::SEXTLOAD, MVT::nxv4i64, MVT::nxv4i32, Expand);
+
----------------
david-arm wrote:
> So this is really just an optimisation where you're trying to reduce the number of loads we perform, in favour of more unpklo/hi instructions. It seems to make sense and looks like an improvement, but this change is very specific to one set of types and one extension type. What about ISD::ZEXTLOAD and other extensions from legal types, i.e.
> 
>   %wide.masked.load = call <vscale x 8 x i16> @llvm.masked.load.nxv8i16.p0nxv8i16(<vscale x 8 x i16>* %base, i32 2, <vscale x 8 x i1> %mask, <vscale x 8 x i16> undef)
>   %res = sext <vscale x 8 x i16> %wide.masked.load to <vscale x 8 x i64>
> 
> I think if we go down this route it's worth adding all other extension types from legal inputs too.
It seems we're currently marking all the scalable floating point types as Expand, so we should do the same for all the scalable integer types and then selectively enable the ones that make sense.  Although I'd actually prefer the common default to be Expand rather than forcing all targets to do the initialisation, but I guess that's outside the scope of this patch.


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

https://reviews.llvm.org/D120953



More information about the llvm-commits mailing list