[ARM] Mark <= -1 immediate constant as cheap
authorDavid Green <david.green@arm.com>
Sun, 3 Oct 2021 18:30:08 +0000 (19:30 +0100)
committerDavid Green <david.green@arm.com>
Sun, 3 Oct 2021 18:30:08 +0000 (19:30 +0100)
commit20b1a16a696ace537103a92d2f4fd09a137e9406
tree8cfe837cc7695fab7807a016941b7525691ca415
parent164cc2781fb1b732ce88fc1c05a667b7d3d558f7
[ARM] Mark <= -1 immediate constant as cheap

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.

Differential Revision: https://reviews.llvm.org/D109360
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
llvm/test/CodeGen/ARM/consthoist-icmpimm.ll