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

Side by Side Diff: src/IceCfg.cpp

Issue 1803403002: Subzero. Flags refactoring. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 9 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/IceBrowserCompileServer.cpp ('k') | src/IceClFlags.h » ('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/IceCfg.cpp - Control flow graph implementation ---------===// 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===//
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 /// \file 10 /// \file
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 [RNG](int N) { return RNG->next(N); }); 434 [RNG](int N) { return RNG->next(N); });
435 for (CfgNode *Next : Outs) { 435 for (CfgNode *Next : Outs) {
436 if (ToVisit[Next->getIndex()]) 436 if (ToVisit[Next->getIndex()])
437 getRandomPostOrder(Next, ToVisit, PostOrder, RNG); 437 getRandomPostOrder(Next, ToVisit, PostOrder, RNG);
438 } 438 }
439 PostOrder.push_back(Node); 439 PostOrder.push_back(Node);
440 } 440 }
441 } // end of anonymous namespace 441 } // end of anonymous namespace
442 442
443 void Cfg::shuffleNodes() { 443 void Cfg::shuffleNodes() {
444 if (!Ctx->getFlags().shouldReorderBasicBlocks()) 444 if (!Ctx->getFlags().getReorderBasicBlocks())
445 return; 445 return;
446 446
447 NodeList ReversedReachable; 447 NodeList ReversedReachable;
448 NodeList Unreachable; 448 NodeList Unreachable;
449 BitVector ToVisit(Nodes.size(), true); 449 BitVector ToVisit(Nodes.size(), true);
450 // Create Random number generator for function reordering 450 // Create Random number generator for function reordering
451 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), 451 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(),
452 RPE_BasicBlockReordering, SequenceNumber); 452 RPE_BasicBlockReordering, SequenceNumber);
453 // Traverse from entry node. 453 // Traverse from entry node.
454 getRandomPostOrder(getEntryNode(), ToVisit, ReversedReachable, &RNG); 454 getRandomPostOrder(getEntryNode(), ToVisit, ReversedReachable, &RNG);
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 } while (FoundNewAssignment); 757 } while (FoundNewAssignment);
758 } 758 }
759 759
760 void Cfg::doAddressOpt() { 760 void Cfg::doAddressOpt() {
761 TimerMarker T(TimerStack::TT_doAddressOpt, this); 761 TimerMarker T(TimerStack::TT_doAddressOpt, this);
762 for (CfgNode *Node : Nodes) 762 for (CfgNode *Node : Nodes)
763 Node->doAddressOpt(); 763 Node->doAddressOpt();
764 } 764 }
765 765
766 void Cfg::doNopInsertion() { 766 void Cfg::doNopInsertion() {
767 if (!Ctx->getFlags().shouldDoNopInsertion()) 767 if (!Ctx->getFlags().getShouldDoNopInsertion())
768 return; 768 return;
769 TimerMarker T(TimerStack::TT_doNopInsertion, this); 769 TimerMarker T(TimerStack::TT_doNopInsertion, this);
770 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), RPE_NopInsertion, 770 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), RPE_NopInsertion,
771 SequenceNumber); 771 SequenceNumber);
772 for (CfgNode *Node : Nodes) 772 for (CfgNode *Node : Nodes)
773 Node->doNopInsertion(RNG); 773 Node->doNopInsertion(RNG);
774 } 774 }
775 775
776 void Cfg::genCode() { 776 void Cfg::genCode() {
777 TimerMarker T(TimerStack::TT_genCode, this); 777 TimerMarker T(TimerStack::TT_genCode, this);
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 } 1135 }
1136 } 1136 }
1137 // Print each basic block 1137 // Print each basic block
1138 for (CfgNode *Node : Nodes) 1138 for (CfgNode *Node : Nodes)
1139 Node->dump(this); 1139 Node->dump(this);
1140 if (isVerbose(IceV_Instructions)) 1140 if (isVerbose(IceV_Instructions))
1141 Str << "}\n"; 1141 Str << "}\n";
1142 } 1142 }
1143 1143
1144 } // end of namespace Ice 1144 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceBrowserCompileServer.cpp ('k') | src/IceClFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698