[PATCH] D114013: [ARM] Fold away unnecessary CSET/CMPZ

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 16 10:12:50 PST 2021


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, samtebbs, simon_tatham, ostannard.
Herald added subscribers: hiraditya, kristof.beyls, qcolombet.
dmgreen requested review of this revision.
Herald added a project: LLVM.

Codegen from expanded vector operations can end up with unnecessary CMPZ/CSINC, of the form:

  CSXYZ A, B, C1 (CMPZ (CSINC 0, 0, C2, D), 0)

These can be converted to remove the CMPZ and CSINC, depending on the condition.

  if C1==NE -> CSXYZ A, B, C2, D
  if C1==EQ -> CSXYZ A, B, NOT(C2), D


https://reviews.llvm.org/D114013

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/test/CodeGen/Thumb2/active_lane_mask.ll
  llvm/test/CodeGen/Thumb2/mve-ctlz.ll
  llvm/test/CodeGen/Thumb2/mve-cttz.ll
  llvm/test/CodeGen/Thumb2/mve-fmas.ll
  llvm/test/CodeGen/Thumb2/mve-fmath.ll
  llvm/test/CodeGen/Thumb2/mve-laneinterleaving.ll
  llvm/test/CodeGen/Thumb2/mve-pred-and.ll
  llvm/test/CodeGen/Thumb2/mve-pred-not.ll
  llvm/test/CodeGen/Thumb2/mve-pred-or.ll
  llvm/test/CodeGen/Thumb2/mve-pred-shuffle.ll
  llvm/test/CodeGen/Thumb2/mve-pred-spill.ll
  llvm/test/CodeGen/Thumb2/mve-pred-vselect.ll
  llvm/test/CodeGen/Thumb2/mve-pred-xor.ll
  llvm/test/CodeGen/Thumb2/mve-vcmp.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpf.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpfr.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpfz.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpr.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpz.ll
  llvm/test/CodeGen/Thumb2/mve-vecreduce-addpred.ll
  llvm/test/CodeGen/Thumb2/mve-vecreduce-mlapred.ll
  llvm/test/CodeGen/Thumb2/mve-vpsel.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114013.387688.patch
Type: text/x-patch
Size: 423516 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211116/782c24f3/attachment-0001.bin>


More information about the llvm-commits mailing list