Skip to content
  1. Aug 28, 2010
  2. Aug 27, 2010
  3. Aug 26, 2010
    • Jim Grosbach's avatar
      tidy up a bit. no functional change. · e82d5b4a
      Jim Grosbach authored
      llvm-svn: 112228
      e82d5b4a
    • Chris Lattner's avatar
      optimize bitcast(trunc(bitcast(x))) where the result is a float and 'x' · d4ebd6df
      Chris Lattner authored
      is a vector to be a vector element extraction.  This allows clang to
      compile:
      
      struct S { float A, B, C, D; };
      float foo(struct S A) { return A.A + A.B+A.C+A.D; }
      
      into:
      
      _foo:                                   ## @foo
      ## BB#0:                                ## %entry
      	movd	%xmm0, %rax
      	shrq	$32, %rax
      	movd	%eax, %xmm2
      	addss	%xmm0, %xmm2
      	movapd	%xmm1, %xmm3
      	addss	%xmm2, %xmm3
      	movd	%xmm1, %rax
      	shrq	$32, %rax
      	movd	%eax, %xmm0
      	addss	%xmm3, %xmm0
      	ret
      
      instead of:
      
      _foo:                                   ## @foo
      ## BB#0:                                ## %entry
      	movd	%xmm0, %rax
      	movd	%eax, %xmm0
      	shrq	$32, %rax
      	movd	%eax, %xmm2
      	addss	%xmm0, %xmm2
      	movd	%xmm1, %rax
      	movd	%eax, %xmm1
      	addss	%xmm2, %xmm1
      	shrq	$32, %rax
      	movd	%eax, %xmm0
      	addss	%xmm1, %xmm0
      	ret
      
      ... eliminating half of the horribleness.
      
      llvm-svn: 112227
      d4ebd6df
Loading