[PATCH] D114380: [ARM] Teach getIntImmCostInst about the cost of saturating fp converts

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 10:04:12 PST 2021


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, samtebbs, ostannard, simon_tatham.
Herald added subscribers: armkevincheng, jsmolens, eric-k256, hiraditya, kristof.beyls.
Herald added a reviewer: sjarus.
dmgreen requested review of this revision.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D114380

Files:
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/test/CodeGen/ARM/fpclamptosat.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114380.388957.patch
Type: text/x-patch
Size: 12851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211122/60b94fe5/attachment.bin>


More information about the llvm-commits mailing list