diff options
author | Alex Bradbury <asb@lowrisc.org> | 2018-10-12 23:18:52 +0000 |
---|---|---|
committer | Alex Bradbury <asb@lowrisc.org> | 2018-10-12 23:18:52 +0000 |
commit | 748d080e6288ec3b2edd1a1bfdcf21491e816fd3 (patch) | |
tree | 0e74da5b9307e3ef6d1a553cdc446f1b81693c9e /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 71f484c967ad7b41c9cca6b8c3aef6cf340a8877 (diff) | |
download | bcm5719-llvm-748d080e6288ec3b2edd1a1bfdcf21491e816fd3.tar.gz bcm5719-llvm-748d080e6288ec3b2edd1a1bfdcf21491e816fd3.zip |
[RISCV] Eliminate unnecessary masking of promoted shift amounts
SelectionDAGBuilder::visitShift will always zero-extend a shift amount when it
is promoted to the ShiftAmountTy. This results in zero-extension (masking)
which is unnecessary for RISC-V as the shift operations only read the lower 5
or 6 bits (RV32 or RV64).
I initially proposed adding a getExtendForShiftAmount hook so the shift amount
can be any-extended (D52975). @efriedma explained this was unsafe, so I have
instead eliminate the unnecessary and operations at instruction selection time
in a manner similar to X86InstrCompiler.td.
Differential Revision: https://reviews.llvm.org/D53224
llvm-svn: 344432
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
0 files changed, 0 insertions, 0 deletions