summaryrefslogtreecommitdiff
path: root/src/jit/copyprop.cpp
diff options
context:
space:
mode:
authorMike Danes <onemihaid@hotmail.com>2017-11-09 08:18:48 +0200
committerMike Danes <onemihaid@hotmail.com>2017-11-09 08:41:56 +0200
commit028ee930f8f965715b0a82ad16917e9942701f65 (patch)
tree23de3c4b9b2ab5185d9a0e59ae92d8a4a92e5e61 /src/jit/copyprop.cpp
parent97c4729dd928bd6ea82f824b6a2d90cfc86af44b (diff)
downloadcoreclr-028ee930f8f965715b0a82ad16917e9942701f65.tar.gz
coreclr-028ee930f8f965715b0a82ad16917e9942701f65.tar.bz2
coreclr-028ee930f8f965715b0a82ad16917e9942701f65.zip
Track actual SSA memory usage
Currently SsaBuilder use comp->getAllocator() in a lot of places so a lot of the memory it allocates lands in CMK_Generic instead of CMK_SSA. Same for CopyProp phase.
Diffstat (limited to 'src/jit/copyprop.cpp')
-rw-r--r--src/jit/copyprop.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/jit/copyprop.cpp b/src/jit/copyprop.cpp
index c9699f190c..12206671f1 100644
--- a/src/jit/copyprop.cpp
+++ b/src/jit/copyprop.cpp
@@ -348,7 +348,7 @@ void Compiler::optBlockCopyProp(BasicBlock* block, LclNumToGenTreePtrStack* curS
GenTreePtrStack* stack;
if (!curSsaName->Lookup(lclNum, &stack))
{
- stack = new (getAllocator()) GenTreePtrStack(this);
+ stack = new (curSsaName->GetAllocator()) GenTreePtrStack(this);
}
stack->Push(tree);
curSsaName->Set(lclNum, stack);
@@ -361,7 +361,7 @@ void Compiler::optBlockCopyProp(BasicBlock* block, LclNumToGenTreePtrStack* curS
GenTreePtrStack* stack;
if (!curSsaName->Lookup(lclNum, &stack))
{
- stack = new (getAllocator()) GenTreePtrStack(this);
+ stack = new (curSsaName->GetAllocator()) GenTreePtrStack(this);
stack->Push(tree);
curSsaName->Set(lclNum, stack);
}
@@ -408,10 +408,11 @@ void Compiler::optVnCopyProp()
{
return;
}
- jitstd::allocator<void> allocator(getAllocator());
+
+ CompAllocator allocator(this, CMK_CopyProp);
// Compute the domTree to use.
- BlkToBlkSetMap* domTree = new (getAllocator()) BlkToBlkSetMap(getAllocator());
+ BlkToBlkSetMap* domTree = new (&allocator) BlkToBlkSetMap(&allocator);
domTree->Reallocate(fgBBcount * 3 / 2); // Prime the allocation
SsaBuilder::ComputeDominators(this, domTree);
@@ -430,10 +431,9 @@ void Compiler::optVnCopyProp()
VarSetOps::AssignNoCopy(this, optCopyPropKillSet, VarSetOps::MakeEmpty(this));
// The map from lclNum to its recently live definitions as a stack.
- LclNumToGenTreePtrStack curSsaName(getAllocator());
+ LclNumToGenTreePtrStack curSsaName(&allocator);
- BlockWorkStack* worklist =
- new (allocate_any<BlockWorkStack>(allocator), jitstd::placement_t()) BlockWorkStack(allocator);
+ BlockWorkStack* worklist = new (&allocator) BlockWorkStack(&allocator);
worklist->push_back(BlockWork(fgFirstBB));
while (!worklist->empty())