summaryrefslogtreecommitdiff
path: root/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorTim Northover <Tim.Northover@arm.com>2013-05-04 16:53:46 +0000
committerTim Northover <Tim.Northover@arm.com>2013-05-04 16:53:46 +0000
commit45db92038bf540fbbd8dfe5dff520aa8566d7cef (patch)
treeca210cce14ab88407e790cc51f1718b98218cbfa /lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
parent0c66f30325848014eda3203da5fae4c2e71a2884 (diff)
downloadllvm-45db92038bf540fbbd8dfe5dff520aa8566d7cef.tar.gz
llvm-45db92038bf540fbbd8dfe5dff520aa8566d7cef.tar.bz2
llvm-45db92038bf540fbbd8dfe5dff520aa8566d7cef.tar.xz
AArch64: implement large code model access to global variables.
The MOVZ/MOVK instruction sequence may not be the most efficient (a literal-pool load could be better) but adding that would require reinstating the ConstantIslands pass. For now the sequence is correct, and that's enough. Beware, as of commit GNU ld does not appear to support the relocations needed for this. Its primary purpose (for now) will be to support JITed code, since in that case there is no guarantee of where your code will end up in memory relative to external symbols it references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/AArch64/AArch64ISelDAGToDAG.cpp')
-rw-r--r--lib/Target/AArch64/AArch64ISelDAGToDAG.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp b/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
index 468c56156a..863cf6f857 100644
--- a/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
+++ b/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
@@ -70,6 +70,15 @@ public:
return SelectCVTFixedPosOperand(N, FixedPos, RegWidth);
}
+ /// Used for pre-lowered address-reference nodes, so we already know
+ /// the fields match. This operand's job is simply to add an
+ /// appropriate shift operand (i.e. 0) to the MOVZ/MOVK instruction.
+ bool SelectMOVWAddressRef(SDValue N, SDValue &Imm, SDValue &Shift) {
+ Imm = N;
+ Shift = CurDAG->getTargetConstant(0, MVT::i32);
+ return true;
+ }
+
bool SelectFPZeroOperand(SDValue N, SDValue &Dummy);
bool SelectCVTFixedPosOperand(SDValue N, SDValue &FixedPos,