Skip to content
  1. Oct 15, 2004
  2. Oct 14, 2004
  3. Oct 13, 2004
  4. Oct 12, 2004
    • Chris Lattner's avatar
      00648e1f
    • Chris Lattner's avatar
      Minor tweaks · 1ccab843
      Chris Lattner authored
      llvm-svn: 16929
      1ccab843
    • Chris Lattner's avatar
      Implement a new method · 89046ca2
      Chris Lattner authored
      llvm-svn: 16927
      89046ca2
    • Chris Lattner's avatar
      This nutty patch has been in my tree since before 1.3 went out, and it needs · ec901cc6
      Chris Lattner authored
      to go in.  This patch allows us to compute the trip count of loops controlled
      by values loaded from constant arrays.  The cannonnical example of this is
      strlen when passed a constant argument:
      
      for (int i = 0; "constantstring"[i]; ++i) ;
      return i;
      
      In this case, it will compute that the loop executes 14 times, which means
      that the exit value of i is 14.  Because of this, the loop gets DCE'd and
      we are happy.  This also applies to anything that does similar things, e.g.
      loops like this:
      
        const float Array[] = { 0.1, 2.1, 3.2, 23.21 };
        for (int i = 0; Array[i] < 20; ++i)
      
      and is actually fairly general.
      
      The problem with this is that it almost never triggers.  The reason is that
      we run indvars and the loop optimizer only at compile time, which is before
      things like strlen and strcpy have been inlined into the program from libc.
      Because of this, it almost never is used (it triggers twice in specint2k).
      
      I'm committing it because it DOES work, may be useful in the future, and
      doesn't slow us down at all.  If/when we start running the loop optimizer
      at link-time (-O4?) this will be very nice indeed :)
      
      llvm-svn: 16926
      ec901cc6
    • Chris Lattner's avatar
      Fix a REALLY obscure bug in my previous checkin, which was splicing the END · 7cabf6f8
      Chris Lattner authored
      marker from one ilist into the middle of another basic block!
      
      llvm-svn: 16925
      7cabf6f8
    • Chris Lattner's avatar
      Handle a common case more carefully. In particular, instead of transforming · 9776f725
      Chris Lattner authored
      pointer recurrences into expressions from this:
      
        %P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ]
        %inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1            ; <sbyte*> [#uses=2]
      
      into this:
      
        %inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec
      
      Actually create something nice, like this:
      
        %inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec
      
      llvm-svn: 16924
      9776f725
    • Chris Lattner's avatar
      Allow creation of GEP constantexprs with a vector of value* operands as · 13128ab8
      Chris Lattner authored
      well as a vector of constant*'s.  It turns out that this is more efficient
      and all of the clients want to do that, so we should cater to them.
      
      llvm-svn: 16923
      13128ab8
    • Chris Lattner's avatar
      Implement remove/eraseFromParent methods · 02a71e77
      Chris Lattner authored
      llvm-svn: 16922
      02a71e77
Loading