[PATCH] D57789: [CGP] form usub with overflow from sub+icmp

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 5 14:27:46 PST 2019


spatel created this revision.
spatel added reviewers: nikic, fhahn, hfinkel, nemanjai, RKSimon, efriedma, arsenm, nhaehnle.
Herald added subscribers: jsji, kristof.beyls, tpr, javed.absar, wdng, jvesely, mcrosier.

The motivating x86 cases for forming the intrinsic are shown in PR31754 and PR40487:
https://bugs.llvm.org/show_bug.cgi?id=31754
https://bugs.llvm.org/show_bug.cgi?id=40487
...and those are shown in the IR test file and x86 codegen file.

Matching the usubo pattern is harder than uaddo because we have 2 independent values rather than a def-use.
I replicated the codegen tests for AArch64 to show that forming usubo should be generally good (and that lines up with the existing uaddo sibling transform).

There's a potential regression seen in the AMDGPU test file when trying to form a SAD op though, so I added a hack to try to avoid that.
If I'm seeing the PPC changes correctly, this is a small improvement on those tests.


https://reviews.llvm.org/D57789

Files:
  lib/CodeGen/CodeGenPrepare.cpp
  test/CodeGen/AArch64/cgp-usubo.ll
  test/CodeGen/AMDGPU/sad.ll
  test/CodeGen/PowerPC/bdzlr.ll
  test/CodeGen/PowerPC/expand-contiguous-isel.ll
  test/CodeGen/X86/cgp-usubo.ll
  test/CodeGen/X86/lsr-loop-exit-cond.ll
  test/Transforms/CodeGenPrepare/X86/overflow-intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57789.185401.patch
Type: text/x-patch
Size: 24854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190205/723e2f33/attachment.bin>


More information about the llvm-commits mailing list