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

Side by Side Diff: src/llvm2ice.cpp

Issue 580633002: Subzero: Add rudimentary statistics on generated code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove SpillsPlusFills and calculate as Spills+Fills Created 6 years, 3 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/IceTranslator.cpp ('k') | no next file » | 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/llvm2ice.cpp - Driver for testing ----------------------===// 1 //===- subzero/src/llvm2ice.cpp - Driver for testing ----------------------===//
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 defines a driver that uses LLVM capabilities to parse a 10 // This file defines a driver that uses LLVM capabilities to parse a
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 static cl::opt<bool> 96 static cl::opt<bool>
97 DisableGlobals("disable-globals", 97 DisableGlobals("disable-globals",
98 cl::desc("Disable global initializer translation")); 98 cl::desc("Disable global initializer translation"));
99 99
100 // This is currently unused, and is a placeholder for lit tests. 100 // This is currently unused, and is a placeholder for lit tests.
101 static cl::opt<bool> 101 static cl::opt<bool>
102 DisablePhiEdgeSplit("no-phi-edge-split", 102 DisablePhiEdgeSplit("no-phi-edge-split",
103 cl::desc("Disable edge splitting for Phi lowering")); 103 cl::desc("Disable edge splitting for Phi lowering"));
104 104
105 static cl::opt<bool>
106 DumpStats("stats",
107 cl::desc("Print statistics after translating each function"));
108
105 static cl::opt<NaClFileFormat> InputFileFormat( 109 static cl::opt<NaClFileFormat> InputFileFormat(
106 "bitcode-format", cl::desc("Define format of input file:"), 110 "bitcode-format", cl::desc("Define format of input file:"),
107 cl::values(clEnumValN(LLVMFormat, "llvm", "LLVM file (default)"), 111 cl::values(clEnumValN(LLVMFormat, "llvm", "LLVM file (default)"),
108 clEnumValN(PNaClFormat, "pnacl", "PNaCl bitcode file"), 112 clEnumValN(PNaClFormat, "pnacl", "PNaCl bitcode file"),
109 clEnumValEnd), 113 clEnumValEnd),
110 cl::init(LLVMFormat)); 114 cl::init(LLVMFormat));
111 115
112 static cl::opt<std::string> 116 static cl::opt<std::string>
113 DefaultGlobalPrefix("default-global-prefix", 117 DefaultGlobalPrefix("default-global-prefix",
114 cl::desc("Define default global prefix for naming " 118 cl::desc("Define default global prefix for naming "
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 raw_os_ostream *Ls = new raw_os_ostream(LogFilename == "-" ? std::cout : Lfs); 152 raw_os_ostream *Ls = new raw_os_ostream(LogFilename == "-" ? std::cout : Lfs);
149 Ls->SetUnbuffered(); 153 Ls->SetUnbuffered();
150 154
151 Ice::ClFlags Flags; 155 Ice::ClFlags Flags;
152 Flags.DisableInternal = DisableInternal; 156 Flags.DisableInternal = DisableInternal;
153 Flags.SubzeroTimingEnabled = SubzeroTimingEnabled; 157 Flags.SubzeroTimingEnabled = SubzeroTimingEnabled;
154 Flags.DisableTranslation = DisableTranslation; 158 Flags.DisableTranslation = DisableTranslation;
155 Flags.DisableGlobals = DisableGlobals; 159 Flags.DisableGlobals = DisableGlobals;
156 Flags.FunctionSections = FunctionSections; 160 Flags.FunctionSections = FunctionSections;
157 Flags.UseSandboxing = UseSandboxing; 161 Flags.UseSandboxing = UseSandboxing;
162 Flags.DumpStats = DumpStats;
158 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; 163 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix;
159 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; 164 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix;
160 165
161 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix, 166 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix,
162 Flags); 167 Flags);
163 168
164 if (BuildOnRead) { 169 if (BuildOnRead) {
165 Ice::PNaClTranslator Translator(&Ctx, Flags); 170 Ice::PNaClTranslator Translator(&Ctx, Flags);
166 Translator.translate(IRFilename); 171 Translator.translate(IRFilename);
167 return Translator.getErrorStatus(); 172 return Translator.getErrorStatus();
(...skipping 12 matching lines...) Expand all
180 if (!Mod) { 185 if (!Mod) {
181 Err.print(argv[0], errs()); 186 Err.print(argv[0], errs());
182 return 1; 187 return 1;
183 } 188 }
184 189
185 Ice::Converter Converter(Mod, &Ctx, Flags); 190 Ice::Converter Converter(Mod, &Ctx, Flags);
186 Converter.convertToIce(); 191 Converter.convertToIce();
187 return Converter.getErrorStatus(); 192 return Converter.getErrorStatus();
188 } 193 }
189 } 194 }
OLDNEW
« no previous file with comments | « src/IceTranslator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698