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

Side by Side Diff: src/IceClFlags.h

Issue 1571433004: Implements include/exclude register lists for translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 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
« no previous file with comments | « src/IceCfg.h ('k') | src/IceClFlags.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/IceClFlags.h - Cl Flags for translation ------*- C++ -*-===// 1 //===- subzero/src/IceClFlags.h - Cl Flags for translation ------*- 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 /// \file 10 /// \file
(...skipping 10 matching lines...) Expand all
21 namespace Ice { 21 namespace Ice {
22 22
23 class ClFlagsExtra; 23 class ClFlagsExtra;
24 24
25 /// Define variables which configure translation and related support functions. 25 /// Define variables which configure translation and related support functions.
26 class ClFlags { 26 class ClFlags {
27 ClFlags(const ClFlags &) = delete; 27 ClFlags(const ClFlags &) = delete;
28 ClFlags &operator=(const ClFlags &) = delete; 28 ClFlags &operator=(const ClFlags &) = delete;
29 29
30 public: 30 public:
31 using StringVector = std::vector<IceString>;
32
31 /// User defined constructor. 33 /// User defined constructor.
32 ClFlags() { resetClFlags(*this); } 34 ClFlags() { resetClFlags(*this); }
33 35
34 /// \brief Parse commmand line options for Subzero. 36 /// \brief Parse commmand line options for Subzero.
35 /// 37 ///
36 /// This is done use cl::ParseCommandLineOptions() and the static variables of 38 /// This is done use cl::ParseCommandLineOptions() and the static variables of
37 /// type cl::opt defined in IceClFlags.cpp 39 /// type cl::opt defined in IceClFlags.cpp
38 static void parseFlags(int argc, char *argv[]); 40 static void parseFlags(int argc, char *argv[]);
39 /// Reset all configuration options to their nominal values. 41 /// Reset all configuration options to their nominal values.
40 static void resetClFlags(ClFlags &OutFlags); 42 static void resetClFlags(ClFlags &OutFlags);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 /// Get the value of ClFlags::DumpStats 110 /// Get the value of ClFlags::DumpStats
109 bool getDumpStats() const { return BuildDefs::dump() && DumpStats; } 111 bool getDumpStats() const { return BuildDefs::dump() && DumpStats; }
110 /// Set ClFlags::DumpStats to a new value 112 /// Set ClFlags::DumpStats to a new value
111 void setDumpStats(bool NewValue) { DumpStats = NewValue; } 113 void setDumpStats(bool NewValue) { DumpStats = NewValue; }
112 114
113 /// Get the value of ClFlags::EnableBlockProfile 115 /// Get the value of ClFlags::EnableBlockProfile
114 bool getEnableBlockProfile() const { return EnableBlockProfile; } 116 bool getEnableBlockProfile() const { return EnableBlockProfile; }
115 /// Set ClFlags::EnableBlockProfile to a new value 117 /// Set ClFlags::EnableBlockProfile to a new value
116 void setEnableBlockProfile(bool NewValue) { EnableBlockProfile = NewValue; } 118 void setEnableBlockProfile(bool NewValue) { EnableBlockProfile = NewValue; }
117 119
120 /// Get the restricted list of registers to use, for corresponding register
121 /// classes, in register allocation.
122 const StringVector &getUseRestrictedRegisters() const {
123 return UseRestrictedRegisters;
124 }
125 void clearUseRestrictedRegisters() { UseRestrictedRegisters.clear(); }
126 void setUseRestrictedRegisters(const StringVector &Registers) {
127 UseRestrictedRegisters = Registers;
128 }
129
118 /// Get the value of ClFlags::ForceMemIntrinOpt 130 /// Get the value of ClFlags::ForceMemIntrinOpt
119 bool getForceMemIntrinOpt() const { return ForceMemIntrinOpt; } 131 bool getForceMemIntrinOpt() const { return ForceMemIntrinOpt; }
120 /// Set ClFlags::ForceMemIntrinOpt to a new value 132 /// Set ClFlags::ForceMemIntrinOpt to a new value
121 void setForceMemIntrinOpt(bool NewValue) { ForceMemIntrinOpt = NewValue; } 133 void setForceMemIntrinOpt(bool NewValue) { ForceMemIntrinOpt = NewValue; }
122 134
123 /// Get the value of ClFlags::FunctionSections 135 /// Get the value of ClFlags::FunctionSections
124 bool getFunctionSections() const { return FunctionSections; } 136 bool getFunctionSections() const { return FunctionSections; }
125 /// Set ClFlags::FunctionSections to a new value 137 /// Set ClFlags::FunctionSections to a new value
126 void setFunctionSections(bool NewValue) { FunctionSections = NewValue; } 138 void setFunctionSections(bool NewValue) { FunctionSections = NewValue; }
127 139
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 return BuildDefs::dump() && TimeEachFunction; 191 return BuildDefs::dump() && TimeEachFunction;
180 } 192 }
181 /// Set ClFlags::TimeEachFunction to a new value 193 /// Set ClFlags::TimeEachFunction to a new value
182 void setTimeEachFunction(bool NewValue) { TimeEachFunction = NewValue; } 194 void setTimeEachFunction(bool NewValue) { TimeEachFunction = NewValue; }
183 195
184 /// Get the value of ClFlags::UseNonsfi 196 /// Get the value of ClFlags::UseNonsfi
185 bool getUseNonsfi() const { return UseNonsfi; } 197 bool getUseNonsfi() const { return UseNonsfi; }
186 /// Set ClFlags::UseNonsfi to a new value 198 /// Set ClFlags::UseNonsfi to a new value
187 void setUseNonsfi(bool NewValue) { UseNonsfi = NewValue; } 199 void setUseNonsfi(bool NewValue) { UseNonsfi = NewValue; }
188 200
201 /// Get the list of registers exluded in register allocation.
202 const StringVector &getExcludedRegisters() const { return ExcludedRegisters; }
203 void clearExcludedRegisters() { ExcludedRegisters.clear(); }
204 void setExcludedRegisters(const StringVector &Registers) {
205 ExcludedRegisters = Registers;
206 }
207
189 /// Get the value of ClFlags::UseSandboxing 208 /// Get the value of ClFlags::UseSandboxing
190 bool getUseSandboxing() const { return UseSandboxing; } 209 bool getUseSandboxing() const { return UseSandboxing; }
191 /// Set ClFlags::UseSandboxing to a new value 210 /// Set ClFlags::UseSandboxing to a new value
192 void setUseSandboxing(bool NewValue) { UseSandboxing = NewValue; } 211 void setUseSandboxing(bool NewValue) { UseSandboxing = NewValue; }
193 212
194 // Enum and integer accessors. 213 // Enum and integer accessors.
195 /// Get the value of ClFlags::Opt 214 /// Get the value of ClFlags::Opt
196 OptLevel getOptLevel() const { return Opt; } 215 OptLevel getOptLevel() const { return Opt; }
197 /// Set ClFlags::Opt to a new value 216 /// Set ClFlags::Opt to a new value
198 void setOptLevel(OptLevel NewValue) { Opt = NewValue; } 217 void setOptLevel(OptLevel NewValue) { Opt = NewValue; }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 /// see anonymous_namespace{IceClFlags.cpp}::DisableHybridAssembly 402 /// see anonymous_namespace{IceClFlags.cpp}::DisableHybridAssembly
384 bool DisableHybridAssembly; 403 bool DisableHybridAssembly;
385 /// see anonymous_namespace{IceClFlags.cpp}::DisableInternal 404 /// see anonymous_namespace{IceClFlags.cpp}::DisableInternal
386 bool DisableInternal; 405 bool DisableInternal;
387 /// see anonymous_namespace{IceClFlags.cpp}::DisableTranslation 406 /// see anonymous_namespace{IceClFlags.cpp}::DisableTranslation
388 bool DisableTranslation; 407 bool DisableTranslation;
389 /// see anonymous_namespace{IceClFlags.cpp}::DumpStats 408 /// see anonymous_namespace{IceClFlags.cpp}::DumpStats
390 bool DumpStats; 409 bool DumpStats;
391 /// see anonymous_namespace{IceClFlags.cpp}::EnableBlockProfile 410 /// see anonymous_namespace{IceClFlags.cpp}::EnableBlockProfile
392 bool EnableBlockProfile; 411 bool EnableBlockProfile;
412 /// see anonymous_namespace{IceClFlags.cpp}::ExcludedRegisters;
413 StringVector ExcludedRegisters;
393 /// see anonymous_namespace{IceClFlags.cpp}::ForceMemIntrinOpt 414 /// see anonymous_namespace{IceClFlags.cpp}::ForceMemIntrinOpt
394 bool ForceMemIntrinOpt; 415 bool ForceMemIntrinOpt;
395 /// see anonymous_namespace{IceClFlags.cpp}::FunctionSections 416 /// see anonymous_namespace{IceClFlags.cpp}::FunctionSections
396 bool FunctionSections; 417 bool FunctionSections;
397 /// Initialized to false; not set by the command line. 418 /// Initialized to false; not set by the command line.
398 bool GenerateUnitTestMessages; 419 bool GenerateUnitTestMessages;
399 /// see anonymous_namespace{IceClFlags.cpp}::MockBoundsCheck 420 /// see anonymous_namespace{IceClFlags.cpp}::MockBoundsCheck
400 bool MockBoundsCheck; 421 bool MockBoundsCheck;
401 /// see anonymous_namespace{IceClFlags.cpp}::EnablePhiEdgeSplit 422 /// see anonymous_namespace{IceClFlags.cpp}::EnablePhiEdgeSplit
402 bool PhiEdgeSplit; 423 bool PhiEdgeSplit;
(...skipping 12 matching lines...) Expand all
415 /// see anonymous_namespace{IceClFlags.cpp}::ReorderPooledConstants 436 /// see anonymous_namespace{IceClFlags.cpp}::ReorderPooledConstants
416 bool ReorderPooledConstants; 437 bool ReorderPooledConstants;
417 /// see anonymous_namespace{IceClFlags.cpp}::SkipUnimplemented 438 /// see anonymous_namespace{IceClFlags.cpp}::SkipUnimplemented
418 bool SkipUnimplemented; 439 bool SkipUnimplemented;
419 /// see anonymous_namespace{IceClFlags.cpp}::SubzeroTimingEnabled 440 /// see anonymous_namespace{IceClFlags.cpp}::SubzeroTimingEnabled
420 bool SubzeroTimingEnabled; 441 bool SubzeroTimingEnabled;
421 /// see anonymous_namespace{IceClFlags.cpp}::TimeEachFunction 442 /// see anonymous_namespace{IceClFlags.cpp}::TimeEachFunction
422 bool TimeEachFunction; 443 bool TimeEachFunction;
423 /// see anonymous_namespace{IceClFlags.cpp}::UseNonsfi 444 /// see anonymous_namespace{IceClFlags.cpp}::UseNonsfi
424 bool UseNonsfi; 445 bool UseNonsfi;
446 /// see anonymous_namespace{IceClFlags.cpp}::UseRegistrictedRegisters;
447 StringVector UseRestrictedRegisters;
425 /// see anonymous_namespace{IceClFlags.cpp}::UseSandboxing 448 /// see anonymous_namespace{IceClFlags.cpp}::UseSandboxing
426 bool UseSandboxing; 449 bool UseSandboxing;
427 /// see anonymous_namespace{IceClFlags.cpp}::OLevel 450 /// see anonymous_namespace{IceClFlags.cpp}::OLevel
428 OptLevel Opt; 451 OptLevel Opt;
429 /// see anonymous_namespace{IceClFlags.cpp}::OutFileType 452 /// see anonymous_namespace{IceClFlags.cpp}::OutFileType
430 FileType OutFileType; 453 FileType OutFileType;
431 /// see anonymous_namespace{IceClFlags.cpp}::RandomizeAndPoolImmediatesOption 454 /// see anonymous_namespace{IceClFlags.cpp}::RandomizeAndPoolImmediatesOption
432 RandomizeAndPoolImmediatesEnum RandomizeAndPoolImmediatesOption; 455 RandomizeAndPoolImmediatesEnum RandomizeAndPoolImmediatesOption;
433 /// see 456 /// see
434 /// anonymous_namespace{IceClFlags.cpp}::RandomizeAndPoolImmediatesThreshold 457 /// anonymous_namespace{IceClFlags.cpp}::RandomizeAndPoolImmediatesThreshold
(...skipping 27 matching lines...) Expand all
462 /// see anonymous_namespace{IceClFlags.cpp}::NumThreads 485 /// see anonymous_namespace{IceClFlags.cpp}::NumThreads
463 486
464 size_t NumTranslationThreads; // 0 means completely sequential 487 size_t NumTranslationThreads; // 0 means completely sequential
465 /// see anonymous_namespace{IceClFlags.cpp}::RandomSeed 488 /// see anonymous_namespace{IceClFlags.cpp}::RandomSeed
466 uint64_t RandomSeed; 489 uint64_t RandomSeed;
467 }; 490 };
468 491
469 } // end of namespace Ice 492 } // end of namespace Ice
470 493
471 #endif // SUBZERO_SRC_ICECLFLAGS_H 494 #endif // SUBZERO_SRC_ICECLFLAGS_H
OLDNEW
« no previous file with comments | « src/IceCfg.h ('k') | src/IceClFlags.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698