[PATCH] D109360: [ARM] Mark <= -1 immediate constant as cheap
Sam Tebbs via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 21 09:22:09 PDT 2021
samtebbs added inline comments.
================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:385
+ // We can convert <= -1 to < 0, which is generally quite cheap.
+ if (Inst && Opcode == Instruction::ICmp && Idx == 1 && Imm.isAllOnesValue()) {
+ ICmpInst::Predicate Pred = cast<ICmpInst>(Inst)->getPredicate();
----------------
Can this be applied to any integer less than the maximum for the type (e.g. <= 6 to < 7) rather than just <= -1 to < 0?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109360/new/
https://reviews.llvm.org/D109360
More information about the llvm-commits
mailing list