aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2021-01-15 10:54:26 -0800
committerCraig Topper <craig.topper@sifive.com>2021-01-15 11:14:14 -0800
commit86e604c4d68528478333a8901d7c79c09ca16fa8 (patch)
treeb46aabb63e8f0bd2f92f14f18dee93e418cbb383 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parentd0cb0d30a431578ecedb98c57780154789f3c594 (diff)
downloadllvm-86e604c4d68528478333a8901d7c79c09ca16fa8.zip
llvm-86e604c4d68528478333a8901d7c79c09ca16fa8.tar.gz
llvm-86e604c4d68528478333a8901d7c79c09ca16fa8.tar.bz2
[RISCV] Add implementation of targetShrinkDemandedConstant to optimize AND immediates.
SimplifyDemandedBits can remove set bits from immediates from instructions like AND/OR/XOR. This can prevent them from being efficiently codegened on RISCV. This adds an initial version that tries to keep or form 12 bit sign extended immediates for AND operations to enable use of ANDI. If that doesn't work we'll try to create a 32 bit sign extended immediate to use LUI+ADDIW. More optimizations are possible for different size immediates or different operations. But this is a good starting point that already has test coverage. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D94628
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions