diff options
author | Alex Bradbury <asb@lowrisc.org> | 2019-04-01 14:42:56 +0000 |
---|---|---|
committer | Alex Bradbury <asb@lowrisc.org> | 2019-04-01 14:42:56 +0000 |
commit | da20f5ca74522c5ad7630180e7b99709e453dee5 (patch) | |
tree | c89997d31759f632a909b39eb529901164cb0bc6 /llvm/lib/Target/RISCV/RISCVISelLowering.h | |
parent | efe376add6ab35db2e6263d257d7d9a61d3e84e0 (diff) | |
download | bcm5719-llvm-da20f5ca74522c5ad7630180e7b99709e453dee5.tar.gz bcm5719-llvm-da20f5ca74522c5ad7630180e7b99709e453dee5.zip |
[RISCV] Generate address sequences suitable for mcmodel=medium
This patch adds an implementation of a PC-relative addressing sequence to be
used when -mcmodel=medium is specified. With absolute addressing, a 'medium'
codemodel may cause addresses to be out of range. This is because while
'medium' implies a 2 GiB addressing range, this 2 GiB can be at any offset as
opposed to 'small', which implies the first 2 GiB only.
Note that LLVM/Clang currently specifies code models differently to GCC, where
small and medium imply the same functionality as GCC's medlow and medany
respectively.
Differential Revision: https://reviews.llvm.org/D54143
Patch by Lewis Revill.
llvm-svn: 357393
Diffstat (limited to 'llvm/lib/Target/RISCV/RISCVISelLowering.h')
-rw-r--r-- | llvm/lib/Target/RISCV/RISCVISelLowering.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.h b/llvm/lib/Target/RISCV/RISCVISelLowering.h index 57546a00299..0686a7f4997 100644 --- a/llvm/lib/Target/RISCV/RISCVISelLowering.h +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.h @@ -141,6 +141,10 @@ private: Type *Ty) const override { return true; } + + template <class NodeTy> + SDValue getAddr(NodeTy *N, SelectionDAG &DAG) const; + SDValue lowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const; SDValue lowerBlockAddress(SDValue Op, SelectionDAG &DAG) const; SDValue lowerConstantPool(SDValue Op, SelectionDAG &DAG) const; |