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

Side by Side Diff: src/IceCfgNode.cpp

Issue 686913005: Turn off dump/emit routines when building minimal subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits and format. 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
OLDNEW
1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// 1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) 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 // This file implements the CfgNode class, including the complexities 10 // This file implements the CfgNode class, including the complexities
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 } 804 }
805 805
806 // ======================== Dump routines ======================== // 806 // ======================== Dump routines ======================== //
807 807
808 namespace { 808 namespace {
809 809
810 // Helper functions for emit(). 810 // Helper functions for emit().
811 811
812 void emitRegisterUsage(Ostream &Str, const Cfg *Func, const CfgNode *Node, 812 void emitRegisterUsage(Ostream &Str, const Cfg *Func, const CfgNode *Node,
813 bool IsLiveIn, std::vector<SizeT> &LiveRegCount) { 813 bool IsLiveIn, std::vector<SizeT> &LiveRegCount) {
814 if (!ALLOW_DUMP)
815 return;
814 Liveness *Liveness = Func->getLiveness(); 816 Liveness *Liveness = Func->getLiveness();
815 const LivenessBV *Live; 817 const LivenessBV *Live;
816 if (IsLiveIn) { 818 if (IsLiveIn) {
817 Live = &Liveness->getLiveIn(Node); 819 Live = &Liveness->getLiveIn(Node);
818 Str << "\t\t\t\t# LiveIn="; 820 Str << "\t\t\t\t# LiveIn=";
819 } else { 821 } else {
820 Live = &Liveness->getLiveOut(Node); 822 Live = &Liveness->getLiveOut(Node);
821 Str << "\t\t\t\t# LiveOut="; 823 Str << "\t\t\t\t# LiveOut=";
822 } 824 }
823 if (!Live->empty()) { 825 if (!Live->empty()) {
(...skipping 10 matching lines...) Expand all
834 Var->emit(Func); 836 Var->emit(Func);
835 } 837 }
836 } 838 }
837 } 839 }
838 } 840 }
839 Str << "\n"; 841 Str << "\n";
840 } 842 }
841 843
842 void emitLiveRangesEnded(Ostream &Str, const Cfg *Func, const Inst *Instr, 844 void emitLiveRangesEnded(Ostream &Str, const Cfg *Func, const Inst *Instr,
843 std::vector<SizeT> &LiveRegCount) { 845 std::vector<SizeT> &LiveRegCount) {
846 if (!ALLOW_DUMP)
847 return;
844 bool First = true; 848 bool First = true;
845 Variable *Dest = Instr->getDest(); 849 Variable *Dest = Instr->getDest();
846 if (Dest && Dest->hasReg()) 850 if (Dest && Dest->hasReg())
847 ++LiveRegCount[Dest->getRegNum()]; 851 ++LiveRegCount[Dest->getRegNum()];
848 for (SizeT I = 0; I < Instr->getSrcSize(); ++I) { 852 for (SizeT I = 0; I < Instr->getSrcSize(); ++I) {
849 Operand *Src = Instr->getSrc(I); 853 Operand *Src = Instr->getSrc(I);
850 SizeT NumVars = Src->getNumVars(); 854 SizeT NumVars = Src->getNumVars();
851 for (SizeT J = 0; J < NumVars; ++J) { 855 for (SizeT J = 0; J < NumVars; ++J) {
852 const Variable *Var = Src->getVar(J); 856 const Variable *Var = Src->getVar(J);
853 if (Var->hasReg()) { 857 if (Var->hasReg()) {
(...skipping 25 matching lines...) Expand all
879 if (!Src->hasReg()) 883 if (!Src->hasReg())
880 Func->getContext()->statsUpdateSpills(); 884 Func->getContext()->statsUpdateSpills();
881 } 885 }
882 } 886 }
883 } 887 }
884 } 888 }
885 889
886 } // end of anonymous namespace 890 } // end of anonymous namespace
887 891
888 void CfgNode::emit(Cfg *Func) const { 892 void CfgNode::emit(Cfg *Func) const {
893 if (!ALLOW_DUMP)
894 return;
889 Func->setCurrentNode(this); 895 Func->setCurrentNode(this);
890 Ostream &Str = Func->getContext()->getStrEmit(); 896 Ostream &Str = Func->getContext()->getStrEmit();
891 Liveness *Liveness = Func->getLiveness(); 897 Liveness *Liveness = Func->getLiveness();
892 bool DecorateAsm = Liveness && Func->getContext()->getFlags().DecorateAsm; 898 bool DecorateAsm = Liveness && Func->getContext()->getFlags().DecorateAsm;
893 Str << getAsmName() << ":\n"; 899 Str << getAsmName() << ":\n";
894 std::vector<SizeT> LiveRegCount(Func->getTarget()->getNumRegisters()); 900 std::vector<SizeT> LiveRegCount(Func->getTarget()->getNumRegisters());
895 if (DecorateAsm) 901 if (DecorateAsm)
896 emitRegisterUsage(Str, Func, this, true, LiveRegCount); 902 emitRegisterUsage(Str, Func, this, true, LiveRegCount);
897 903
898 for (InstPhi *Phi : Phis) { 904 for (InstPhi *Phi : Phis) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 if (I->isDeleted()) 942 if (I->isDeleted())
937 continue; 943 continue;
938 if (I->isRedundantAssign()) 944 if (I->isRedundantAssign())
939 continue; 945 continue;
940 I->emitIAS(Func); 946 I->emitIAS(Func);
941 updateStats(Func, I); 947 updateStats(Func, I);
942 } 948 }
943 } 949 }
944 950
945 void CfgNode::dump(Cfg *Func) const { 951 void CfgNode::dump(Cfg *Func) const {
952 if (!ALLOW_DUMP)
953 return;
946 Func->setCurrentNode(this); 954 Func->setCurrentNode(this);
947 Ostream &Str = Func->getContext()->getStrDump(); 955 Ostream &Str = Func->getContext()->getStrDump();
948 Liveness *Liveness = Func->getLiveness(); 956 Liveness *Liveness = Func->getLiveness();
949 if (Func->getContext()->isVerbose(IceV_Instructions)) { 957 if (Func->getContext()->isVerbose(IceV_Instructions)) {
950 Str << getName() << ":\n"; 958 Str << getName() << ":\n";
951 } 959 }
952 // Dump list of predecessor nodes. 960 // Dump list of predecessor nodes.
953 if (Func->getContext()->isVerbose(IceV_Preds) && !InEdges.empty()) { 961 if (Func->getContext()->isVerbose(IceV_Preds) && !InEdges.empty()) {
954 Str << " // preds = "; 962 Str << " // preds = ";
955 bool First = true; 963 bool First = true;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 if (!First) 1020 if (!First)
1013 Str << ", "; 1021 Str << ", ";
1014 First = false; 1022 First = false;
1015 Str << "%" << I->getName(); 1023 Str << "%" << I->getName();
1016 } 1024 }
1017 Str << "\n"; 1025 Str << "\n";
1018 } 1026 }
1019 } 1027 }
1020 1028
1021 } // end of namespace Ice 1029 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceGlobalContext.h » ('j') | src/IceTypes.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698