CodeGen, Target: Move Mach-O-specific symbol name logic to Mach-O lowering.
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 3 Nov 2015 23:40:03 +0000 (23:40 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 3 Nov 2015 23:40:03 +0000 (23:40 +0000)
commit05f66f37e6c39b22610caeeedd4eaa850bc8dee5
tree91171976544afe5e4b0f0cc01a4a952615df5dcf
parent0fa6f807f069e717b52e17ce906023da07d726ad
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252014 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
include/llvm/Target/TargetLoweringObjectFile.h
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
lib/Target/TargetLoweringObjectFile.cpp
lib/Target/TargetMachine.cpp