[all-commits] [llvm/llvm-project] 4841a2: [DAG] Move basic USUBSAT pattern matches from X86 ...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Fri Feb 12 10:24:22 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4841a225b7545b4bb03ae32ecea9f70e85f9e3bf
      https://github.com/llvm/llvm-project/commit/4841a225b7545b4bb03ae32ecea9f70e85f9e3bf
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-02-12 (Fri, 12 Feb 2021)

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

  Log Message:
  -----------
  [DAG] Move basic USUBSAT pattern matches from X86 to DAGCombine

Begin transitioning the X86 vector code to recognise sub(umax(a,b) ,b) or sub(a,umin(a,b)) USUBSAT patterns to make it 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.

Differential Revision: https://reviews.llvm.org/D96413




More information about the All-commits mailing list