Skip to content
  1. Mar 07, 2012
    • Andrew Trick's avatar
      misched preparation: clarify ScheduleDAG and ScheduleDAGInstrs roles. · 60cf03e7
      Andrew Trick authored
      ScheduleDAG is responsible for the DAG: SUnits and SDeps. It provides target hooks for latency computation.
      
      ScheduleDAGInstrs extends ScheduleDAG and defines the current scheduling region in terms of MachineInstr iterators. It has access to the target's scheduling itinerary data. ScheduleDAGInstrs provides the logic for building the ScheduleDAG for the sequence of MachineInstrs in the current region. Target's can implement highly custom schedulers by extending this class.
      
      ScheduleDAGPostRATDList provides the driver and diagnostics for current postRA scheduling. It maintains a current Sequence of scheduled machine instructions and logic for splicing them into the block. During scheduling, it uses the ScheduleHazardRecognizer provided by the target.
      
      Specific changes:
      - Removed driver code from ScheduleDAG. clearDAG is the only interface needed.
      
      - Added enterRegion/exitRegion hooks to ScheduleDAGInstrs to delimit the scope of each scheduling region and associated DAG. They should be used to setup and cleanup any region-specific state in addition to the DAG itself. This is necessary because we reuse the same ScheduleDAG object for the entire function. The target may extend these hooks to do things at regions boundaries, like bundle terminators. The hooks are called even if we decide not to schedule the region. So all instructions in a block are "covered" by these calls.
      
      - Added ScheduleDAGInstrs::begin()/end() public API.
      
      - Moved Sequence into the driver layer, which is specific to the scheduling algorithm.
      
      llvm-svn: 152208
      60cf03e7
    • Andrew Trick's avatar
      misched preparation: modularize schedule emission. · e932bb77
      Andrew Trick authored
      ScheduleDAG has nothing to do with how the instructions are scheduled.
      
      llvm-svn: 152206
      e932bb77
    • Andrew Trick's avatar
      misched preparation: modularize schedule printing. · edee68ce
      Andrew Trick authored
      ScheduleDAG will not refer to the scheduled instruction sequence.
      
      llvm-svn: 152205
      edee68ce
    • Andrew Trick's avatar
      misched preparation: modularize schedule verification. · 46a58664
      Andrew Trick authored
      ScheduleDAG will not refer to the scheduled instruction sequence.
      
      llvm-svn: 152204
      46a58664
  2. Mar 05, 2012
  3. Feb 23, 2012
    • Benjamin Kramer's avatar
      BitVectorize loop. · ef8bf395
      Benjamin Kramer authored
      llvm-svn: 151274
      ef8bf395
    • Benjamin Kramer's avatar
      post-ra-sched: Turn the KillIndices vector into a bitvector, it only stored two meaningful states. · 796fd469
      Benjamin Kramer authored
      Rename it to LiveRegs to make it more clear what's stored inside.
      
      llvm-svn: 151273
      796fd469
    • Benjamin Kramer's avatar
      post-ra-sched: Replace a std::set of regs with a bitvector. · 21974b1f
      Benjamin Kramer authored
      Assuming that a single std::set node adds 3 control words, a bitvector
      can store (3*8+4)*8=224 registers in the allocated memory of a single
      element in the std::set (x86_64). Also we don't have to call malloc
      for every register added.
      
      llvm-svn: 151269
      21974b1f
    • Jakob Stoklund Olesen's avatar
      Make calls scheduling boundaries post-ra. · a793a59f
      Jakob Stoklund Olesen authored
      Before register allocation, instructions can be moved across calls in
      order to reduce register pressure.  After register allocation, we don't
      gain a lot by moving callee-saved defs across calls.  In fact, since the
      scheduler doesn't have a good idea how registers are used in the callee,
      it can't really make good scheduling decisions.
      
      This changes the schedule in two ways: 1. Latencies to call uses and
      defs are no longer accounted for, causing some random shuffling around
      calls.  This isn't really a problem since those uses and defs are
      inaccurate proxies for what happens inside the callee.  They don't
      represent registers used by the call instruction itself.
      
      2. Instructions are no longer moved across calls.  This didn't happen
      very often, and the scheduling decision was made on dubious information
      anyway.
      
      As with any scheduling change, benchmark numbers shift around a bit,
      but there is no positive or negative trend from this change.
      
      This makes the post-ra scheduler 5% faster for ARM targets.
      
      The secret motivation for this patch is the introduction of register
      mask operands representing call clobbers.  The most efficient way of
      handling regmasks in ScheduleDAGInstrs is to model them as barriers for
      physreg live ranges, but not for virtreg live ranges.  That's fine
      pre-ra, but post-ra it would have the same effect as this patch.
      
      llvm-svn: 151265
      a793a59f
    • Jakob Stoklund Olesen's avatar
      Handle regmasks in FixupKills. · 28d4803a
      Jakob Stoklund Olesen authored
      llvm-svn: 151226
      28d4803a
  4. Feb 22, 2012
  5. Feb 08, 2012
  6. Jan 14, 2012
  7. Dec 14, 2011
    • Evan Cheng's avatar
      - Add MachineInstrBundle.h and MachineInstrBundle.cpp. This includes a function · 7fae11b2
      Evan Cheng authored
        to finalize MI bundles (i.e. add BUNDLE instruction and computing register def
        and use lists of the BUNDLE instruction) and a pass to unpack bundles.
      - Teach more of MachineBasic and MachineInstr methods to be bundle aware.
      - Switch Thumb2 IT block to MI bundles and delete the hazard recognizer hack to
        prevent IT blocks from being broken apart.
      
      llvm-svn: 146542
      7fae11b2
  8. Dec 07, 2011
    • Evan Cheng's avatar
      Add bundle aware API for querying instruction properties and switch the code · 7f8e563a
      Evan Cheng authored
      generator to it. For non-bundle instructions, these behave exactly the same
      as the MC layer API.
      
      For properties like mayLoad / mayStore, look into the bundle and if any of the
      bundled instructions has the property it would return true.
      For properties like isPredicable, only return true if *all* of the bundled
      instructions have the property.
      For properties like canFoldAsLoad, isCompare, conservatively return false for
      bundles.
      
      llvm-svn: 146026
      7f8e563a
  9. Nov 15, 2011
  10. Jul 01, 2011
  11. Jun 16, 2011
  12. Jun 02, 2011
  13. Jun 01, 2011
    • Andrew Trick's avatar
      Add an issue width check to the postRA scheduler. Patch by Max Kazakov! · 18c9b37a
      Andrew Trick authored
      For targets with no itinerary (x86) it is a nop by default. For
      targets with issue width already expressed in the itinerary (ARM) it
      bypasses a scoreboard check but otherwise does not affect the
      schedule. It does make the code more consistent and complete and
      allows new targets to specify their issue width in an arbitrary way.
      
      llvm-svn: 132385
      18c9b37a
  14. May 06, 2011
  15. Dec 24, 2010
    • Andrew Trick's avatar
      Various bits of framework needed for precise machine-level selection · 10ffc2b6
      Andrew Trick authored
      DAG scheduling during isel. Most new functionality is currently
      guarded by -enable-sched-cycles and -enable-sched-hazard.
      
      Added InstrItineraryData::IssueWidth field, currently derived from
      ARM itineraries, but could be initialized differently on other targets.
      
      Added ScheduleHazardRecognizer::MaxLookAhead to indicate whether it is
      active, and if so how many cycles of state it holds.
      
      Added SchedulingPriorityQueue::HasReadyFilter to allowing gating entry
      into the scheduler's available queue.
      
      ScoreboardHazardRecognizer now accesses the ScheduleDAG in order to
      get information about it's SUnits, provides RecedeCycle for bottom-up
      scheduling, correctly computes scoreboard depth, tracks IssueCount, and
      considers potential stall cycles when checking for hazards.
      
      ScheduleDAGRRList now models machine cycles and hazards (under
      flags). It tracks MinAvailableCycle, drives the hazard recognizer and
      priority queue's ready filter, manages a new PendingQueue, properly
      accounts for stall cycles, etc.
      
      llvm-svn: 122541
      10ffc2b6
  16. Sep 10, 2010
    • Evan Cheng's avatar
      Teach if-converter to be more careful with predicating instructions that would · bf407075
      Evan Cheng authored
      take multiple cycles to decode.
      For the current if-converter clients (actually only ARM), the instructions that
      are predicated on false are not nops. They would still take machine cycles to
      decode. Micro-coded instructions such as LDM / STM can potentially take multiple
      cycles to decode. If-converter should take treat them as non-micro-coded
      simple instructions.
      
      llvm-svn: 113570
      bf407075
  17. Aug 06, 2010
  18. Jul 15, 2010
  19. Jun 19, 2010
    • Evan Cheng's avatar
      Allow ARM if-converter to be run after post allocation scheduling. · 2d51c7c5
      Evan Cheng authored
      - This fixed a number of bugs in if-converter, tail merging, and post-allocation
        scheduler. If-converter now runs branch folding / tail merging first to
        maximize if-conversion opportunities.
      - Also changed the t2IT instruction slightly. It now defines the ITSTATE
        register which is read by instructions in the IT block.
      - Added Thumb2 specific hazard recognizer to ensure the scheduler doesn't
        change the instruction ordering in the IT block (since IT mask has been
        finalized). It also ensures no other instructions can be scheduled between
        instructions in the IT block.
      
      This is not yet enabled.
      
      llvm-svn: 106344
      2d51c7c5
  20. Jun 14, 2010
  21. Jun 12, 2010
  22. May 21, 2010
    • Evan Cheng's avatar
      - Change MachineInstr::findRegisterDefOperandIdx so it can also look for defs · 3858451e
      Evan Cheng authored
      that are aliases of the specified register.
      - Rename modifiesRegister to definesRegister since it's looking a def of the
      specific register or one of its super-registers. It's not looking for def of a
      sub-register or alias that could change the specified register.
      - Added modifiesRegister to look for defs of aliases.
      
      llvm-svn: 104377
      3858451e
  23. May 20, 2010
  24. May 14, 2010
  25. May 01, 2010
  26. Apr 17, 2010
  27. Apr 12, 2010
Loading