[PATCH] D109963: [AArch64] Split bitmask immediate of bitwise AND operation

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 00:49:19 PDT 2021


jaykang10 added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp:97
+
+  // If the MOV has multiple uses, do not split the immediate becasue it causes
+  // more instructions.
----------------
dmgreen wrote:
> "because"
Sorry, let me update it.


================
Comment at: llvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h:342
+template <typename T>
+static inline bool isValidAndSplitBitmaskImm(T Imm, unsigned regSize) {
+  assert((regSize == 32 || regSize == 64) &&
----------------
dmgreen wrote:
> jaykang10 wrote:
> > dmgreen wrote:
> > > jaykang10 wrote:
> > > > dmgreen wrote:
> > > > > This can move into the peephole optimization pass now, which might allow it to be simplified somewhat.
> > > > This function could be used on other places. If possible, I would like to keep this check here conservatively.
> > > What other places do you expect it to be used?
> > > 
> > > It seems at the moment, with the way these are called they will be re-calculating the same values repeatedly. That was unavoidable from tablegen patterns, but shouldn't be necessary from the new Peephole pass, hopefully.
> > You are right! Let me move it to the peephole pass.
> Was this going to be moved?
Ah, sorry. I misunderstood what you want. Let me move this function to the peephole optimization pass.


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

https://reviews.llvm.org/D109963



More information about the llvm-commits mailing list