diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2015-11-03 23:40:03 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2015-11-03 23:40:03 +0000 |
commit | 94d778697a0654870aa5808b425ffa8ed88ada93 (patch) | |
tree | 4ee879d556450ca8d5fc31f131b96c1f30921a92 /llvm/include | |
parent | 26014690aab5fcae955bc27cfda990eae7d34385 (diff) | |
download | bcm5719-llvm-94d778697a0654870aa5808b425ffa8ed88ada93.tar.gz bcm5719-llvm-94d778697a0654870aa5808b425ffa8ed88ada93.zip |
CodeGen, Target: Move Mach-O-specific symbol name logic to Mach-O lowering.
A profile of an LTO link of Chrome revealed that we were spending some
~30-50% of execution time in the function Constant::getRelocationInfo(),
which is called from TargetLoweringObjectFile::getKindForGlobal() and in turn
from TargetMachine::getNameWithPrefix().
It turns out that we only need the result of getKindForGlobal() when
targeting Mach-O, so this change moves the relevant part of the logic to
TargetLoweringObjectFileMachO.
NFCI.
Differential Revision: http://reviews.llvm.org/D14168
llvm-svn: 252014
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h | 6 | ||||
-rw-r--r-- | llvm/include/llvm/Target/TargetLoweringObjectFile.h | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h index 9a3abc4dc1f..2f1379131cb 100644 --- a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h +++ b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h @@ -123,6 +123,9 @@ public: const MCValue &MV, int64_t Offset, MachineModuleInfo *MMI, MCStreamer &Streamer) const override; + + void getNameWithPrefix(SmallVectorImpl<char> &OutName, const GlobalValue *GV, + Mangler &Mang, const TargetMachine &TM) const override; }; @@ -140,8 +143,7 @@ public: const TargetMachine &TM) const override; void getNameWithPrefix(SmallVectorImpl<char> &OutName, const GlobalValue *GV, - bool CannotUsePrivateLabel, Mangler &Mang, - const TargetMachine &TM) const override; + Mangler &Mang, const TargetMachine &TM) const override; MCSection *getSectionForJumpTable(const Function &F, Mangler &Mang, const TargetMachine &TM) const override; diff --git a/llvm/include/llvm/Target/TargetLoweringObjectFile.h b/llvm/include/llvm/Target/TargetLoweringObjectFile.h index 7cf23b5a388..cb52698c58b 100644 --- a/llvm/include/llvm/Target/TargetLoweringObjectFile.h +++ b/llvm/include/llvm/Target/TargetLoweringObjectFile.h @@ -93,8 +93,7 @@ public: } virtual void getNameWithPrefix(SmallVectorImpl<char> &OutName, - const GlobalValue *GV, - bool CannotUsePrivateLabel, Mangler &Mang, + const GlobalValue *GV, Mangler &Mang, const TargetMachine &TM) const; virtual MCSection *getSectionForJumpTable(const Function &F, Mangler &Mang, |