If we have and x, (csel 0, 1, cc) and we know that x is 0/1, then we can emit a csel ZR, x, cc. Similarly for 'or x, (csel 0, 1, cc) we can emit csinc x, ZR, cc`. This can help where we can not otherwise general ccmp instructions.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM with one suggestion.
llvm/lib/Target/AArch64/AArch64InstrInfo.td | ||
---|---|---|
555 | If I understand these PatLeafs right then they return true if the top bits are zero with the bottom bit being unknown. If so then I think the "known non-zero" part of the comment could be reworded. |
Comment Actions
I had not pushed the test files for D141086 until bd87b84a02252635cd, so this needs an update to regenerate the extra tests. Thanks for the fast update!
llvm/lib/Target/AArch64/AArch64InstrInfo.td | ||
---|---|---|
555 | Yes, could be "is_zext_of_one_bit" or something like that. |
If I understand these PatLeafs right then they return true if the top bits are zero with the bottom bit being unknown. If so then I think the "known non-zero" part of the comment could be reworded.