diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-10-02 22:23:14 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-10-02 22:23:14 +0000 |
commit | bbb28e7e98250e4fa218587633c700ee009e261f (patch) | |
tree | 86a37025845e040366bc977031c76e0493ee8a66 /lib/CodeGen/SpillPlacement.h | |
parent | b3f91b0af71d53114eae92424c00e5f26567c017 (diff) |
Fix the threshold added in r186434 (a re-apply of r185393) and updaated
to be a ManagedStatic in r218163 to not be a global variable written and
read to from within the innards of SpillPlacement.
This will fix a really scary race condition for anyone that has two
copies of LLVM running spill placement concurrently. Yikes!
This will also fix a really significant compile time hit that r218163
caused because the spill placement threshold read is actually in the
*very* hot path of this code. The memory fence on each read was showing
up as huge compile time regressions when spilling is responsible for
most of the compile time. For example, optimizing sanitized code showed
over 50% compile time regressions here. =/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SpillPlacement.h')
-rw-r--r-- | lib/CodeGen/SpillPlacement.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SpillPlacement.h b/lib/CodeGen/SpillPlacement.h index 03cf5cd7424..622361e7e80 100644 --- a/lib/CodeGen/SpillPlacement.h +++ b/lib/CodeGen/SpillPlacement.h @@ -62,6 +62,10 @@ class SpillPlacement : public MachineFunctionPass { // Block frequencies are computed once. Indexed by block number. SmallVector<BlockFrequency, 8> BlockFrequencies; + /// Decision threshold. A node gets the output value 0 if the weighted sum of + /// its inputs falls in the open interval (-Threshold;Threshold). + BlockFrequency Threshold; + public: static char ID; // Pass identification, replacement for typeid. @@ -152,6 +156,7 @@ private: void releaseMemory() override; void activate(unsigned); + void setThreshold(const BlockFrequency &Entry); }; } // end namespace llvm |