diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-07-18 00:35:01 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-07-18 00:35:01 +0000 |
| commit | aa2417835ec86bca73dec9bce1de10e5c31b1833 (patch) | |
| tree | d9b1e56b2013914a34204389c63fb1aef6842173 /llvm/lib/Transforms/Scalar | |
| parent | 4c66a714c33833378c09fcd895db7caaf7be5a78 (diff) | |
| download | bcm5719-llvm-aa2417835ec86bca73dec9bce1de10e5c31b1833.tar.gz bcm5719-llvm-aa2417835ec86bca73dec9bce1de10e5c31b1833.zip | |
[GVNHoist] Sink HoistedCtr into GVNHoist
HoistedCtr cannot be a mutated global variable, that will open us up to
races between threads compiling code in parallel.
llvm-svn: 275744
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GVNHoist.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp index 16fc4850715..57f27731e1c 100644 --- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp +++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp @@ -47,8 +47,6 @@ static cl::opt<int> MaxNumberOfBBSInPath( cl::desc("Max number of basic blocks on the path between " "hoisting locations (default = 4, unlimited = -1)")); -static int HoistedCtr = 0; - namespace { // Provides a sorting function based on the execution order of two instructions. @@ -183,11 +181,13 @@ public: DenseMap<const BasicBlock *, unsigned> DFSNumber; BBSideEffectsSet BBSideEffects; MemorySSA *MSSA; + int HoistedCtr; + enum InsKind { Unknown, Scalar, Load, Store }; GVNHoist(DominatorTree *Dt, AliasAnalysis *Aa, MemoryDependenceResults *Md, bool OptForMinSize) - : DT(Dt), AA(Aa), MD(Md), OptForMinSize(OptForMinSize) {} + : DT(Dt), AA(Aa), MD(Md), OptForMinSize(OptForMinSize), HoistedCtr(0) {} // Return true when there are exception handling in BB. bool hasEH(const BasicBlock *BB) { |

