summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCISelLowering.h
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2016-11-16 00:37:30 +0000
committerJoerg Sonnenberger <joerg@bec.de>2016-11-16 00:37:30 +0000
commit8c1a9ac52b560b1dd63269665965b2baffef0e9b (patch)
tree95155b0c015a29dee6d0ef4e22ae10b6a3e1c03f /llvm/lib/Target/PowerPC/PPCISelLowering.h
parentca185797666f429f95c811f9fd19a02ab21cd465 (diff)
downloadbcm5719-llvm-8c1a9ac52b560b1dd63269665965b2baffef0e9b.tar.gz
bcm5719-llvm-8c1a9ac52b560b1dd63269665965b2baffef0e9b.zip
Always use relative jump table encodings on PowerPC64.
For the default, small and medium code model, use the existing difference from the jump table towards the label. For all other code models, setup the picbase and use the difference between the picbase and the block address. Overall, this results in smaller data tables at the expensive of one or two more arithmetic operation at the jump site. Given that we only create jump tables with a lot more than two entries, it is a net win in size. For larger code models the assumption remains that individual functions are no larger than 2GB. Differential Revision: https://reviews.llvm.org/D26336 llvm-svn: 287059
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCISelLowering.h')
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.h b/llvm/lib/Target/PowerPC/PPCISelLowering.h
index 689a2e6bb68..6f9cc2491c5 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.h
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.h
@@ -770,6 +770,15 @@ namespace llvm {
void insertSSPDeclarations(Module &M) const override;
bool isFPImmLegal(const APFloat &Imm, EVT VT) const override;
+
+ unsigned getJumpTableEncoding() const override;
+ bool isJumpTableRelative() const override;
+ SDValue getPICJumpTableRelocBase(SDValue Table,
+ SelectionDAG &DAG) const override;
+ const MCExpr *getPICJumpTableRelocBaseExpr(const MachineFunction *MF,
+ unsigned JTI,
+ MCContext &Ctx) const override;
+
private:
struct ReuseLoadInfo {
SDValue Ptr;
OpenPOWER on IntegriCloud