[PATCH] D109360: [ARM] Mark <= -1 immediate constant as cheap

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 7 06:11:55 PDT 2021


dmgreen created this revision.
dmgreen added reviewers: samtebbs, SjoerdMeijer, simon_tatham, ostannard.
Herald added subscribers: hiraditya, kristof.beyls.
dmgreen requested review of this revision.
Herald added a project: LLVM.

A `<= -1` constant on a compare can be converted to a `< 0` operation, which is usually cheap. If we mark the constant as cheap, preventing hoisting, we allow that fold to happen even across different blocks.


https://reviews.llvm.org/D109360

Files:
  llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
  llvm/test/CodeGen/ARM/consthoist-icmpimm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109360.371030.patch
Type: text/x-patch
Size: 11327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210907/8871f96b/attachment.bin>


More information about the llvm-commits mailing list