[all-commits] [llvm/llvm-project] 57ff80: [DAG] Create fptoui.sat from clamped fptosi

David Green via All-commits all-commits at lists.llvm.org
Sun Dec 5 01:26:06 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 57ff805a6da7a54434646af589455069459c667e
      https://github.com/llvm/llvm-project/commit/57ff805a6da7a54434646af589455069459c667e
  Author: David Green <david.green at arm.com>
  Date:   2021-12-05 (Sun, 05 Dec 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/Target/X86/X86ISelLowering.h
    M llvm/test/CodeGen/AArch64/fpclamptosat.ll
    M llvm/test/CodeGen/AArch64/fpclamptosat_vec.ll
    M llvm/test/CodeGen/ARM/fpclamptosat.ll
    M llvm/test/CodeGen/RISCV/fpclamptosat.ll
    M llvm/test/CodeGen/Thumb2/mve-fpclamptosat_vec.ll
    M llvm/test/CodeGen/WebAssembly/fpclamptosat.ll
    M llvm/test/CodeGen/WebAssembly/fpclamptosat_vec.ll

  Log Message:
  -----------
  [DAG] Create fptoui.sat from clamped fptosi

As an extension to D111976, this converts clamp fptosi, clamped between
0 and (2^n)-1 to a fptoui.sat. This can greatly help on targets with
conversions that naturally saturate, such as Arm.

X86 disables the transform as some of the test cases increases in size.
A fptoui.sat necessitates a fp clamp without native support, so there is
little use in converting if the instruction is just going to be
expanded.

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




More information about the All-commits mailing list