1. May 21, 2013
    • Hal Finkel's avatar
      Rename PPC MTCTRse to MTCTRloop · 0859ef29
      Hal Finkel authored
      As the pairing of this instruction form with the bdnz/bdz branches is now
      enforced by the verification pass, make it clear from the name that these
      are used only for counter-based loops.
      
      No functionality change intended.
      
      llvm-svn: 182296
      0859ef29
    • Hal Finkel's avatar
      Add a PPCCTRLoops verification pass · 8ca38841
      Hal Finkel authored
      When asserts are enabled, this adds a verification pass for PPC counter-loop
      formation. Unfortunately, without sacrificing code quality, there is no better
      way of forming counter-based loops except at the (late) IR level. This means
      that we need to recognize, at the IR level, anything which might turn into a
      function call (or indirect branch). Because this is currently a finite set of
      things, and because SelectionDAG lowering is basic-block local, this can be
      done. Nevertheless, it is fragile, and failure results in a miscompile. This
      verification pass checks that all (reachable) counter-based branches are
      dominated by a loop mtctr instruction, and that no instructions in between
      clobber the counter register. If these conditions are not satisfied, then an
      ICE will be triggered.
      
      In short, this is to help us sleep better at night.
      
      llvm-svn: 182295
      8ca38841
  2. May 20, 2013