[PATCH] D57164: GlobalISel: Handle odd splits in fewerElementsVector for load/store

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 29 12:24:07 PST 2019


arsenm marked an inline comment as done.
arsenm added inline comments.


================
Comment at: include/llvm/CodeGen/GlobalISel/LegalizerHelper.h:136
+  /// Helper function to build a wide generic register \p DstReg of type \p
+  /// RegTy from smaller parts. This will produce a G_MERGE_VALUES,
+  /// G_BUILD_VECTOR, G_CONCAT_VECTORS, or sequence of G_INSERT as appropriate
----------------
The comment mentions G_MERGE_VALUES, although technically this is introduced in D57310


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:1742-1743
+    NumParts = getNarrowTypeBreakDown(ValTy, NarrowTy, LeftoverTy);
+  } else {
+    if (extractParts(ValReg, ValTy, NarrowTy, LeftoverTy, NarrowRegs,
+                     NarrowLeftoverRegs))
----------------
paquette wrote:
> Can this just be an else if?
It would work, but I don't think it logically flows that way


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:1748
+
+  if (NumParts == -1)
     return UnableToLegalize;
----------------
paquette wrote:
> Out of curiosity, could `NumParts` ever be 0 for some reason? If so, what would that mean?
That's the invalid Size < NarrowSize case


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

https://reviews.llvm.org/D57164





More information about the llvm-commits mailing list