Skip to content
  1. Jun 19, 2004
    • Chris Lattner's avatar
      Fix one source of nondeterminism in the -licm pass: the hoist pass · ec2d34cc
      Chris Lattner authored
      was processing blocks in whatever order they happened to end up in the
      dominator tree data structure.  Force an ordering.
      
      llvm-svn: 14248
      ec2d34cc
    • Chris Lattner's avatar
      Change to use the StableBasicBlockNumbering class · 4db0f826
      Chris Lattner authored
      llvm-svn: 14247
      4db0f826
    • 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
    • Chris Lattner's avatar
      Do not loop over uses as we delete them. This causes iterators to be · b5f8eb83
      Chris Lattner authored
      invalidated out from under us.  This bug goes back to revision 1.1: scary.
      
      llvm-svn: 14242
      b5f8eb83
  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. Jun 10, 2004
    • Chris Lattner's avatar
      Fix a bug in my checkin from last night that caused miscompilations of · ee59d4bf
      Chris Lattner authored
      186.crafty, fhourstones and 132.ijpeg.
      
      Bugpoint makes really nasty miscompilations embarassingly easy to find.  It
      narrowed it down to the instcombiner and this testcase (from fhourstones):
      
      bool %l7153_l4706_htstat_loopentry_2E_4_no_exit_2E_4(int* %i, [32 x int]* %works, int* %tmp.98.out) {
      newFuncRoot:
              %tmp.96 = load int* %i          ; <int> [#uses=1]
              %tmp.97 = getelementptr [32 x int]* %works, long 0, int %tmp.96         ; <int*> [#uses=1]
              %tmp.98 = load int* %tmp.97             ; <int> [#uses=2]
              %tmp.99 = load int* %i          ; <int> [#uses=1]
              %tmp.100 = and int %tmp.99, 7           ; <int> [#uses=1]
              %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=2]
              %tmp.102 = cast bool %tmp.101 to int            ; <int> [#uses=0]
              br bool %tmp.101, label %codeRepl4.exitStub, label %codeRepl3.exitStub
      
      codeRepl4.exitStub:             ; preds = %newFuncRoot
              store int %tmp.98, int* %tmp.98.out
              ret bool true
      
      codeRepl3.exitStub:             ; preds = %newFuncRoot
              store int %tmp.98, int* %tmp.98.out
              ret bool false
      }
      
      ... which only has one combination performed on it:
      
      $ llvm-as < t.ll | opt -instcombine -debug | llvm-dis
      IC: Old =       %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=1]
          New =       setne int %tmp.100, 0           ; <bool>:<badref> [#uses=0]
      IC: MOD =       br bool %tmp.101, label %codeRepl3.exitStub, label %codeRepl4.exitStub
      IC: MOD =       %tmp.97 = getelementptr [32 x int]* %works, uint 0, int %tmp.96         ; <int*> [#uses=1]
      
      It doesn't get much better than this.  :)
      
      llvm-svn: 14109
      ee59d4bf
    • Chris Lattner's avatar
      More minor cleanups · c8e7e298
      Chris Lattner authored
      llvm-svn: 14108
      c8e7e298
    • Chris Lattner's avatar
      Eliminate many occurrances of Instruction:: · df20a4d5
      Chris Lattner authored
      llvm-svn: 14107
      df20a4d5
  10. Jun 09, 2004
  11. Jun 03, 2004
  12. Jun 01, 2004
  13. May 28, 2004
  14. May 27, 2004
  15. May 26, 2004
  16. May 25, 2004
  17. May 24, 2004
  18. May 23, 2004
Loading