LUI+ADDIW always produces a simm32. This allows us to always
fold it into a global offset.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Could this interact badly with the medlow upper address space bound of 0x000000007FFFF7FF?
llvm/test/CodeGen/RISCV/hoist-global-addr-base.ll | ||
---|---|---|
53–55 | Minor update here? |
Comment Actions
I guess not, while the addiw -> addi change isn't safe to represent any simm32 on RV64, it's going to error out in the linker with out-of-bounds %hi and %lo.
To clarify, I was thinking about whether something like this could happen:
Before (non-folded offset computed with addiw):
lui a0, 0x80000 addiw a0, a0, -2047 a0 == 0x000000007ffff801
After (folded, using addi):
lui a0, 0x80000 addi a0, a0, -2047 a0 == 0xffffffff7ffff801
LGTM.
Minor update here?