[PATCH] D103334: [GISel] Eliminate redundant bitmasking

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 28 15:02:50 PDT 2021


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

LGTM with some minor comments



================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3022
+    auto Zero = B.buildConstant(Ty, 0);
+    replaceRegWith(MRI, Dst, Zero->getOperand(0).getReg());
+  };
----------------
I think you can just do

```
B.buildConstant(Dst, 0);
```

and omit the `replaceRegWith` (similar to the `buildAnd` case above.)


================
Comment at: llvm/test/CodeGen/AArch64/GlobalISel/opt-overlapping-and.mir:43
+registers:
+  - { id: 0, class: _ }
+  - { id: 1, class: _ }
----------------
You shouldn't need the `registers` section in any of the tests here.

You can also drop

- `alignment`
- `liveins`
- `frameinfo`
- `machineFunctionInfo`

(Technically you can drop tracksRegLiveness too, but it's useful if you want to test the pipeline beyond the combiner.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103334



More information about the llvm-commits mailing list