Fix a major source of compile-time slowness at -O0 -g by optimizing

the storage of !dbg metadata kinds in the instruction themselves.
The on-the-side hash table works great for metadata that not-all
instructions get, or for metadata that only exists when optimizing.
But when compile-time is everything, it isn't great.

I'm not super thrilled with the fact that this plops a TrackingVH in
Instruction, because it grows it by 3 words.  I'm investigating 
alternatives, but this should be a step in the right direction in any
case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99957 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-03-30 23:03:27 +00:00
parent bfcd61b907
commit ec39f095f5
6 changed files with 60 additions and 17 deletions

View File

@ -22,7 +22,7 @@ using namespace llvm;
Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
Instruction *InsertBefore)
: User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) {
: User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0), DbgInfo(0) {
// Make sure that we get added to a basicblock
LeakDetector::addGarbageObject(this);
@ -36,7 +36,7 @@ Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
BasicBlock *InsertAtEnd)
: User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) {
: User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0), DbgInfo(0) {
// Make sure that we get added to a basicblock
LeakDetector::addGarbageObject(this);