[all-commits] [llvm/llvm-project] 646c87: [ARM] Teach getIntImmCostInst about the cost of sa...

David Green via All-commits all-commits at lists.llvm.org
Wed Dec 1 23:56:41 PST 2021


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

  Changed paths:
    M llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
    M llvm/test/CodeGen/ARM/fpclamptosat.ll

  Log Message:
  -----------
  [ARM] Teach getIntImmCostInst about the cost of saturating fp converts

Given a min(max(fptosi, INT_MIN), INT_MAX) with the correct constants,
we can now generate a fptosi.sat. But in the arm backend, the constant
can be treated as high cost, pulling it out of the basic block in a way
that the DAG combine can no longer see it. This teaches it again that it
is a low cost constant, not worth hoisting out.

Recommitted from 0e98659ea1193c with a fix for APInt comparison.

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




More information about the All-commits mailing list