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

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 23:54:05 PDT 2022


dmgreen added inline comments.


================
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);
----------------
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).


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

https://reviews.llvm.org/D129966



More information about the llvm-commits mailing list