Skip to content
  1. May 06, 2005
  2. May 05, 2005
  3. May 04, 2005
    • Andrew Lenharth's avatar
      Make promoteOp work for CT* · dd426dd0
      Andrew Lenharth authored
      Proof?
      
      ubyte %bar(ubyte %x) {
      entry:
              %tmp.1 = call ubyte %llvm.ctlz( ubyte %x )
              ret ubyte %tmp.1
      }
      
      ==>
      
      zapnot $16,1,$0
      CTLZ $0,$0
      subq $0,56,$0
      zapnot $0,1,$0
      ret $31,($26),1
      
      llvm-svn: 21691
      dd426dd0
  4. May 03, 2005
  5. Apr 30, 2005
  6. Apr 28, 2005
  7. Apr 27, 2005
    • Andrew Lenharth's avatar
      Implement Value* tracking for loads and stores in the selection DAG. This... · 4a73c2cf
      Andrew Lenharth authored
      Implement Value* tracking for loads and stores in the selection DAG.  This enables one to use alias analysis in the backends.
      
      (TRUNK)Stores and (EXT|ZEXT|SEXT)Loads have an extra SDOperand which is a SrcValueSDNode which contains the Value*.  Note that if the operation is introduced by the backend, it will still have the operand, but the value* will be null.
      
      llvm-svn: 21599
      4a73c2cf
  8. Apr 26, 2005
  9. Apr 25, 2005
    • Chris Lattner's avatar
      implement some more logical compares with constants, so that: · f806459d
      Chris Lattner authored
      int foo1(int x, int y) {
        int t1 = x >= 0;
        int t2 = y >= 0;
        return t1 & t2;
      }
      int foo2(int x, int y) {
        int t1 = x == -1;
        int t2 = y == -1;
        return t1 & t2;
      }
      
      produces:
      
      _foo1:
              or r2, r4, r3
              srwi r2, r2, 31
              xori r3, r2, 1
              blr
      _foo2:
              and r2, r4, r3
              addic r2, r2, 1
              li r2, 0
              addze r3, r2
              blr
      
      instead of:
      
      _foo1:
              srwi r2, r4, 31
              xori r2, r2, 1
              srwi r3, r3, 31
              xori r3, r3, 1
              and r3, r2, r3
              blr
      _foo2:
              addic r2, r4, 1
              li r2, 0
              addze r2, r2
              addic r3, r3, 1
              li r3, 0
              addze r3, r3
              and r3, r2, r3
              blr
      
      llvm-svn: 21547
      f806459d
    • Chris Lattner's avatar
      Codegen x < 0 | y < 0 as (x|y) < 0. This allows us to compile this to: · d373ff64
      Chris Lattner authored
      _foo:
              or r2, r4, r3
              srwi r3, r2, 31
              blr
      
      instead of:
      
      _foo:
              srwi r2, r4, 31
              srwi r3, r3, 31
              or r3, r2, r3
              blr
      
      llvm-svn: 21544
      d373ff64
  10. Apr 22, 2005
  11. Apr 21, 2005
    • Chris Lattner's avatar
      Improve and elimination. On PPC, for: · f6302441
      Chris Lattner authored
      bool %test(int %X) {
              %Y = and int %X, 8
              %Z = setne int %Y, 0
              ret bool %Z
      }
      
      we now generate this:
      
              rlwinm r2, r3, 0, 28, 28
              srwi r3, r2, 3
      
      instead of this:
      
              rlwinm r2, r3, 0, 28, 28
              srwi r2, r2, 3
              rlwinm r3, r2, 0, 31, 31
      
      I'll leave it to Nate to get it down to one instruction. :)
      
      ---------------------------------------------------------------------
      
      llvm-svn: 21391
      f6302441
    • Chris Lattner's avatar
      Fold (x & 8) != 0 and (x & 8) == 8 into (x & 8) >> 3. · ab1ed775
      Chris Lattner authored
      This turns this PPC code:
      
              rlwinm r2, r3, 0, 28, 28
              cmpwi cr7, r2, 8
              mfcr r2
              rlwinm r3, r2, 31, 31, 31
      
      into this:
      
              rlwinm r2, r3, 0, 28, 28
              srwi r2, r2, 3
              rlwinm r3, r2, 0, 31, 31
      
      Next up, nuking the extra and.
      
      llvm-svn: 21390
      ab1ed775
  12. Apr 18, 2005
  13. Apr 14, 2005
  14. Apr 13, 2005
  15. Apr 12, 2005
    • Chris Lattner's avatar
      promote extload i1 -> extload i8 · 0b73a6d8
      Chris Lattner authored
      llvm-svn: 21258
      0b73a6d8
    • Chris Lattner's avatar
      Remove some redundant checks, add a couple of new ones. This allows us to · af5b25f1
      Chris Lattner authored
      compile this:
      
      int foo (unsigned long a, unsigned long long g) {
        return a >= g;
      }
      
      To:
      
      foo:
              movl 8(%esp), %eax
              cmpl %eax, 4(%esp)
              setae %al
              cmpl $0, 12(%esp)
              sete %cl
              andb %al, %cl
              movzbl %cl, %eax
              ret
      
      instead of:
      
      foo:
              movl 8(%esp), %eax
              cmpl %eax, 4(%esp)
              setae %al
              movzbw %al, %cx
              movl 12(%esp), %edx
              cmpl $0, %edx
              sete %al
              movzbw %al, %ax
              cmpl $0, %edx
              cmove %cx, %ax
              movzbl %al, %eax
              ret
      
      llvm-svn: 21244
      af5b25f1
    • Chris Lattner's avatar
      Emit comparisons against the sign bit better. Codegen this: · aedcabe8
      Chris Lattner authored
      bool %test1(long %X) {
              %A = setlt long %X, 0
              ret bool %A
      }
      
      like this:
      
      test1:
              cmpl $0, 8(%esp)
              setl %al
              movzbl %al, %eax
              ret
      
      instead of:
      
      test1:
              movl 8(%esp), %ecx
              cmpl $0, %ecx
              setl %al
              movzbw %al, %ax
              cmpl $0, 4(%esp)
              setb %dl
              movzbw %dl, %dx
              cmpl $0, %ecx
              cmove %dx, %ax
              movzbl %al, %eax
              ret
      
      llvm-svn: 21243
      aedcabe8
    • Chris Lattner's avatar
      Emit long comparison against -1 better. Instead of this (x86): · 71ff44e4
      Chris Lattner authored
      test2:
              movl 8(%esp), %eax
              notl %eax
              movl 4(%esp), %ecx
              notl %ecx
              orl %eax, %ecx
              cmpl $0, %ecx
              sete %al
              movzbl %al, %eax
              ret
      
      or this (PPC):
      
      _test2:
              nor r2, r4, r4
              nor r3, r3, r3
              or r2, r2, r3
              cntlzw r2, r2
              srwi r3, r2, 5
              blr
      
      Emit this:
      
      test2:
              movl 8(%esp), %eax
              andl 4(%esp), %eax
              cmpl $-1, %eax
              sete %al
              movzbl %al, %eax
              ret
      
      or this:
      
      _test2:
      .LBB_test2_0:   ;
              and r2, r4, r3
              cmpwi cr0, r2, -1
              li r3, 1
              li r2, 0
              beq .LBB_test2_2        ;
      .LBB_test2_1:   ;
              or r3, r2, r2
      .LBB_test2_2:   ;
              blr
      
      it seems like the PPC isel could do better for R32 == -1 case.
      
      llvm-svn: 21242
      71ff44e4
Loading