AArch64 can fold some shift+extend operations on the RHS operand of
comparisons, so swap the operands if that makes sense.
This provides a fix for https://bugs.llvm.org/show_bug.cgi?id=38751
Paths
| Differential D53067
[AArch64] Swap comparison operands if that enables some folding. ClosedPublic Authored by aadg on Oct 10 2018, 2:41 AM.
Details Summary AArch64 can fold some shift+extend operations on the RHS operand of This provides a fix for https://bugs.llvm.org/show_bug.cgi?id=38751
Diff Detail
Event TimelineSjoerdMeijer added inline comments.
This revision is now accepted and ready to land.Oct 12 2018, 6:03 AM Closed by commit rL344439: [AArch64] Swap comparison operands if that enables some folding. (authored by aadg). · Explain WhyOct 13 2018, 12:46 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 168962 lib/Target/AArch64/AArch64ISelLowering.cpp
test/CodeGen/AArch64/and-mask-removal.ll
test/CodeGen/AArch64/lack-of-signed-truncation-check.ll
test/CodeGen/AArch64/sat-add.ll
test/CodeGen/AArch64/signed-truncation-check.ll
test/CodeGen/AArch64/swap-compare-operands.ll
|
Had a quick first look, so sorry for some question about testing.... If the shift amount is in the range [0,31] and [0,64], are the edge cases tested (also values just outside this range)? Also, can Shift be negative here?