[PATCH] D50239: [X86] Add the custom ABS expanding and change the SAD pattern recognizer.

Ivan Kulagin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 3 03:46:46 PDT 2018


ikulagin created this revision.
ikulagin added reviewers: craig.topper, spatel, kparzysz, RKSimon.
Herald added a subscriber: llvm-commits.

These changes are required for https://reviews.llvm.org/D49837 and add support of the ABS node
for the SAD pattern recognizer and the custom ABS expanding.

The i64 result of the ABS is expanded to

  tmp = (SRA, Hi, 31)
  Lo = (UADDO tmp, Lo)
  Hi = (XOR tmp, (ADDCARRY tmp, hi, Lo:1))
  Lo = (XOR tmp, Lo)
    

The "detectZextAbsDiff" function is changed for the recognition of pattern
with the ABS node. Given an ABS node, detect the following pattern:

  (ABS (SUB (ZERO_EXTEND a), (ZERO_EXTEND b))).


Repository:
  rL LLVM

https://reviews.llvm.org/D50239

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/combine-abs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50239.158966.patch
Type: text/x-patch
Size: 6264 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180803/8522ea02/attachment.bin>


More information about the llvm-commits mailing list