[PATCH] D129966: [ARM] Remove VBICimm if no cleared bits are demanded

Sam Tebbs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 01:58:28 PDT 2022


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

LGTM



================
Comment at: llvm/lib/Target/ARM/ARMISelLowering.cpp:19970
+    uint64_t Mask = ARM_AM::decodeVMOVModImm(ModImm, EltBits);
+    if ((OriginalDemandedBits & Mask) == 0)
+      return TLO.CombineTo(Op, Op0);
----------------
dmgreen wrote:
> samtebbs wrote:
> > Looks like VBIC uses the complement of the immediate. Does that need to be considered when checking `Mask`?
> By "complement of the immediate", do you mean that it is the opposite of an And? If so then yes.
> The way I think of it is that the BIC will clear any bits in the input where the mask is 1. If there are no bits that are cleared which are also demanded, then we don't need the BIC. In most of the tests the BIC is clearing the top bits (0xff00), which is a vmovl. The demanded bits are only the low bits (0x00ff).
I see, I interpreted the demanded bits as being those that should not be cleared. It all looks good with that clarification, thanks.


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

https://reviews.llvm.org/D129966



More information about the llvm-commits mailing list