[RISCV] Teach RISCVMergeBaseOffset to handle constant pools.
authorCraig Topper <craig.topper@sifive.com>
Tue, 20 Dec 2022 15:05:37 +0000 (07:05 -0800)
committerCraig Topper <craig.topper@sifive.com>
Tue, 20 Dec 2022 15:16:43 +0000 (07:16 -0800)
commit4a2e7da3ce3e8b6fa8d7d886be441dda42c18265
treeafdb7472af3a13a202241d0189f63c192acdaf4f
parent2aa998d22fe09191cd6c1b697e373266c1131502
[RISCV] Teach RISCVMergeBaseOffset to handle constant pools.

Primarily this allows us to fold the addi from PseudoLLA expansion
into a load.

If the linker is able to GP relax the constant pool access we'll
end up with a GP relative load.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D140341
llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp
llvm/test/CodeGen/RISCV/codemodel-lowering.ll