[PATCH] D77931: [GlobalISel] Enable artifact combiner to combine starting from a G_MERGE_VALUES

Dominik Montada via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 03:09:21 PDT 2020


gargaroff added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h:638
+      // artifact worklist in case there's folding that can be done looking up.
+      for (MachineInstr &U : MRI.use_instructions(MI.getOperand(0).getReg())) {
+        if (U.getOpcode() == TargetOpcode::G_UNMERGE_VALUES) {
----------------
Should this skip COPYs?


================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h:639
+      for (MachineInstr &U : MRI.use_instructions(MI.getOperand(0).getReg())) {
+        if (U.getOpcode() == TargetOpcode::G_UNMERGE_VALUES) {
+          UpdatedDefs.push_back(MI.getOperand(0).getReg());
----------------
The artifact combiner can also combine trunc(merge). Could you add trunc users to the worklist as well?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77931





More information about the llvm-commits mailing list