[llvm] r189989 - mi-sched: Reuse an invalid HazardRecognizer to save compile time.
Benjamin Kramer
benny.kra at gmail.com
Wed Sep 4 14:13:02 PDT 2013
On 04.09.2013, at 23:00, Andrew Trick <atrick at apple.com> wrote:
> Author: atrick
> Date: Wed Sep 4 16:00:05 2013
> New Revision: 189989
>
> URL: http://llvm.org/viewvc/llvm-project?rev=189989&view=rev
> Log:
> mi-sched: Reuse an invalid HazardRecognizer to save compile time.
>
> Modified:
> llvm/trunk/lib/CodeGen/MachineScheduler.cpp
>
> Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=189989&r1=189988&r2=189989&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Wed Sep 4 16:00:05 2013
> @@ -1469,13 +1469,16 @@ public:
>
> void reset() {
> // A new HazardRec is created for each DAG and owned by SchedBoundary.
> - delete HazardRec;
> -
> + // Detroying and reconstructing it is very expensive though. So keep
Typo: Detroying.
- Ben
> + // invalid, placeholder HazardRecs.
> + if (HazardRec && HazardRec->isEnabled()) {
> + delete HazardRec;
> + HazardRec = 0;
> + }
> Available.clear();
> Pending.clear();
> CheckPending = false;
> NextSUs.clear();
> - HazardRec = 0;
> CurrCycle = 0;
> CurrMOps = 0;
> MinReadyCycle = UINT_MAX;
> @@ -1681,9 +1684,14 @@ void ConvergingScheduler::initialize(Sch
> // are disabled, then these HazardRecs will be disabled.
> const InstrItineraryData *Itin = SchedModel->getInstrItineraries();
> const TargetMachine &TM = DAG->MF.getTarget();
> - Top.HazardRec = TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
> - Bot.HazardRec = TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
> -
> + if (!Top.HazardRec) {
> + Top.HazardRec =
> + TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
> + }
> + if (!Bot.HazardRec) {
> + Bot.HazardRec =
> + TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
> + }
> assert((!ForceTopDown || !ForceBottomUp) &&
> "-misched-topdown incompatible with -misched-bottomup");
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list