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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 720343003: Subzero: Simplify the FakeKill instruction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Hoist KillsMask out of the loop Created 6 years, 1 month 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/IceTargetLoweringX8632.h ('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/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===//
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 implements the TargetLoweringX8632 class, which 10 // This file implements the TargetLoweringX8632 class, which
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 TypeToRegisterSet[IceType_v16i1] = VectorRegisters; 309 TypeToRegisterSet[IceType_v16i1] = VectorRegisters;
310 TypeToRegisterSet[IceType_v16i8] = VectorRegisters; 310 TypeToRegisterSet[IceType_v16i8] = VectorRegisters;
311 TypeToRegisterSet[IceType_v8i16] = VectorRegisters; 311 TypeToRegisterSet[IceType_v8i16] = VectorRegisters;
312 TypeToRegisterSet[IceType_v4i32] = VectorRegisters; 312 TypeToRegisterSet[IceType_v4i32] = VectorRegisters;
313 TypeToRegisterSet[IceType_v4f32] = VectorRegisters; 313 TypeToRegisterSet[IceType_v4f32] = VectorRegisters;
314 } 314 }
315 315
316 void TargetX8632::translateO2() { 316 void TargetX8632::translateO2() {
317 TimerMarker T(TimerStack::TT_O2, Func); 317 TimerMarker T(TimerStack::TT_O2, Func);
318 318
319 initFakeKilledScratchRegisters();
320
321 if (!Ctx->getFlags().PhiEdgeSplit) { 319 if (!Ctx->getFlags().PhiEdgeSplit) {
322 // Lower Phi instructions. 320 // Lower Phi instructions.
323 Func->placePhiLoads(); 321 Func->placePhiLoads();
324 if (Func->hasError()) 322 if (Func->hasError())
325 return; 323 return;
326 Func->placePhiStores(); 324 Func->placePhiStores();
327 if (Func->hasError()) 325 if (Func->hasError())
328 return; 326 return;
329 Func->deletePhis(); 327 Func->deletePhis();
330 if (Func->hasError()) 328 if (Func->hasError())
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 404
407 // Nop insertion 405 // Nop insertion
408 if (shouldDoNopInsertion()) { 406 if (shouldDoNopInsertion()) {
409 Func->doNopInsertion(); 407 Func->doNopInsertion();
410 } 408 }
411 } 409 }
412 410
413 void TargetX8632::translateOm1() { 411 void TargetX8632::translateOm1() {
414 TimerMarker T(TimerStack::TT_Om1, Func); 412 TimerMarker T(TimerStack::TT_Om1, Func);
415 413
416 initFakeKilledScratchRegisters();
417
418 Func->placePhiLoads(); 414 Func->placePhiLoads();
419 if (Func->hasError()) 415 if (Func->hasError())
420 return; 416 return;
421 Func->placePhiStores(); 417 Func->placePhiStores();
422 if (Func->hasError()) 418 if (Func->hasError())
423 return; 419 return;
424 Func->deletePhis(); 420 Func->deletePhis();
425 if (Func->hasError()) 421 if (Func->hasError())
426 return; 422 return;
427 Func->dump("After Phi lowering"); 423 Func->dump("After Phi lowering");
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 Context.insert(InstFakeDef::create(Func, ReturnRegHi)); 1883 Context.insert(InstFakeDef::create(Func, ReturnRegHi));
1888 1884
1889 // Add the appropriate offset to esp. The call instruction takes care 1885 // Add the appropriate offset to esp. The call instruction takes care
1890 // of resetting the stack offset during emission. 1886 // of resetting the stack offset during emission.
1891 if (ParameterAreaSizeBytes) { 1887 if (ParameterAreaSizeBytes) {
1892 Variable *esp = Func->getTarget()->getPhysicalRegister(RegX8632::Reg_esp); 1888 Variable *esp = Func->getTarget()->getPhysicalRegister(RegX8632::Reg_esp);
1893 _add(esp, Ctx->getConstantInt32(IceType_i32, ParameterAreaSizeBytes)); 1889 _add(esp, Ctx->getConstantInt32(IceType_i32, ParameterAreaSizeBytes));
1894 } 1890 }
1895 1891
1896 // Insert a register-kill pseudo instruction. 1892 // Insert a register-kill pseudo instruction.
1897 assert(!FakeKilledScratchRegisters.empty()); 1893 Context.insert(InstFakeKill::create(Func, NewCall));
1898 Context.insert(
1899 InstFakeKill::create(Func, FakeKilledScratchRegisters, NewCall));
1900 1894
1901 // Generate a FakeUse to keep the call live if necessary. 1895 // Generate a FakeUse to keep the call live if necessary.
1902 if (Instr->hasSideEffects() && ReturnReg) { 1896 if (Instr->hasSideEffects() && ReturnReg) {
1903 Inst *FakeUse = InstFakeUse::create(Func, ReturnReg); 1897 Inst *FakeUse = InstFakeUse::create(Func, ReturnReg);
1904 Context.insert(FakeUse); 1898 Context.insert(FakeUse);
1905 } 1899 }
1906 1900
1907 if (!Dest) 1901 if (!Dest)
1908 return; 1902 return;
1909 1903
(...skipping 2833 matching lines...) Expand 10 before | Expand all | Expand 10 after
4743 } else if (IsConstant || IsExternal) 4737 } else if (IsConstant || IsExternal)
4744 Str << "\t.zero\t" << Size << "\n"; 4738 Str << "\t.zero\t" << Size << "\n";
4745 // Size is part of .comm. 4739 // Size is part of .comm.
4746 4740
4747 if (IsConstant || HasNonzeroInitializer || IsExternal) 4741 if (IsConstant || HasNonzeroInitializer || IsExternal)
4748 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; 4742 Str << "\t.size\t" << MangledName << ", " << Size << "\n";
4749 // Size is part of .comm. 4743 // Size is part of .comm.
4750 } 4744 }
4751 4745
4752 } // end of namespace Ice 4746 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698