summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2018-10-24 20:19:09 +0000
committerTim Northover <tnorthover@apple.com>2018-10-24 20:19:09 +0000
commit1c353419ab51f63235389b821c1e6ed02c3ccfb8 (patch)
tree20efe54b2cde1c403729f37ad13e137b7ff32c66 /llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
parent769d4cebadf2ea8442093f156f5497dbe82a3737 (diff)
downloadbcm5719-llvm-1c353419ab51f63235389b821c1e6ed02c3ccfb8.tar.gz
bcm5719-llvm-1c353419ab51f63235389b821c1e6ed02c3ccfb8.zip
AArch64: add a pass to compress jump-table entries when possible.
llvm-svn: 345188
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h')
-rw-r--r--llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h b/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
index e42214d1569..63c0ba2811e 100644
--- a/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
+++ b/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
@@ -162,6 +162,19 @@ public:
unsigned getVarArgsFPRSize() const { return VarArgsFPRSize; }
void setVarArgsFPRSize(unsigned Size) { VarArgsFPRSize = Size; }
+ unsigned getJumpTableEntrySize(int Idx) const {
+ auto It = JumpTableEntryInfo.find(Idx);
+ if (It != JumpTableEntryInfo.end())
+ return It->second.first;
+ return 4;
+ }
+ MCSymbol *getJumpTableEntryPCRelSymbol(int Idx) const {
+ return JumpTableEntryInfo.find(Idx)->second.second;
+ }
+ void setJumpTableEntryInfo(int Idx, unsigned Size, MCSymbol *PCRelSym) {
+ JumpTableEntryInfo[Idx] = std::make_pair(Size, PCRelSym);
+ }
+
using SetOfInstructions = SmallPtrSet<const MachineInstr *, 16>;
const SetOfInstructions &getLOHRelated() const { return LOHRelated; }
@@ -200,6 +213,8 @@ private:
// Hold the lists of LOHs.
MILOHContainer LOHContainerSet;
SetOfInstructions LOHRelated;
+
+ DenseMap<int, std::pair<unsigned, MCSymbol *>> JumpTableEntryInfo;
};
} // end namespace llvm
OpenPOWER on IntegriCloud