Skip to content
  1. Jun 19, 2004
    • Chris Lattner's avatar
      Do not let the numbering of PHI nodes placed in the function depend on · a52ab6f5
      Chris Lattner authored
      non-deterministic things like the ordering of blocks in the dominance
      frontier of a BB.  Unfortunately, I don't know of a better way to solve
      this problem than to explicitly sort the BB's in function-order before
      processing them.  This is guaranteed to slow the pass down a bit, but
      is absolutely necessary to get usable diffs between two different tools
      executing the mem2reg or scalarrepl pass.
      
      Before this, bazillions of spurious diff failures occurred all over the
      place due to the different order of processing PHIs:
      
      -       %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.0, uint 0, uint 0
      +       %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.1, uint 0, uint 0
      
      Now, the diffs match.
      
      llvm-svn: 14244
      a52ab6f5
    • Chris Lattner's avatar
      Do not sort by the address of LLVM ConstantInt* objects. This produces · b2b151d2
      Chris Lattner authored
      nondeterministic results that depend on where these objects land in memory.
      Instead, sort by the value of the constant, which is stable.
      
      Before this patch, the -simplifycfg pass run from two different compilers
      could cause different code to be generated, though it was semantically the
      same:
      
      @@ -12258,8 +12258,8 @@
              %s_addr.1 = phi sbyte* [ %s, %entry ], [ %inc.0, %no_exit ]             ; <sbyte*> [#uses=5]
              %tmp.1 = load sbyte* %s_addr.1          ; <sbyte> [#uses=1]
              switch sbyte %tmp.1, label %no_exit [
      -                sbyte 0, label %loopexit
                       sbyte 46, label %loopexit
      +                sbyte 0, label %loopexit
              ]
      
      We need to stomp all of this stuff out.
      
      llvm-svn: 14243
      b2b151d2
  2. Jun 18, 2004
  3. Jun 17, 2004
  4. Jun 16, 2004
  5. Jun 15, 2004
  6. Jun 14, 2004
  7. Jun 13, 2004
  8. Jun 11, 2004
  9. May 27, 2004
  10. May 26, 2004
  11. May 25, 2004
  12. May 19, 2004
  13. May 12, 2004
    • Chris Lattner's avatar
      Do not pass in the same argument to the extracted function more than once, and · 66219aba
      Chris Lattner authored
      give the extracted function a more useful name than just foo_code.
      
      llvm-svn: 13493
      66219aba
    • Chris Lattner's avatar
      Implement support for code extracting basic blocks that have a return · 13d2ddfe
      Chris Lattner authored
      instruction in them.
      
      llvm-svn: 13490
      13d2ddfe
    • Chris Lattner's avatar
      Implement splitting of PHI nodes, allowing block extraction of BB's that have · 795c9933
      Chris Lattner authored
      PHI node entries from multiple outside-the-region blocks.  This also fixes
      extraction of the entry block in a function.  Yaay.
      
      This has successfully block extracted all (but one) block from the score_move
      function in obsequi (out of 33).  Hrm, I wonder which block the bug is in.  :)
      
      llvm-svn: 13489
      795c9933
    • Chris Lattner's avatar
      * Pull some code out into the definedInRegion/definedInCaller methods · 3b2917bf
      Chris Lattner authored
      * Add a stub for the severSplitPHINodes which will allow us to bbextract
        bb's with PHI nodes in them soon.
      * Remove unused arguments from findInputsOutputs
      * Dramatically simplify the code in findInputsOutputs.  In particular,
        nothing really cares whether or not a PHI node is using something.
      * Move moveCodeToFunction to after emitCallAndSwitchStatement as that's the
        order they get called.
      * Fix a bug where we would code extract a region that included a call to
        vastart.  Like 'alloca', calls to vastart must stay in the function that
        they are defined in.
      * Add some comments.
      
      llvm-svn: 13482
      3b2917bf
    • Chris Lattner's avatar
      Generate substantially better code when there are a limited number of exits · ffc49262
      Chris Lattner authored
      from the extracted region.  If the return has 0 or 1 exit blocks, the new
      function returns void.  If it has 2 exits, it returns bool, otherwise it
      returns a ushort as before.
      
      This allows us to use a conditional branch instruction when there are two
      exit blocks, as often happens during block extraction.
      
      llvm-svn: 13481
      ffc49262
    • Chris Lattner's avatar
      Two minor improvements: · 3d1ca67f
      Chris Lattner authored
        1. Get rid of the silly abort block.  When doing bb extraction, we get one
           abort block for every block extracted, which is kinda annoying.
        2. If the switch ends up having a single destination, turn it into an
           unconditional branch.
      
      I would like to add support for conditional branches, but to do this we will
      want to have the function return a bool instead of a ushort.
      
      llvm-svn: 13478
      3d1ca67f
  14. May 02, 2004
  15. Apr 24, 2004
  16. Apr 21, 2004
  17. Apr 17, 2004
  18. Apr 16, 2004
  19. Apr 13, 2004
  20. Apr 10, 2004
    • Chris Lattner's avatar
      Fold code like: · 0aa56564
      Chris Lattner authored
        if (C)
          V1 |= V2;
      
      into:
        Vx = V1 | V2;
        V1 = select C, V1, Vx
      
      when the expression can be evaluated unconditionally and is *cheap* to
      execute.  This limited form of if conversion is quite handy in lots of cases.
      For example, it turns this testcase into straight-line code:
      
      int in0 ; int in1 ; int in2 ; int in3 ;
      int in4 ; int in5 ; int in6 ; int in7 ;
      int in8 ; int in9 ; int in10; int in11;
      int in12; int in13; int in14; int in15;
      long output;
      
      void mux(void) {
        output =
            (in0   ?  0x00000001 : 0) | (in1   ?  0x00000002 : 0) |
            (in2   ?  0x00000004 : 0) | (in3   ?  0x00000008 : 0) |
            (in4   ?  0x00000010 : 0) | (in5   ?  0x00000020 : 0) |
            (in6   ?  0x00000040 : 0) | (in7   ?  0x00000080 : 0) |
            (in8   ?  0x00000100 : 0) | (in9   ?  0x00000200 : 0) |
            (in10  ?  0x00000400 : 0) | (in11  ?  0x00000800 : 0) |
            (in12  ?  0x00001000 : 0) | (in13  ?  0x00002000 : 0) |
            (in14  ?  0x00004000 : 0) | (in15  ?  0x00008000 : 0) ;
      }
      
      llvm-svn: 12798
      0aa56564
  21. Apr 08, 2004
  22. Apr 02, 2004
Loading