Skip to content
  1. Nov 07, 2010
  2. Nov 06, 2010
  3. Sep 30, 2010
  4. Sep 19, 2010
  5. Aug 08, 2010
  6. Jul 08, 2010
    • Benjamin Kramer's avatar
      Teach instcombine to transform · 2321e6a4
      Benjamin Kramer authored
      (X >s -1) ? C1 : C2 and (X <s  0) ? C2 : C1
      into ((X >>s 31) & (C2 - C1)) + C1, avoiding the conditional.
      
      This optimization could be extended to take non-const C1 and C2 but we better
      stay conservative to avoid code size bloat for now.
      
      for
      int sel(int n) {
           return n >= 0 ? 60 : 100;
      }
      
      we now generate
        sarl  $31, %edi
        andl  $40, %edi
        leal  60(%rdi), %eax
      
      instead of
        testl %edi, %edi
        movl  $60, %ecx
        movl  $100, %eax
        cmovnsl %ecx, %eax
      
      llvm-svn: 107866
      2321e6a4
  7. Jul 03, 2010
  8. Jun 30, 2010
  9. Jun 16, 2010
  10. Jun 12, 2010
  11. May 22, 2010
  12. May 03, 2010
  13. Apr 17, 2010
  14. Apr 15, 2010
    • Chris Lattner's avatar
      Implement rdar://7860110 (also in target/readme.txt) narrowing · 4041ab6e
      Chris Lattner authored
      a load/or/and/store sequence into a narrower store when it is
      safe.  Daniel tells me that clang will start producing this sort
      of thing with bitfields, and this does  trigger a few dozen times
      on 176.gcc produced by llvm-gcc even now.
      
      This compiles code like CodeGen/X86/2009-05-28-DAGCombineCrash.ll 
      into:
      
              movl    %eax, 36(%rdi)
      
      instead of:
      
              movl    $4294967295, %eax       ## imm = 0xFFFFFFFF
              andq    32(%rdi), %rax
              shlq    $32, %rcx
              addq    %rax, %rcx
              movq    %rcx, 32(%rdi)
      
      and each of the testcases into a single store.  Each of them used
      to compile into craziness like this:
      
      _test4:
      	movl	$65535, %eax            ## imm = 0xFFFF
      	andl	(%rdi), %eax
      	shll	$16, %esi
      	addl	%eax, %esi
      	movl	%esi, (%rdi)
      	ret
      
      llvm-svn: 101343
      4041ab6e
  15. Mar 10, 2010
  16. Feb 09, 2010
  17. Jan 31, 2010
  18. Jan 29, 2010
  19. Jan 24, 2010
  20. Jan 23, 2010
  21. Jan 18, 2010
  22. Jan 06, 2010
    • Duncan Sands's avatar
      Fix a README item: have functionattrs look through selects and · c8493da5
      Duncan Sands authored
      phi nodes when deciding which pointers point to local memory.
      I actually checked long ago how useful this is, and it isn't
      very: it hardly ever fires in the testsuite, but since Chris
      wants it here it is!
      
      llvm-svn: 92836
      c8493da5
    • Duncan Sands's avatar
      Partially address a README by having functionattrs consider calls to · 78376ad7
      Duncan Sands authored
      memcpy, memset and other intrinsics that only access their arguments
      to be readnone if the intrinsic's arguments all point to local memory.
      This improves the testcase in the README to readonly, but it could in
      theory be made readnone, however this would involve more sophisticated
      analysis that looks through the memcpy.
      
      llvm-svn: 92829
      78376ad7
  23. Jan 04, 2010
  24. Jan 01, 2010
  25. Dec 13, 2009
  26. Dec 12, 2009
  27. Dec 03, 2009
  28. Nov 29, 2009
  29. Nov 27, 2009
  30. Nov 26, 2009
    • Chris Lattner's avatar
      Teach basicaa that x|c == x+c when the c bits of x are clear. This · 29bc8a91
      Chris Lattner authored
      allows us to compile the example in readme.txt into:
      
      LBB1_1:                                                     ## %bb
      	movl	4(%rdx,%rax), %ecx
      	movl	%ecx, %esi
      	imull	(%rdx,%rax), %esi
      	imull	%esi, %ecx
      	movl	%esi, 8(%rdx,%rax)
      	imull	%ecx, %esi
      	movl	%ecx, 12(%rdx,%rax)
      	movl	%esi, 16(%rdx,%rax)
      	imull	%ecx, %esi
      	movl	%esi, 20(%rdx,%rax)
      	addq	$16, %rax
      	cmpq	$4000, %rax
      	jne	LBB1_1
      
      instead of:
      
      LBB1_1: 
      	movl	(%rdx,%rax), %ecx
      	imull	4(%rdx,%rax), %ecx
      	movl	%ecx, 8(%rdx,%rax)
      	imull	4(%rdx,%rax), %ecx
      	movl	%ecx, 12(%rdx,%rax)
      	imull	8(%rdx,%rax), %ecx
      	movl	%ecx, 16(%rdx,%rax)
      	imull	12(%rdx,%rax), %ecx
      	movl	%ecx, 20(%rdx,%rax)
      	addq	$16, %rax
      	cmpq	$4000, %rax
      	jne	LBB1_1
      
      GCC (4.2) doesn't seem to be able to eliminate the loads in this 
      testcase either, it generates:
      
      L2:
      	movl	(%rdx), %eax
      	imull	4(%rdx), %eax
      	movl	%eax, 8(%rdx)
      	imull	4(%rdx), %eax
      	movl	%eax, 12(%rdx)
      	imull	8(%rdx), %eax
      	movl	%eax, 16(%rdx)
      	imull	12(%rdx), %eax
      	movl	%eax, 20(%rdx)
      	addl	$4, %ecx
      	addq	$16, %rdx
      	cmpl	$1002, %ecx
      	jne	L2
      
      llvm-svn: 89952
      29bc8a91
    • Chris Lattner's avatar
      teach basicaa that A[i] != A[i+1]. · 12dacdd3
      Chris Lattner authored
      llvm-svn: 89951
      12dacdd3
Loading