[PATCH] D71774: [RISCV] Optimize seteq/setne pattern expansions for better code size
weiwei via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 30 01:15:12 PST 2020
wwei added a comment.
In D71774#1821760 <https://reviews.llvm.org/D71774#1821760>, @lenary wrote:
> This seems like a fun issue:
>
> - `addi` is compressible
> - `xor` is almost certainly easier to analyse (from the view of `KnownBits` and the like).
>
> Have you seen any regressions in code generation from this change?
No, there's no any regressions. For the case where the register is compared with an immediate value (equal or unequal), using `xori` or `addi` with neg imm in the pattern `seteq` or `setne` is equivalent, in order to get a result equal to 0 or not equal to 0.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71774/new/
https://reviews.llvm.org/D71774
More information about the llvm-commits
mailing list