[PATCH] D96413: [DAG] Move basic USUBSAT pattern matches from X86 to DAGCombine

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 06:04:45 PST 2021


RKSimon created this revision.
RKSimon added reviewers: craig.topper, dmgreen, arsenm, spatel, nikic, efriedma.
Herald added subscribers: ecnelises, kerbowa, pengfei, hiraditya, nhaehnle, jvesely.
RKSimon requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Begin transitioning the X86 vector code to recognise sub(umax(a,b) ,b) or sub(a,umin(a,b)) USUBSAT patterns more generic and available to all targets.

This initial patch just moves the basic umin/umax patterns to DAG, removing some vector-only checks on the way - these are some of the patterns that the legalizer will try to expand back to so we can be reasonably relaxed about matching these pre-legalization.

We can handle the trunc(sub(..))) variants as well, which helps with patterns where we were promoting to a wider type to detect overflow/saturation.

The remaining x86 code requires some cleanup first - some of it isn't actually tested etc. I also need to resurrect D25987 <https://reviews.llvm.org/D25987>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96413

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/AArch64/usub_sat.ll
  llvm/test/CodeGen/AArch64/usub_sat_plus.ll
  llvm/test/CodeGen/AMDGPU/usubsat.ll
  llvm/test/CodeGen/ARM/usub_sat.ll
  llvm/test/CodeGen/X86/psubus.ll
  llvm/test/CodeGen/X86/usub_sat.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96413.322664.patch
Type: text/x-patch
Size: 28093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210210/60fe2c3d/attachment.bin>


More information about the llvm-commits mailing list