Skip to content
  1. Jul 12, 2006
  2. Jul 11, 2006
  3. Jul 10, 2006
  4. Jun 29, 2006
  5. Jun 28, 2006
  6. Jun 27, 2006
  7. Jun 26, 2006
  8. Jun 17, 2006
  9. Jun 15, 2006
  10. Jun 14, 2006
  11. Jun 12, 2006
  12. Jun 11, 2006
  13. Jun 09, 2006
  14. Jun 07, 2006
  15. Jun 02, 2006
  16. Jun 01, 2006
  17. May 31, 2006
  18. May 26, 2006
  19. May 21, 2006
  20. May 17, 2006
  21. May 14, 2006
  22. May 13, 2006
    • Chris Lattner's avatar
      Add/Sub/Mul are safe to promote here as well. Incrementing a single-bit · 3987a853
      Chris Lattner authored
      bitfield now gives this code:
      
      _plus:
              lwz r2, 0(r3)
              rlwimi r2, r2, 0, 1, 31
              xoris r2, r2, 32768
              stw r2, 0(r3)
              blr
      
      instead of this:
      
      _plus:
              lwz r2, 0(r3)
              srwi r4, r2, 31
              slwi r4, r4, 31
              addis r4, r4, -32768
              rlwimi r2, r4, 0, 0, 0
              stw r2, 0(r3)
              blr
      
      this can obviously still be improved.
      
      llvm-svn: 28275
      3987a853
    • Chris Lattner's avatar
      Implement simple promotion for cast elimination in instcombine. This is · 1ebbe6a2
      Chris Lattner authored
      currently very limited, but can be extended in the future.  For example,
      we now compile:
      
      uint %test30(uint %c1) {
              %c2 = cast uint %c1 to ubyte
              %c3 = xor ubyte %c2, 1
              %c4 = cast ubyte %c3 to uint
              ret uint %c4
      }
      
      to:
      
      _xor:
              movzbl 4(%esp), %eax
              xorl $1, %eax
              ret
      
      instead of:
      
      _xor:
              movb $1, %al
              xorb 4(%esp), %al
              movzbl %al, %eax
              ret
      
      More impressively, we now compile:
      
      struct B { unsigned bit : 1; };
      void xor(struct B *b) { b->bit = b->bit ^ 1; }
      
      To (X86/PPC):
      
      _xor:
              movl 4(%esp), %eax
              xorl $-2147483648, (%eax)
              ret
      _xor:
              lwz r2, 0(r3)
              xoris r2, r2, 32768
              stw r2, 0(r3)
              blr
      
      instead of (X86/PPC):
      
      _xor:
              movl 4(%esp), %eax
              movl (%eax), %ecx
              movl %ecx, %edx
              shrl $31, %edx
              # TRUNCATE movb %dl, %dl
              xorb $1, %dl
              movzbl %dl, %edx
              andl $2147483647, %ecx
              shll $31, %edx
              orl %ecx, %edx
              movl %edx, (%eax)
              ret
      
      _xor:
              lwz r2, 0(r3)
              srwi r4, r2, 31
              xori r4, r4, 1
              rlwimi r2, r4, 31, 0, 0
              stw r2, 0(r3)
              blr
      
      This implements InstCombine/cast.ll:test30.
      
      llvm-svn: 28273
      1ebbe6a2
  23. May 11, 2006
    • Chris Lattner's avatar
      Refactor some code, making it simpler. · 1443bc52
      Chris Lattner authored
      When doing the initial pass of constant folding, if we get a constantexpr,
      simplify the constant expr like we would do if the constant is folded in the
      normal loop.
      
      This fixes the missed-optimization regression in
      Transforms/InstCombine/getelementptr.ll last night.
      
      llvm-svn: 28224
      1443bc52
Loading