This is extremely specific, but saves three instructions when it's legal. I don't think the code can be usefully generalized.
Depends on D65175.
Paths
| Differential D65351
[ARM] Lower "(x<<c) > 0x80000000U" to "lsls" on Thumb1. ClosedPublic Authored by efriedma on Jul 26 2019, 2:48 PM.
Details Summary This is extremely specific, but saves three instructions when it's legal. I don't think the code can be usefully generalized. Depends on D65175.
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Jul 29 2019, 2:46 AM Comment Actions
I think it saves only one instruction on ARM/Thumb2 ("cmp rN, #0x80000000" is legal). Still worthwhile, I guess, assuming there isn't some sort of performance penalty for branching based on a shift. But I'd also have to figure out the right heuristics for D65175, since the transforms interact, and do a little more implementation work to lower ARMISD::LSLS. I'll leave a FIXME. Closed by commit rL367492: [ARM] Lower "(x<<c) > 0x80000000U" to "lsls" on Thumb1. (authored by efriedma). · Explain WhyJul 31 2019, 4:19 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 212700 llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.h
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
llvm/trunk/test/CodeGen/Thumb/cmp-and-fold.ll
|