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

Side by Side Diff: src/llvm2ice.cpp

Issue 580903005: Subzero: Add branch optimization. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes 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/PNaClTranslator.cpp ('k') | tests_lit/llvm2ice_tests/branch-opt.ll » ('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/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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 Flags.DisableGlobals = DisableGlobals; 159 Flags.DisableGlobals = DisableGlobals;
160 Flags.FunctionSections = FunctionSections; 160 Flags.FunctionSections = FunctionSections;
161 Flags.UseSandboxing = UseSandboxing; 161 Flags.UseSandboxing = UseSandboxing;
162 Flags.DumpStats = DumpStats; 162 Flags.DumpStats = DumpStats;
163 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; 163 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix;
164 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; 164 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix;
165 165
166 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix, 166 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix,
167 Flags); 167 Flags);
168 168
169 int ErrorStatus = 0;
169 if (BuildOnRead) { 170 if (BuildOnRead) {
170 Ice::PNaClTranslator Translator(&Ctx, Flags); 171 Ice::PNaClTranslator Translator(&Ctx, Flags);
171 Translator.translate(IRFilename); 172 Translator.translate(IRFilename);
172 return Translator.getErrorStatus(); 173 ErrorStatus = Translator.getErrorStatus();
173 } else { 174 } else {
174 // Parse the input LLVM IR file into a module. 175 // Parse the input LLVM IR file into a module.
175 SMDiagnostic Err; 176 SMDiagnostic Err;
176 Ice::Timer T; 177 Ice::Timer T;
177 Module *Mod = 178 Module *Mod =
178 NaClParseIRFile(IRFilename, InputFileFormat, Err, getGlobalContext()); 179 NaClParseIRFile(IRFilename, InputFileFormat, Err, getGlobalContext());
179 180
180 if (SubzeroTimingEnabled) { 181 if (SubzeroTimingEnabled) {
181 std::cerr << "[Subzero timing] IR Parsing: " << T.getElapsedSec() 182 std::cerr << "[Subzero timing] IR Parsing: " << T.getElapsedSec()
182 << " sec\n"; 183 << " sec\n";
183 } 184 }
184 185
185 if (!Mod) { 186 if (!Mod) {
186 Err.print(argv[0], errs()); 187 Err.print(argv[0], errs());
187 return 1; 188 return 1;
188 } 189 }
189 190
190 Ice::Converter Converter(Mod, &Ctx, Flags); 191 Ice::Converter Converter(Mod, &Ctx, Flags);
191 Converter.convertToIce(); 192 Converter.convertToIce();
192 return Converter.getErrorStatus(); 193 ErrorStatus = Converter.getErrorStatus();
193 } 194 }
195 const bool FinalStats = true;
196 Ctx.dumpStats("_FINAL_", FinalStats);
197 return ErrorStatus;
194 } 198 }
OLDNEW
« no previous file with comments | « src/PNaClTranslator.cpp ('k') | tests_lit/llvm2ice_tests/branch-opt.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698