[PATCH] D107380: [SystemZ] Implement memcmp with variable length with CLC.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 11:26:28 PDT 2021


jonpa created this revision.
jonpa added a reviewer: uweigand.
Herald added a subscriber: hiraditya.
jonpa requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Following the same pattern of memset/memcpy, this patch implements a variable length memcmp with a CLC loop followed by an EXRL instruction.

- For a zero length memcompare, the aghi check against -1 should return a CC that is equivalent to "EQ" also for the memcompare IPM result, which seems reasonable..?

- Hope it's ok to add a CC-def on the EXRL_Pseudo instead of an extra opcode like EXRL_Pseudo_CC...

- emitMemMemVarLen() has for now merely been copied from the memcpy patch (with some minor modification).

- ~1300 less library calls on spec.

Now that benchmarking is in progress for the memcpy patch, could this also be evaluated in parallel at this point?


https://reviews.llvm.org/D107380

Files:
  llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
  llvm/lib/Target/SystemZ/SystemZInstrFormats.td
  llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp
  llvm/test/CodeGen/SystemZ/memcmp-01.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107380.363814.patch
Type: text/x-patch
Size: 7036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210803/f3cb9ac7/attachment.bin>


More information about the llvm-commits mailing list