llvm/lib/IR
Mehdi Amini 2de9927963 Add a flag to the LLVMContext to disable name for Value other than GlobalValue
Summary:
This is intended to be a performance flag, on the same level as clang
cc1 option "--disable-free". LLVM will never initialize it by default,
it will be up to the client creating the LLVMContext to request this
behavior. Clang will do it by default in Release build (just like
--disable-free).

"opt" and "llc" can opt-in using -disable-named-value command line
option.

When performing LTO on llvm-tblgen, the initial merging of IR peaks
at 92MB without this patch, and 86MB after this patch,setNameImpl()
drops from 6.5MB to 0.5MB.
The total link time goes from ~29.5s to ~27.8s.

Compared to a compile-time flag (like the IRBuilder one), it performs
very close. I profiled on SROA and obtain these results:

 420ms with IRBuilder that preserve name
 372ms with IRBuilder that strip name
 375ms with IRBuilder that preserve name, and a runtime flag to strip

Reviewers: chandlerc, dexonsmith, bogner

Subscribers: joker.eph, llvm-commits

Differential Revision: http://reviews.llvm.org/D17946

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-10 01:28:54 +00:00
..
AsmWriter.cpp [IR] Provide an API to skip the details of a structured type when printed. 2016-03-07 22:32:42 +00:00
AttributeImpl.h Remove TrailingObjects::operator delete. It's still suffering from 2016-02-09 02:09:16 +00:00
Attributes.cpp AttributeSetImpl: Summarize existing function attributes in a bitset. 2016-01-29 22:25:19 +00:00
AttributesCompatFunc.td
AutoUpgrade.cpp
BasicBlock.cpp ADT: Stop using getNodePtrUnchecked on end() iterators 2016-02-21 19:52:15 +00:00
CMakeLists.txt [cmake] Remove /Og- flag which was working around PR24785 2016-01-27 01:52:46 +00:00
Comdat.cpp
ConstantFold.cpp IR: Make the X / undef -> undef fold match the comment 2016-02-25 01:02:18 +00:00
ConstantFold.h
ConstantRange.cpp [ConstantRange] Generalize makeGuaranteedNoWrapRegion to work on ranges 2016-03-03 18:31:16 +00:00
Constants.cpp IR: Add ConstantData, for operand-less Constants 2016-02-21 02:39:49 +00:00
ConstantsContext.h Add a new insert_as() method to DenseMap and use it for ConstantUniqueMap 2016-03-07 00:51:00 +00:00
Core.cpp Small formating change in Core.cpp . NFC 2016-03-07 21:39:20 +00:00
DataLayout.cpp Replace Type::getInt32Ty() and comparison by isIntegerTy(32). NFC. 2016-01-22 03:30:27 +00:00
DebugInfo.cpp One more batch of self-containing headers. 2016-01-27 19:29:56 +00:00
DebugInfoMetadata.cpp Move discriminator assignment to the right place. 2016-02-29 18:59:48 +00:00
DebugLoc.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 20:50:44 +00:00
DiagnosticInfo.cpp Refactor backend diagnostics for unsupported features 2016-02-02 13:52:43 +00:00
DiagnosticPrinter.cpp
DIBuilder.cpp
Dominators.cpp [PM] Appease mingw32's auto-import DLL build with minimal tweaks, with fix for clang. 2016-02-28 17:17:00 +00:00
Function.cpp Remove uses of builtin comma operator. 2016-02-18 22:09:30 +00:00
FunctionInfo.cpp Restore "[ThinLTO] Use MD5 hash in function index." with fix 2016-02-10 21:55:02 +00:00
GCOV.cpp llvm-cov: Fix reading gcov data that does not have function names 2016-02-08 22:49:40 +00:00
Globals.cpp Simplify handleOperandChangeImpl() removing last argument (NFC) 2016-02-10 22:47:15 +00:00
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp
Instructions.cpp Fix pointers to go on the right hand side. NFC. 2016-02-03 21:34:39 +00:00
IntrinsicInst.cpp Handle more edge cases in intrinsic name binary search 2016-01-26 22:33:19 +00:00
IRBuilder.cpp Fix warning on build without asserts 2016-02-17 21:16:59 +00:00
IRPrintingPasses.cpp
LegacyPassManager.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 20:50:44 +00:00
LLVMBuild.txt
LLVMContext.cpp Add a flag to the LLVMContext to disable name for Value other than GlobalValue 2016-03-10 01:28:54 +00:00
LLVMContextImpl.cpp
LLVMContextImpl.h Add a flag to the LLVMContext to disable name for Value other than GlobalValue 2016-03-10 01:28:54 +00:00
Mangler.cpp
MDBuilder.cpp
Metadata.cpp Revert "Query the StringMap only once when creating MDString (NFC)" 2016-02-17 02:18:58 +00:00
MetadataImpl.h
Module.cpp Restore "[ThinLTO] Use MD5 hash in function index." with fix 2016-02-10 21:55:02 +00:00
module.modulemap
Operator.cpp
Pass.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 20:50:44 +00:00
PassManager.cpp [PM] Appease mingw32's auto-import DLL build with minimal tweaks, with fix for clang. 2016-02-28 17:17:00 +00:00
PassRegistry.cpp
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp
TypeFinder.cpp
Use.cpp
User.cpp
Value.cpp Add a flag to the LLVMContext to disable name for Value other than GlobalValue 2016-03-10 01:28:54 +00:00
ValueSymbolTable.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 20:50:44 +00:00
ValueTypes.cpp Add isScalarInteger helper to EVT/MVT 2016-03-01 18:01:28 +00:00
Verifier.cpp [Verifier] Don't abort on invalid cleanuprets 2016-03-01 18:59:50 +00:00