[PATCH] D58596: GlobalISel: Implement fewerElementsVector for phi

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 09:03:21 PST 2019


paquette added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:37
 ///
 /// Returns -1 if the breakdown is not satisfiable.
+static std::pair<int, int>
----------------
Comment needs updating


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2047
+
+  for (unsigned I = 1; I < MI.getNumOperands(); I += 2) {
+    SmallVector<unsigned, 4> PartRegs, LeftoverRegs;
----------------
Can we have a comment explaining what this loop is doing for consistency with the other loop?


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2048
+  for (unsigned I = 1; I < MI.getNumOperands(); I += 2) {
+    SmallVector<unsigned, 4> PartRegs, LeftoverRegs;
+    unsigned SrcReg = MI.getOperand(I).getReg();
----------------
Can we just reuse the definitions outside the loop and just use `clear()` to avoid calling the SmallVector constructor?


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

https://reviews.llvm.org/D58596





More information about the llvm-commits mailing list