[PATCH] D54143: [WIP, RISCV] Generate address sequences suitable for mcmodel=medium

James Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 03:32:21 PST 2018


jrtc27 added a comment.

It's also worth noting that GCC distinguishes between these two models by calling them `medlow` and `medany`, whereas `small` (what should be `medlow`) vs `medium` (ie `medany`) is somewhat misleading, but the SPARC backend seems to already set a precedent for this divergence (`medlow` -> `small`, `medmid` -> `medium` ie 44-bit absolute, `medany` -> `large` ie 64-bit absolute).

Now, there's an argument to be made whether our `medium` should continue to use absolute addressing on RV32I. The `%hi`/`%lo` pair already gives a 32-bit absolute address (signed, but that only poses a potential issue on RV64I), so we don't gain anything from this sequence. However, on RV64I, if our `medium` does mean `medany`, it will need to use PC-relative addressing, so it makes sense to have RV32I match this behaviour (and indeed, GCC also does this).


Repository:
  rL LLVM

https://reviews.llvm.org/D54143





More information about the llvm-commits mailing list