diff options
author | Craig Topper <craig.topper@sifive.com> | 2022-08-01 15:26:20 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2022-08-01 15:33:21 -0700 |
commit | da5b1bf5bb0f1c3d7553a286ad50245bb11694b9 (patch) | |
tree | 870e584f2fd8e5240f3d405158d7730dbf68dd27 /clang/lib/Basic/FileManager.cpp | |
parent | b25b507c779747697eb8ca35509b84451226e27b (diff) | |
download | llvm-da5b1bf5bb0f1c3d7553a286ad50245bb11694b9.zip llvm-da5b1bf5bb0f1c3d7553a286ad50245bb11694b9.tar.gz llvm-da5b1bf5bb0f1c3d7553a286ad50245bb11694b9.tar.bz2 |
[RISCV] Teach RISCVMergeBaseOffset to merge %lo/%pcrel_lo into load/store after folding arithmetic.
It's possible we have:
lui a0, %hi(sym)
addi a0, %lo(sym)
addi a0, <offset1>
lw a0, <offset2>(a0)
We want to arrive at
lui a0, %hi(sym+offset1+offset2)
lw a0, %lo(sym+offset1+offset2)
We currently fail to do this because we only consider loads/stores
if we didn't find any arithmetic.
This patch splits arithmetic folding and load/store folding into
two separate phases. The load/store folding can no longer assume
the offset in hi/lo is 0 so we must combine the offsets. I've applied
the same simm32 limit that we applied in the arithmetic folding.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D130931
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
0 files changed, 0 insertions, 0 deletions