Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(932)

Side by Side Diff: src/IceDefs.h

Issue 870653002: Subzero: Initial implementation of multithreaded translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes, continued Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceDefs.h - Common Subzero declaraions -------*- C++ -*-===// 1 //===- subzero/src/IceDefs.h - Common Subzero declaraions -------*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file declares various useful types and classes that have 10 // This file declares various useful types and classes that have
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 class FunctionDeclaration; 58 class FunctionDeclaration;
59 class GlobalContext; 59 class GlobalContext;
60 class GlobalDeclaration; 60 class GlobalDeclaration;
61 class Inst; 61 class Inst;
62 class InstAssign; 62 class InstAssign;
63 class InstPhi; 63 class InstPhi;
64 class InstTarget; 64 class InstTarget;
65 class LiveRange; 65 class LiveRange;
66 class Liveness; 66 class Liveness;
67 class Operand; 67 class Operand;
68 class TargetGlobalLowering;
68 class TargetLowering; 69 class TargetLowering;
69 class Variable; 70 class Variable;
70 class VariableDeclaration; 71 class VariableDeclaration;
71 class VariablesMetadata; 72 class VariablesMetadata;
72 73
73 template <size_t SlabSize = 1024 * 1024> 74 template <size_t SlabSize = 1024 * 1024>
74 using ArenaAllocator = 75 using ArenaAllocator =
75 llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, SlabSize>; 76 llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, SlabSize>;
76 77
77 ArenaAllocator<> *getCurrentCfgAllocator(); 78 ArenaAllocator<> *getCurrentCfgAllocator();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // Inst::Number value, giving the instruction number that begins or 121 // Inst::Number value, giving the instruction number that begins or
121 // ends a variable's live range. 122 // ends a variable's live range.
122 typedef std::pair<SizeT, InstNumberT> LiveBeginEndMapEntry; 123 typedef std::pair<SizeT, InstNumberT> LiveBeginEndMapEntry;
123 typedef std::vector<LiveBeginEndMapEntry, 124 typedef std::vector<LiveBeginEndMapEntry,
124 CfgLocalAllocator<LiveBeginEndMapEntry>> LiveBeginEndMap; 125 CfgLocalAllocator<LiveBeginEndMapEntry>> LiveBeginEndMap;
125 typedef llvm::BitVector LivenessBV; 126 typedef llvm::BitVector LivenessBV;
126 127
127 typedef uint32_t TimerStackIdT; 128 typedef uint32_t TimerStackIdT;
128 typedef uint32_t TimerIdT; 129 typedef uint32_t TimerIdT;
129 130
131 // Use alignas(MaxCacheLineSize) to isolate variables/fields that
132 // might be contended while multithreading. Assumes the maximum cache
133 // line size is 64.
134 enum {
135 MaxCacheLineSize = 64
136 };
137
130 // PNaCl is ILP32, so theoretically we should only need 32-bit offsets. 138 // PNaCl is ILP32, so theoretically we should only need 32-bit offsets.
131 typedef int32_t RelocOffsetT; 139 typedef int32_t RelocOffsetT;
132 enum { RelocAddrSize = 4 }; 140 enum { RelocAddrSize = 4 };
133 141
134 enum LivenessMode { 142 enum LivenessMode {
135 // Basic version of live-range-end calculation. Marks the last uses 143 // Basic version of live-range-end calculation. Marks the last uses
136 // of variables based on dataflow analysis. Records the set of 144 // of variables based on dataflow analysis. Records the set of
137 // live-in and live-out variables for each block. Identifies and 145 // live-in and live-out variables for each block. Identifies and
138 // deletes dead instructions (primarily stores). 146 // deletes dead instructions (primarily stores).
139 Liveness_Basic, 147 Liveness_Basic,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return llvm::make_range(Container.rbegin(), Container.rend()); 185 return llvm::make_range(Container.rbegin(), Container.rend());
178 } 186 }
179 template <typename T> 187 template <typename T>
180 llvm::iterator_range<typename T::reverse_iterator> reverse_range(T &Container) { 188 llvm::iterator_range<typename T::reverse_iterator> reverse_range(T &Container) {
181 return llvm::make_range(Container.rbegin(), Container.rend()); 189 return llvm::make_range(Container.rbegin(), Container.rend());
182 } 190 }
183 191
184 } // end of namespace Ice 192 } // end of namespace Ice
185 193
186 #endif // SUBZERO_SRC_ICEDEFS_H 194 #endif // SUBZERO_SRC_ICEDEFS_H
OLDNEW
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceGlobalContext.h » ('j') | src/IceGlobalContext.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698