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

Side by Side Diff: src/IceTargetLowering.h

Issue 456033003: Subzero: Randomize register assignment. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Typo Created 6 years, 4 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
« no previous file with comments | « src/IceRegAlloc.cpp ('k') | src/IceTargetLowering.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- 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 the TargetLowering and LoweringContext 10 // This file declares the TargetLowering and LoweringContext
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 RegSet_FramePointer = 1 << 3, 149 RegSet_FramePointer = 1 << 3,
150 RegSet_All = ~RegSet_None 150 RegSet_All = ~RegSet_None
151 }; 151 };
152 typedef uint32_t RegSetMask; 152 typedef uint32_t RegSetMask;
153 153
154 virtual llvm::SmallBitVector getRegisterSet(RegSetMask Include, 154 virtual llvm::SmallBitVector getRegisterSet(RegSetMask Include,
155 RegSetMask Exclude) const = 0; 155 RegSetMask Exclude) const = 0;
156 virtual const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const = 0; 156 virtual const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const = 0;
157 void regAlloc(); 157 void regAlloc();
158 158
159 virtual void makeRandomRegisterPermutation(
160 llvm::SmallVectorImpl<int32_t> &Permutation,
161 const llvm::SmallBitVector &ExcludeRegisters) = 0;
162
159 virtual void emitVariable(const Variable *Var, const Cfg *Func) const = 0; 163 virtual void emitVariable(const Variable *Var, const Cfg *Func) const = 0;
160 164
161 // Performs target-specific argument lowering. 165 // Performs target-specific argument lowering.
162 virtual void lowerArguments() = 0; 166 virtual void lowerArguments() = 0;
163 167
164 virtual void addProlog(CfgNode *Node) = 0; 168 virtual void addProlog(CfgNode *Node) = 0;
165 virtual void addEpilog(CfgNode *Node) = 0; 169 virtual void addEpilog(CfgNode *Node) = 0;
166 170
167 virtual void emitConstants() const = 0; 171 virtual void emitConstants() const = 0;
168 172
169 virtual ~TargetLowering() {} 173 virtual ~TargetLowering() {}
170 174
171 protected: 175 protected:
172 TargetLowering(Cfg *Func) 176 TargetLowering(Cfg *Func);
173 : Func(Func), Ctx(Func->getContext()), HasComputedFrame(false),
174 StackAdjustment(0) {}
175 virtual void lowerAlloca(const InstAlloca *Inst) = 0; 177 virtual void lowerAlloca(const InstAlloca *Inst) = 0;
176 virtual void lowerArithmetic(const InstArithmetic *Inst) = 0; 178 virtual void lowerArithmetic(const InstArithmetic *Inst) = 0;
177 virtual void lowerAssign(const InstAssign *Inst) = 0; 179 virtual void lowerAssign(const InstAssign *Inst) = 0;
178 virtual void lowerBr(const InstBr *Inst) = 0; 180 virtual void lowerBr(const InstBr *Inst) = 0;
179 virtual void lowerCall(const InstCall *Inst) = 0; 181 virtual void lowerCall(const InstCall *Inst) = 0;
180 virtual void lowerCast(const InstCast *Inst) = 0; 182 virtual void lowerCast(const InstCast *Inst) = 0;
181 virtual void lowerFcmp(const InstFcmp *Inst) = 0; 183 virtual void lowerFcmp(const InstFcmp *Inst) = 0;
182 virtual void lowerExtractElement(const InstExtractElement *Inst) = 0; 184 virtual void lowerExtractElement(const InstExtractElement *Inst) = 0;
183 virtual void lowerIcmp(const InstIcmp *Inst) = 0; 185 virtual void lowerIcmp(const InstIcmp *Inst) = 0;
184 virtual void lowerInsertElement(const InstInsertElement *Inst) = 0; 186 virtual void lowerInsertElement(const InstInsertElement *Inst) = 0;
(...skipping 16 matching lines...) Expand all
201 // subsequent global register allocation pass. 203 // subsequent global register allocation pass.
202 virtual void postLower() {} 204 virtual void postLower() {}
203 205
204 Cfg *Func; 206 Cfg *Func;
205 GlobalContext *Ctx; 207 GlobalContext *Ctx;
206 bool HasComputedFrame; 208 bool HasComputedFrame;
207 // StackAdjustment keeps track of the current stack offset from its 209 // StackAdjustment keeps track of the current stack offset from its
208 // natural location, as arguments are pushed for a function call. 210 // natural location, as arguments are pushed for a function call.
209 int32_t StackAdjustment; 211 int32_t StackAdjustment;
210 LoweringContext Context; 212 LoweringContext Context;
213 const bool RandomizeRegisterAllocation;
211 214
212 private: 215 private:
213 TargetLowering(const TargetLowering &) LLVM_DELETED_FUNCTION; 216 TargetLowering(const TargetLowering &) LLVM_DELETED_FUNCTION;
214 TargetLowering &operator=(const TargetLowering &) LLVM_DELETED_FUNCTION; 217 TargetLowering &operator=(const TargetLowering &) LLVM_DELETED_FUNCTION;
215 }; 218 };
216 219
217 // TargetGlobalInitLowering is used for "lowering" global 220 // TargetGlobalInitLowering is used for "lowering" global
218 // initializers. It is separated out from TargetLowering because it 221 // initializers. It is separated out from TargetLowering because it
219 // does not require a Cfg. 222 // does not require a Cfg.
220 class TargetGlobalInitLowering { 223 class TargetGlobalInitLowering {
(...skipping 14 matching lines...) Expand all
235 private: 238 private:
236 TargetGlobalInitLowering(const TargetGlobalInitLowering &) 239 TargetGlobalInitLowering(const TargetGlobalInitLowering &)
237 LLVM_DELETED_FUNCTION; 240 LLVM_DELETED_FUNCTION;
238 TargetGlobalInitLowering & 241 TargetGlobalInitLowering &
239 operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION; 242 operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION;
240 }; 243 };
241 244
242 } // end of namespace Ice 245 } // end of namespace Ice
243 246
244 #endif // SUBZERO_SRC_ICETARGETLOWERING_H 247 #endif // SUBZERO_SRC_ICETARGETLOWERING_H
OLDNEW
« no previous file with comments | « src/IceRegAlloc.cpp ('k') | src/IceTargetLowering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698