[PATCH] D44374: [GlobalISel] Add support for lowering vector operations to scalar.

Kristof Beyls via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 12 08:23:41 PDT 2018


kristof.beyls added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:1077-1080
+    // FIXME: Don't know how to handle the situation where the small vectors
+    // aren't all the same size yet.
+    if (Size % NarrowSize != 0)
+      return UnableToLegalize;
----------------
I guess the FIXME should be removed, and the condition in the if statement could become an assert?
Vectors are always an exact multiple of a number of individual elements?


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:1088
+
+    for (int i = 0; i < NumParts; ++i) {
+      unsigned DstReg = MRI.createGenericVirtualRegister(NarrowTy);
----------------
I guess the code will read more natural if you don't try to stick very closely to the variable names used in the other lowering helper methods, but e.g. instead of "NumParts" use "NumElements" here?
Similarly maybe use "ElementTy" instead of "NarrowTy" and "ElementSize" instead of "NarrowSize"?


Repository:
  rL LLVM

https://reviews.llvm.org/D44374





More information about the llvm-commits mailing list