Skip to content
  1. Jan 22, 2010
  2. Jan 21, 2010
  3. Jan 20, 2010
  4. Jan 19, 2010
  5. Jan 18, 2010
  6. Jan 17, 2010
  7. Jan 15, 2010
  8. Jan 14, 2010
    • Bill Wendling's avatar
      When the visitSub method was split into visitSub and visitFSub, this xform was · ad7a5b07
      Bill Wendling authored
      added to the FSub version. However, the original version of this xform guarded
      against doing this for floating point (!Op0->getType()->isFPOrFPVector()).
      
      This is causing LLVM to perform incorrect xforms for code like:
      
      void func(double *rhi, double *rlo, double xh, double xl, double yh, double yl){
        double mh, ml;
        double c = 134217729.0;
        double up, u1, u2, vp, v1, v2;
              
        up = xh*c;
        u1 = (xh - up) + up;
        u2 = xh - u1;
              
        vp = yh*c;
        v1 = (yh - vp) + vp;
        v2 = yh - v1;
              
        mh = xh*yh;
        ml = (((u1*v1 - mh) + (u1*v2)) + (u2*v1)) + (u2*v2);
        ml += xh*yl + xl*yh;
              
        *rhi = mh + ml;
        *rlo = (mh - (*rhi)) + ml;
      }
      
      The last line was optimized away, but rl is intended to be the difference
      between the infinitely precise result of mh + ml and after it has been rounded
      to double precision.
      
      llvm-svn: 93369
      ad7a5b07
  9. Jan 12, 2010
  10. Jan 11, 2010
    • Chris Lattner's avatar
      reenable the piece that turns trunc(zext(x)) -> x even if zext has multiple uses, · d1a3efed
      Chris Lattner authored
      codegen has no apparent problem with the trunc version of this, because it turns
      into a simple subreg idiom
      
      llvm-svn: 93202
      d1a3efed
    • Chris Lattner's avatar
      Disable folding sext(trunc(x)) -> x (and other similar cast/cast cases) when the · a6b1356c
      Chris Lattner authored
      trunc has multiple uses.  Codegen is not able to coalesce the subreg case 
      correctly and so this leads to higher register pressure and spilling (see PR5997).
      
      This speeds up 256.bzip2 from 8.60 -> 8.04s on my machine, ~7%.
      
      llvm-svn: 93200
      a6b1356c
    • Chris Lattner's avatar
      add one more bitfield optimization, allowing clang to generate · 95188694
      Chris Lattner authored
      good code on PR4216:
      
      _test_bitfield:                                             ## @test_bitfield
      	orl	$32962, %edi
      	movl	$4294941946, %eax
      	andq	%rdi, %rax
      	ret
      
      instead of:
      
      _test_bitfield:
              movl    $4294941696, %ecx
              movl    %edi, %eax
              orl     $194, %edi
              orl     $32768, %eax
              andq    $250, %rdi
              andq    %rax, %rcx
              movq    %rdi, %rax
              orq     %rcx, %rax
              ret
      
      Evan is looking into the remaining andq+imm -> andl optimization.
      
      llvm-svn: 93147
      95188694
    • Chris Lattner's avatar
      Extend CanEvaluateZExtd to handle and/or/xor more aggressively in the · 0a854204
      Chris Lattner authored
      BitsToClear case.  This allows it to promote expressions which have an
      and/or/xor after the lshr, promoting cases like test2 (from PR4216) 
      and test3 (random extample extracted from a spec benchmark).
      
      clang now compiles the code in PR4216 into:
      
      _test_bitfield:                                             ## @test_bitfield
      	movl	%edi, %eax
      	orl	$194, %eax
      	movl	$4294902010, %ecx
      	andq	%rax, %rcx
      	orl	$32768, %edi
      	andq	$39936, %rdi
      	movq	%rdi, %rax
      	orq	%rcx, %rax
      	ret
      
      instead of:
      
      _test_bitfield:                                             ## @test_bitfield
      	movl	%edi, %eax
      	orl	$194, %eax
      	movl	$4294902010, %ecx
      	andq	%rax, %rcx
      	shrl	$8, %edi
      	orl	$128, %edi
      	shlq	$8, %rdi
      	andq	$39936, %rdi
      	movq	%rdi, %rax
      	orq	%rcx, %rax
      	ret
      
      which is still not great, but is progress.
      
      llvm-svn: 93145
      0a854204
    • Chris Lattner's avatar
      Remove the dead TD argument to CanEvaluateZExtd, and add a · 12bd8992
      Chris Lattner authored
      new BitsToClear result which allows us to start promoting
      expressions that end with a lshr-by-constant.  This is
      conservatively correct and better than what we had before
      (see testcases) but still needs to be extended further.
      
      llvm-svn: 93144
      12bd8992
Loading