[PATCH] D69071: [GISel][CombinerHelper] Add concat_vectors(build_vector, build_vector) => build_vector

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 15:45:31 PDT 2019


arsenm accepted this revision.
arsenm added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: wdng.

LGTM with nit



================
Comment at: lib/CodeGen/GlobalISel/CombinerHelper.cpp:113
+  for (const MachineOperand &MO : MI.operands()) {
+    assert(MO.isReg() && "Concat non-register values");
+    // Skip the instruction definition.
----------------
I don't think this is needed since the verifier will catch it


================
Comment at: lib/CodeGen/GlobalISel/CombinerHelper.cpp:126
+      for (const MachineOperand &BuildVecMO : Def->operands()) {
+        assert(MO.isReg() && "Build a vector with non-register values");
+        // Skip the definition.
----------------
I don't think this is needed since the verifier will catch it


================
Comment at: lib/CodeGen/GlobalISel/CombinerHelper.cpp:139-148
+        Undef = Builder.buildUndef(MRI.getType(Reg).getScalarType());
+      }
+      assert(MRI.getType(Undef->getOperand(0).getReg()) ==
+                 MRI.getType(Reg).getScalarType() &&
+             "All undefs should have the same type");
+      // Break the undef vector in as many scalar elements as needed
+      // for the flattening.
----------------
Pull out repeated getType calls into a variable?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D69071





More information about the llvm-commits mailing list