Skip to content
  1. Sep 18, 2005
    • Chris Lattner's avatar
      fix typeo · 4ebc8ab4
      Chris Lattner authored
      llvm-svn: 23383
      4ebc8ab4
    • Chris Lattner's avatar
      Remove unintentionally committed code · e5b23a6d
      Chris Lattner authored
      llvm-svn: 23382
      e5b23a6d
    • Chris Lattner's avatar
      implement shift.ll:test25. This compiles: · 27cb9dbd
      Chris Lattner authored
      struct S { unsigned int i : 6, j : 11, k : 15; } b;
      void plus3 (unsigned int x) {
        b.k += x;
      }
      
      to:
      
      _plus3:
              lis r2, ha16(L_b$non_lazy_ptr)
              lwz r2, lo16(L_b$non_lazy_ptr)(r2)
              lwz r3, 0(r2)
              rlwinm r4, r3, 0, 0, 14
              add r4, r4, r3
              rlwimi r4, r3, 0, 15, 31
              stw r4, 0(r2)
              blr
      
      instead of:
      
      _plus3:
              lis r2, ha16(L_b$non_lazy_ptr)
              lwz r2, lo16(L_b$non_lazy_ptr)(r2)
              lwz r4, 0(r2)
              srwi r5, r4, 17
              add r3, r5, r3
              slwi r3, r3, 17
              rlwimi r3, r4, 0, 15, 31
              stw r3, 0(r2)
              blr
      
      llvm-svn: 23381
      27cb9dbd
    • Chris Lattner's avatar
      Implement add.ll:test29. Codegening: · af517574
      Chris Lattner authored
      struct S { unsigned int i : 6, j : 11, k : 15; } b;
      void plus1 (unsigned int x) {
        b.i += x;
      }
      
      as:
      _plus1:
              lis r2, ha16(L_b$non_lazy_ptr)
              lwz r2, lo16(L_b$non_lazy_ptr)(r2)
              lwz r4, 0(r2)
              add r3, r4, r3
              rlwimi r3, r4, 0, 0, 25
              stw r3, 0(r2)
              blr
      
      instead of:
      
      _plus1:
              lis r2, ha16(L_b$non_lazy_ptr)
              lwz r2, lo16(L_b$non_lazy_ptr)(r2)
              lwz r4, 0(r2)
              rlwinm r5, r4, 0, 26, 31
              add r3, r5, r3
              rlwimi r3, r4, 0, 0, 25
              stw r3, 0(r2)
              blr
      
      llvm-svn: 23379
      af517574
    • Chris Lattner's avatar
      remove debug output · 027eaf01
      Chris Lattner authored
      llvm-svn: 23377
      027eaf01
    • Chris Lattner's avatar
      Implement or.ll:test21. This teaches instcombine to be able to turn this: · 15212989
      Chris Lattner authored
      struct {
         unsigned int bit0:1;
         unsigned int ubyte:31;
      } sdata;
      
      void foo() {
        sdata.ubyte++;
      }
      
      into this:
      
      foo:
              add DWORD PTR [sdata], 2
              ret
      
      instead of this:
      
      foo:
              mov %EAX, DWORD PTR [sdata]
              mov %ECX, %EAX
              add %ECX, 2
              and %ECX, -2
              and %EAX, 1
              or %EAX, %ECX
              mov DWORD PTR [sdata], %EAX
              ret
      
      llvm-svn: 23376
      15212989
  2. Sep 14, 2005
  3. Sep 13, 2005
  4. Aug 08, 2005
  5. Aug 07, 2005
  6. Aug 05, 2005
  7. Aug 02, 2005
  8. Jul 27, 2005
  9. Jul 20, 2005
  10. Jul 19, 2005
  11. Jul 07, 2005
  12. Jun 18, 2005
  13. Jun 17, 2005
  14. Jun 16, 2005
  15. Jun 15, 2005
  16. Jun 13, 2005
  17. Jun 04, 2005
  18. May 14, 2005
  19. May 13, 2005
  20. May 09, 2005
  21. May 08, 2005
  22. May 06, 2005
    • Chris Lattner's avatar
      Preserve tail marker · 6aacb0f9
      Chris Lattner authored
      llvm-svn: 21737
      6aacb0f9
    • Chris Lattner's avatar
      Teach instcombine propagate zeroness through shl instructions, implementing · ef298a3b
      Chris Lattner authored
      and.ll:test31
      
      llvm-svn: 21717
      ef298a3b
    • Chris Lattner's avatar
      Implement shift.ll:test23. If we are shifting right then immediately truncating · 87380416
      Chris Lattner authored
      the result, turn signed shift rights into unsigned shift rights if possible.
      
      This leads to later simplification and happens *often* in 176.gcc.  For example,
      this testcase:
      
      struct xxx { unsigned int code : 8; };
      enum codes { A, B, C, D, E, F };
      int foo(struct xxx *P) {
        if ((enum codes)P->code == A)
           bar();
      }
      
      used to be compiled to:
      
      int %foo(%struct.xxx* %P) {
              %tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0           ; <uint*> [#uses=1]
              %tmp.2 = load uint* %tmp.1              ; <uint> [#uses=1]
              %tmp.3 = cast uint %tmp.2 to int                ; <int> [#uses=1]
              %tmp.4 = shl int %tmp.3, ubyte 24               ; <int> [#uses=1]
              %tmp.5 = shr int %tmp.4, ubyte 24               ; <int> [#uses=1]
              %tmp.6 = cast int %tmp.5 to sbyte               ; <sbyte> [#uses=1]
              %tmp.8 = seteq sbyte %tmp.6, 0          ; <bool> [#uses=1]
              br bool %tmp.8, label %then, label %UnifiedReturnBlock
      
      Now it is compiled to:
      
              %tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0           ; <uint*> [#uses=1]
              %tmp.2 = load uint* %tmp.1              ; <uint> [#uses=1]
              %tmp.2 = cast uint %tmp.2 to sbyte              ; <sbyte> [#uses=1]
              %tmp.8 = seteq sbyte %tmp.2, 0          ; <bool> [#uses=1]
              br bool %tmp.8, label %then, label %UnifiedReturnBlock
      
      which is the difference between this:
      
      foo:
              subl $4, %esp
              movl 8(%esp), %eax
              movl (%eax), %eax
              shll $24, %eax
              sarl $24, %eax
              testb %al, %al
              jne .LBBfoo_2
      
      and this:
      
      foo:
              subl $4, %esp
              movl 8(%esp), %eax
              movl (%eax), %eax
              testb %al, %al
              jne .LBBfoo_2
      
      This occurs 3243 times total in the External tests, 215x in povray,
      6x in each f2c'd program, 1451x in 176.gcc, 7x in crafty, 20x in perl,
      25x in gap, 3x in m88ksim, 25x in ijpeg.
      
      Maybe this will cause a little jump on gcc tommorow :)
      
      llvm-svn: 21715
      87380416
Loading