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

Unified Diff: src/IceClFlags.cpp

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceClFlags.h ('k') | src/IceDefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceClFlags.cpp
diff --git a/src/IceClFlags.cpp b/src/IceClFlags.cpp
index 6d5b30cc38e6c80cc71651d0bbd49cc54d1290e0..28db1b01a65d0aee2023dab81b8a2207a9440869 100644
--- a/src/IceClFlags.cpp
+++ b/src/IceClFlags.cpp
@@ -293,6 +293,17 @@ cl::opt<int> NopProbabilityAsPercentage(
"nop-insertion-percentage",
cl::desc("Nop insertion probability as percentage"), cl::init(10));
+/// Restricts registers in corresponding register classes to specified list.
+cl::list<std::string> UseRestrictedRegisters(
+ "reg-use", cl::CommaSeparated,
+ cl::desc(
+ "Only use specified registers for corresponding register classes"));
+
+/// List of excluded registers.
+cl::list<std::string>
+ ExcludedRegisters("reg-exclude", cl::CommaSeparated,
+ cl::desc("Don't use specified registers"));
+
/// Verbose options (can be comma-separated).
cl::list<Ice::VerboseItem> VerboseList(
"verbose", cl::CommaSeparated,
@@ -315,6 +326,8 @@ cl::list<Ice::VerboseItem> VerboseList(
clEnumValN(Ice::IceV_Loop, "loop", "Loop nest depth analysis"),
clEnumValN(Ice::IceV_Status, "status",
"Print the name of the function being translated"),
+ clEnumValN(Ice::IceV_AvailableRegs, "registers",
+ "Show available registers for register allocation"),
clEnumValN(Ice::IceV_All, "all", "Use all verbose options"),
clEnumValN(Ice::IceV_Most, "most",
"Use all verbose options except 'regalloc'"),
@@ -487,6 +500,9 @@ void ClFlags::resetClFlags(ClFlags &OutFlags) {
// size_t and 64-bit fields.
OutFlags.NumTranslationThreads = 0;
OutFlags.RandomSeed = 0;
+ // Unordered set fields.
+ OutFlags.clearExcludedRegisters();
+ OutFlags.clearUseRestrictedRegisters();
}
void ClFlags::getParsedClFlags(ClFlags &OutFlags) {
@@ -513,6 +529,7 @@ void ClFlags::getParsedClFlags(ClFlags &OutFlags) {
OutFlags.setDisableTranslation(::DisableTranslation);
OutFlags.setDumpStats(::DumpStats);
OutFlags.setEnableBlockProfile(::EnableBlockProfile);
+ OutFlags.setExcludedRegisters(::ExcludedRegisters);
OutFlags.setForceMemIntrinOpt(::ForceMemIntrinOpt);
OutFlags.setFunctionSections(::FunctionSections);
OutFlags.setNumTranslationThreads(::NumThreads);
@@ -542,6 +559,7 @@ void ClFlags::getParsedClFlags(ClFlags &OutFlags) {
OutFlags.setTimingFocusOn(::TimingFocusOn);
OutFlags.setTranslateOnly(::TranslateOnly);
OutFlags.setUseNonsfi(::UseNonsfi);
+ OutFlags.setUseRestrictedRegisters(::UseRestrictedRegisters);
OutFlags.setUseSandboxing(::UseSandboxing);
OutFlags.setVerboseFocusOn(::VerboseFocusOn);
OutFlags.setOutFileType(::OutFileType);
« no previous file with comments | « src/IceClFlags.h ('k') | src/IceDefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698