[PATCH] D58596: GlobalISel: Implement fewerElementsVector for phi

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 27 15:00:14 PST 2019


paquette accepted this revision.
paquette added a comment.
This revision is now accepted and ready to land.

LGTM aside from nits



================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2033
+  // Insert the new phis in the result block first.
+  for (int I = 0; I != NumParts + NumLeftover; ++I) {
+    LLT Ty = I < NumParts ? NarrowTy : LeftoverTy;
----------------
Factor out `NumParts + NumLeftover` above the loop to avoid recompilation?


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2051
+  // Insert code to extract the incoming values in each predecessor block.
+  for (unsigned I = 1; I < MI.getNumOperands(); I += 2) {
+    PartRegs.clear();
----------------
Factor out `MI.getNumOperands()` above the loop to avoid recomputation?


================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2067
+    // pieces.
+    for (int I = 0, E = NewInsts.size(); I != E; ++I) {
+      MachineInstrBuilder MIB = NewInsts[I];
----------------
ditto above two comments


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

https://reviews.llvm.org/D58596





More information about the llvm-commits mailing list