@@ -101,6 +101,8 @@ class GCNSchedStrategy : public GenericScheduler {
101101 // GCN RP Tracker for botttom-up scheduling
102102 mutable GCNUpwardRPTracker UpwardTracker;
103103
104+ MachineCycleInfo CI;
105+
104106public:
105107 // schedule() have seen register pressure over the critical limits and had to
106108 // track register pressure for actual scheduling heuristics.
@@ -672,24 +674,18 @@ class RematCandidates {
672674
673675 std::set<RematCandidate> Cache;
674676
675- // errs() << "HoistToDominator\n";
676677 for (auto RematInfo : RematMap) {
677- // errs() << "\nRemat Inst: "; RematInfo.first->dump();
678678 std::set<unsigned > HighRPs;
679679 SmallVector<MachineBasicBlock *> MBBs;
680680 for (auto R : RematInfo.second ) {
681681 for (auto HRP : R.HighRPRegions ) {
682682 HighRPs.insert (HRP);
683683 }
684684 MBBs.push_back (R.InsertPt ->getParent ());
685- // errs() << "Has remat point in: " <<
686- // printMBBReference(*R.InsertPt->getParent()) << "\n";
687685 }
688686
689687 auto DomBlock = PDT->findNearestCommonDominator (iterator_range (MBBs));
690688 if (DomBlock && isReachableFrom (TargetBlock, DomBlock)) {
691- // errs() << "Found dom block: " << printMBBReference(*DomBlock) <<
692- // "\n";
693689 RematCandidate New (RematInfo.first , CI.getCycleDepth (DomBlock), HighRPs,
694690 DomBlock->begin ());
695691 Cache.insert (New);
@@ -700,37 +696,13 @@ class RematCandidates {
700696 }
701697 }
702698
703- // errs() << "Condensed: " << Entries.size() << " into: " << Cache.size() <<
704- // "\n";
705699 Entries.clear ();
706700 Entries = Cache;
707701 return true ;
708702 }
709703
710704 bool update (RematCandidate &RNew, const LiveIntervals *LIS) {
711- // errs() << "Update: "; RNew.Def->dump();
712- // //errs() << "Calling update for cand: ";
713- // RNew.Def->dump();
714- // //errs() << "With Regions: ";
715- // for (auto Regi : RNew.HighRPRegions) {
716- // //errs() << Regi;
717- // }
718- // //errs() << "\n";
719705 auto Match = find_if (Entries, [RNew](const RematCandidate &R) {
720- if (R.Def == RNew.Def ) {
721- // //errs() << "equal defs for cand match: \n";
722-
723- // R.Def->dump();
724- // //errs() << "With Regions: ";
725- // for (auto Regi : R.HighRPRegions) {
726- // //errs() << Regi;
727- // }
728- // //errs() << "\n";
729-
730- // //errs() << "RNew parent: " << RNew.InsertPt->getParent()->getName()
731- // /<< "\n"; /errs() << "R parent: " <<
732- // /R.InsertPt->getParent()->getName() << "\n";
733- }
734706 return R.Def == RNew.Def &&
735707 RNew.InsertPt ->getParent () == R.InsertPt ->getParent ();
736708 });
@@ -766,32 +738,21 @@ class RematCandidates {
766738
767739 void resolveSameBlockUses (const MachineRegisterInfo *MRI,
768740 const LiveIntervals *LIS) {
769- // errs() << "\nResolve Same Block uses";
770741 // We may have added remat candidates which are used by other remat
771742 // candidates -- be sure that we have correct insert points for this
772743 bool FixedPoint = false ;
773744 while (!FixedPoint) {
774- // errs() << "Fixed Point iter\n";
775- // //errs() << "Doling fixed point\n";
776745 FixedPoint = true ;
777746 for (auto &RematEntry : Entries) {
778747
779748 MachineInstr *RematInst = RematEntry.Def ;
780- // errs() << "R: "; RematInst->dump();
781- // errs() << "For Regions: ";
782- // errs() << "\n";
783749 MachineBasicBlock::iterator RematPt = RematEntry.InsertPt ;
784- // for (auto RematInst : RematEntry.second) {
785- // //errs() << "Have Remat Inst: "; RematInst.first->dump();
786- // //errs() << "With Insert Point: " <<
787- // DAG.LIS->getInstructionIndex(*RematInst.second) << "\n";
788750 for (auto MO : RematInst->operands ()) {
789751 if (!MO.isReg () || !MO.getReg () || !MO.readsReg ())
790752 continue ;
791753 auto UseReg = MO.getReg ();
792754 if (!UseReg.isVirtual ())
793755 continue ;
794- // //errs() << "Found UseReg: " << printReg(UseReg) << "\n";
795756 for (MachineInstr &DefInst : MRI->def_instructions (UseReg)) {
796757
797758 auto Match =
0 commit comments