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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 1072913002: Subzero: Use a "deterministic" random shuffle for register allocation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 8 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/IceRNG.h ('k') | tests_lit/llvm2ice_tests/randomize-regalloc.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/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 4603 matching lines...) Expand 10 before | Expand all | Expand 10 after
4614 } 4614 }
4615 REGX8632_TABLE 4615 REGX8632_TABLE
4616 #undef X 4616 #undef X
4617 4617
4618 RandomNumberGeneratorWrapper RNG(Ctx->getRNG()); 4618 RandomNumberGeneratorWrapper RNG(Ctx->getRNG());
4619 4619
4620 // Shuffle the resulting equivalence classes. 4620 // Shuffle the resulting equivalence classes.
4621 for (auto I : EquivalenceClasses) { 4621 for (auto I : EquivalenceClasses) {
4622 const RegisterList &List = I.second; 4622 const RegisterList &List = I.second;
4623 RegisterList Shuffled(List); 4623 RegisterList Shuffled(List);
4624 std::random_shuffle(Shuffled.begin(), Shuffled.end(), RNG); 4624 RandomShuffle(Shuffled.begin(), Shuffled.end(), RNG);
4625 for (size_t SI = 0, SE = Shuffled.size(); SI < SE; ++SI) { 4625 for (size_t SI = 0, SE = Shuffled.size(); SI < SE; ++SI) {
4626 Permutation[List[SI]] = Shuffled[SI]; 4626 Permutation[List[SI]] = Shuffled[SI];
4627 ++NumShuffled; 4627 ++NumShuffled;
4628 } 4628 }
4629 } 4629 }
4630 4630
4631 assert(NumShuffled + NumPreserved == RegX8632::Reg_NUM); 4631 assert(NumShuffled + NumPreserved == RegX8632::Reg_NUM);
4632 4632
4633 if (Func->isVerbose(IceV_Random)) { 4633 if (Func->isVerbose(IceV_Random)) {
4634 OstreamLocker L(Func->getContext()); 4634 OstreamLocker L(Func->getContext());
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
4873 case FT_Asm: 4873 case FT_Asm:
4874 case FT_Iasm: { 4874 case FT_Iasm: {
4875 OstreamLocker L(Ctx); 4875 OstreamLocker L(Ctx);
4876 emitConstantPool<PoolTypeConverter<float>>(Ctx); 4876 emitConstantPool<PoolTypeConverter<float>>(Ctx);
4877 emitConstantPool<PoolTypeConverter<double>>(Ctx); 4877 emitConstantPool<PoolTypeConverter<double>>(Ctx);
4878 } break; 4878 } break;
4879 } 4879 }
4880 } 4880 }
4881 4881
4882 } // end of namespace Ice 4882 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceRNG.h ('k') | tests_lit/llvm2ice_tests/randomize-regalloc.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698