Skip to content
  1. Dec 15, 2011
    • Devang Patel's avatar
      Do not sink instruction, if it is not profitable. · c2686886
      Devang Patel authored
      On ARM, peephole optimization for ABS creates a trivial cfg triangle which tempts machine sink to sink instructions in code which is really straight line code. Sometimes this sinking may alter register allocator input such that use and def of a reg is divided by a branch in between, which may result in extra spills. Now mahine sink avoids sinking if final sink destination is post dominator.
      
      Radar 10266272.
      
      llvm-svn: 146604
      c2686886
  2. Dec 09, 2011
  3. Dec 08, 2011
  4. 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
  5. Sep 07, 2011
  6. Apr 11, 2011
  7. Oct 19, 2010
    • Owen Anderson's avatar
      Get rid of static constructors for pass registration. Instead, every pass... · 6c18d1aa
      Owen Anderson authored
      Get rid of static constructors for pass registration.  Instead, every pass exposes an initializeMyPassFunction(), which
      must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
      the pass's dependencies.
      
      Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
      CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
      before parsing commandline arguments.
      
      I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
      with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
      registration/creation, please send the testcase to me directly.
      
      llvm-svn: 116820
      6c18d1aa
  8. Oct 12, 2010
  9. Oct 08, 2010
  10. Sep 23, 2010
  11. Sep 21, 2010
    • Evan Cheng's avatar
      Enable machine sinking critical edge splitting. e.g. · f3e9a485
      Evan Cheng authored
      define double @foo(double %x, double %y, i1 %c) nounwind {
        %a = fdiv double %x, 3.2
        %z = select i1 %c, double %a, double %y
        ret double %z
      }
      
      Was:
      _foo:
              divsd   LCPI0_0(%rip), %xmm0
              testb   $1, %dil
              jne     LBB0_2
              movaps  %xmm1, %xmm0
      LBB0_2:
              ret
      
      Now:
      _foo:
              testb   $1, %dil
              je      LBB0_2
              divsd   LCPI0_0(%rip), %xmm0
              ret
      LBB0_2:
              movaps  %xmm1, %xmm0
              ret
      
      This avoids the divsd when early exit is taken.
      rdar://8454886
      
      llvm-svn: 114372
      f3e9a485
  12. Sep 20, 2010
  13. Sep 18, 2010
  14. Aug 20, 2010
  15. Aug 19, 2010
  16. Aug 06, 2010
  17. Jul 22, 2010
  18. Jun 25, 2010
  19. Jun 23, 2010
  20. Jun 16, 2010
  21. Jun 04, 2010
  22. Jun 03, 2010
    • Bill Wendling's avatar
      Machine sink could potentially sink instructions into a block where the physical · f82aea63
      Bill Wendling authored
      registers it defines then interfere with an existing preg live range.
      
      For instance, if we had something like these machine instructions:
      
      BB#0
        ... = imul ... EFLAGS<imp-def,dead>
        test ..., EFLAGS<imp-def>
        jcc BB#2 EFLAGS<imp-use>
      
      BB#1
        ... ; fallthrough to BB#2
      
      BB#2
        ... ; No code that defines EFLAGS
        jcc ... EFLAGS<imp-use>
      
      Machine sink will come along, see that imul implicitly defines EFLAGS, but
      because it's "dead", it assumes that it can move imul into BB#2. But when it
      does, imul's "dead" imp-def of EFLAGS is raised from the dead (a zombie) and
      messes up the condition code for the jump (and pretty much anything else which
      relies upon it being correct).
      
      The solution is to know which pregs are live going into a basic block. However,
      that information isn't calculated at this point. Nor does the LiveVariables pass
      take into account non-allocatable physical registers. In lieu of this, we do a
      *very* conservative pass through the basic block to determine if a preg is live
      coming out of it.
      
      llvm-svn: 105387
      f82aea63
    • Bill Wendling's avatar
      Compulsive reformating. No functionalitical changes. · 7ee730eb
      Bill Wendling authored
      llvm-svn: 105359
      7ee730eb
  23. May 13, 2010
  24. Apr 16, 2010
    • Jakob Stoklund Olesen's avatar
      Avoid sinking machine instructions into a loop. · cdc3df48
      Jakob Stoklund Olesen authored
      MachineLoopInfo is already available when MachineSinking runs, so the check is
      free.
      
      There is no test case because it would require a critical edge into a loop, and
      CodeGenPrepare splits those. This check is just to be extra careful.
      
      llvm-svn: 101420
      cdc3df48
  25. Apr 13, 2010
    • Jakob Stoklund Olesen's avatar
      Teach MachineSinking to handle easy critical edges. · 20b71e28
      Jakob Stoklund Olesen authored
      Sometimes it is desirable to sink instructions along a critical edge:
      
      x = ...
      if (a && b) ...
      else use(x);
      
      The 'a && b' condition creates a critical edge to the else block, but we still
      want to sink the computation of x into the block. The else block is dominated by
      the parent block, so we are not pushing instructions into new code paths.
      
      llvm-svn: 101165
      20b71e28
  26. Apr 05, 2010
  27. Mar 05, 2010
  28. Mar 02, 2010
  29. Feb 09, 2010
Loading