Skip to content
  1. Feb 23, 2005
  2. Feb 17, 2005
  3. Feb 14, 2005
  4. Feb 12, 2005
  5. Feb 10, 2005
  6. Feb 02, 2005
  7. Feb 01, 2005
  8. Jan 31, 2005
  9. Jan 29, 2005
  10. Jan 28, 2005
    • Chris Lattner's avatar
      * add some DEBUG statements · cd517ff0
      Chris Lattner authored
      * Properly compile this:
      
      struct a {};
      int test() {
        struct a b[2];
        if (&b[0] != &b[1])
          abort ();
        return 0;
      }
      
      to 'return 0', not abort().
      
      llvm-svn: 19875
      cd517ff0
  11. Jan 25, 2005
  12. Jan 23, 2005
  13. Jan 22, 2005
  14. Jan 19, 2005
  15. Jan 17, 2005
  16. Jan 14, 2005
  17. Jan 13, 2005
    • Chris Lattner's avatar
      Turn select C, (X+Y), (X-Y) --> (X+(select C, Y, (-Y))). This occurs in · a04c904c
      Chris Lattner authored
      the 'sim' program and probably elsewhere.  In sim, it comes up for cases
      like this:
      
      #define round(x) ((x)>0.0 ? (x)+0.5 : (x)-0.5)
      double G;
      void T(double X) { G = round(X); }
      
      (it uses the round macro a lot).  This changes the LLVM code from:
      
              %tmp.1 = setgt double %X, 0.000000e+00          ; <bool> [#uses=1]
              %tmp.4 = add double %X, 5.000000e-01            ; <double> [#uses=1]
              %tmp.6 = sub double %X, 5.000000e-01            ; <double> [#uses=1]
              %mem_tmp.0 = select bool %tmp.1, double %tmp.4, double %tmp.6
              store double %mem_tmp.0, double* %G
      
      to:
      
              %tmp.1 = setgt double %X, 0.000000e+00          ; <bool> [#uses=1]
              %mem_tmp.0.p = select bool %tmp.1, double 5.000000e-01, double -5.000000e-01
              %mem_tmp.0 = add double %mem_tmp.0.p, %X
              store double %mem_tmp.0, double* %G
              ret void
      
      llvm-svn: 19537
      a04c904c
    • Chris Lattner's avatar
      Implement an optimization for == and != comparisons like this: · 81e84176
      Chris Lattner authored
      _Bool test2(int X, int Y) {
        return &arr[X][Y] == arr;
      }
      
      instead of generating this:
      
      bool %test2(int %X, int %Y) {
              %tmp.3.idx = mul int %X, 160            ; <int> [#uses=1]
              %tmp.3.idx1 = shl int %Y, ubyte 2               ; <int> [#uses=1]
              %tmp.3.offs2 = sub int 0, %tmp.3.idx            ; <int> [#uses=1]
              %tmp.7 = seteq int %tmp.3.idx1, %tmp.3.offs2            ; <bool> [#uses=1]
              ret bool %tmp.7
      }
      
      
      generate this:
      
      bool %test2(int %X, int %Y) {
              seteq int %X, 0         ; <bool>:0 [#uses=1]
              seteq int %Y, 0         ; <bool>:1 [#uses=1]
              %tmp.7 = and bool %0, %1                ; <bool> [#uses=1]
              ret bool %tmp.7
      }
      
      This idiom occurs in C++ programs when iterating from begin() to end(),
      in a vector or array.  For example, we now compile this:
      
      void test(int X, int Y) {
        for (int *i = arr; i != arr+100; ++i)
          foo(*i);
      }
      
      to this:
      
      no_exit:                ; preds = %entry, %no_exit
      	...
              %exitcond = seteq uint %indvar.next, 100                ; <bool> [#uses=1]
              br bool %exitcond, label %return, label %no_exit
      
      
      
      instead of this:
      
      no_exit:                ; preds = %entry, %no_exit
      	...
              %inc5 = getelementptr [100 x [40 x int]]* %arr, int 0, int 0, int %inc.rec              ; <int*> [#uses=1]
              %tmp.8 = seteq int* %inc5, getelementptr ([100 x [40 x int]]* %arr, int 0, int 100, int 0)              ; <bool> [#uses=1]
              %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
              br bool %tmp.8, label %return, label %no_exit
      
      llvm-svn: 19536
      81e84176
    • Chris Lattner's avatar
      Fix some bugs in code I didn't mean to check in. · 4cb9fa37
      Chris Lattner authored
      llvm-svn: 19534
      4cb9fa37
    • Chris Lattner's avatar
      Fix a crash compiling 129.compress · 0798af33
      Chris Lattner authored
      llvm-svn: 19533
      0798af33
  18. Jan 11, 2005
  19. Jan 10, 2005
  20. Jan 08, 2005
Loading