Skip to content
  1. Mar 11, 2009
  2. Mar 10, 2009
  3. Mar 09, 2009
  4. Mar 08, 2009
    • Evan Cheng's avatar
      de22116f
    • Chris Lattner's avatar
      implement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4. · ab5a4431
      Chris Lattner authored
      For 2009-03-07-FPConstSelect.ll we now produce:
      
      _f:
      	xorl	%eax, %eax
      	testl	%edi, %edi
      	movl	$4, %ecx
      	cmovne	%rax, %rcx
      	leaq	LCPI1_0(%rip), %rax
      	movss	(%rcx,%rax), %xmm0
      	ret
      
      previously we produced:
      
      _f:
      	subl	$4, %esp
      	cmpl	$0, 8(%esp)
      	movss	LCPI1_0, %xmm0
      	je	LBB1_2	## entry
      LBB1_1:	## entry
      	movss	LCPI1_1, %xmm0
      LBB1_2:	## entry
      	movss	%xmm0, (%esp)
      	flds	(%esp)
      	addl	$4, %esp
      	ret
      
      on PPC the code also improves to:
      
      _f:
      	cntlzw r2, r3
      	srwi r2, r2, 5
      	li r3, lo16(LCPI1_0)
      	slwi r2, r2, 2
      	addis r3, r3, ha16(LCPI1_0)
      	lfsx f1, r3, r2
      	blr 
      
      from:
      
      _f:
      	li r2, lo16(LCPI1_1)
      	cmplwi cr0, r3, 0
      	addis r2, r2, ha16(LCPI1_1)
      	beq cr0, LBB1_2	; entry
      LBB1_1:	; entry
      	li r2, lo16(LCPI1_0)
      	addis r2, r2, ha16(LCPI1_0)
      LBB1_2:	; entry
      	lfs f1, 0(r2)
      	blr 
      
      This also improves the existing pic-cpool case from:
      
      foo:
      	subl	$12, %esp
      	call	.Lllvm$1.$piclabel
      .Lllvm$1.$piclabel:
      	popl	%eax
      	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
      	cmpl	$0, 16(%esp)
      	movsd	.LCPI1_0@GOTOFF(%eax), %xmm0
      	je	.LBB1_2	# entry
      .LBB1_1:	# entry
      	movsd	.LCPI1_1@GOTOFF(%eax), %xmm0
      .LBB1_2:	# entry
      	movsd	%xmm0, (%esp)
      	fldl	(%esp)
      	addl	$12, %esp
      	ret
      
      to:
      
      foo:
      	call	.Lllvm$1.$piclabel
      .Lllvm$1.$piclabel:
      	popl	%eax
      	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
      	xorl	%ecx, %ecx
      	cmpl	$0, 4(%esp)
      	movl	$8, %edx
      	cmovne	%ecx, %edx
      	fldl	.LCPI1_0@GOTOFF(%eax,%edx)
      	ret
      
      This triggers a few dozen times in spec FP 2000.
      
      llvm-svn: 66358
      ab5a4431
    • Chris Lattner's avatar
      random cleanups. · 21cf4bf2
      Chris Lattner authored
      llvm-svn: 66357
      21cf4bf2
  5. Mar 07, 2009
    • Duncan Sands's avatar
      Introduce new linkage types linkonce_odr, weak_odr, common_odr · 12da8ce3
      Duncan Sands authored
      and extern_weak_odr.  These are the same as the non-odr versions,
      except that they indicate that the global will only be overridden
      by an *equivalent* global.  In C, a function with weak linkage can
      be overridden by a function which behaves completely differently.
      This means that IP passes have to skip weak functions, since any
      deductions made from the function definition might be wrong, since
      the definition could be replaced by something completely different
      at link time.   This is not allowed in C++, thanks to the ODR
      (One-Definition-Rule): if a function is replaced by another at
      link-time, then the new function must be the same as the original
      function.  If a language knows that a function or other global can
      only be overridden by an equivalent global, it can give it the
      weak_odr linkage type, and the optimizers will understand that it
      is alright to make deductions based on the function body.  The
      code generators on the other hand map weak and weak_odr linkage
      to the same thing.
      
      llvm-svn: 66339
      12da8ce3
  6. Mar 06, 2009
  7. Mar 05, 2009
  8. Mar 04, 2009
  9. Mar 03, 2009
  10. Mar 02, 2009
    • Nate Begeman's avatar
      Fix a problem with DAGCombine on 64b targets where folding · a9e98122
      Nate Begeman authored
      extracts + build_vector into a shuffle would fail, because the
      type of the new build_vector would not be legal.  Try harder to
      create a legal build_vector type.  Note: this will be totally 
      irrelevant once vector_shuffle no longer takes a build_vector for
      shuffle mask.
      
      New:
      _foo:
      	xorps	%xmm0, %xmm0
      	xorps	%xmm1, %xmm1
      	subps	%xmm1, %xmm1
      	mulps	%xmm0, %xmm1
      	addps	%xmm0, %xmm1
      	movaps	%xmm1, 0
      
      Old:
      _foo:
      	xorps	%xmm0, %xmm0
      	movss	%xmm0, %xmm1
      	xorps	%xmm2, %xmm2
      	unpcklps	%xmm1, %xmm2
      	pshufd	$80, %xmm1, %xmm1
      	unpcklps	%xmm1, %xmm2
      	pslldq	$16, %xmm2
      	pshufd	$57, %xmm2, %xmm1
      	subps	%xmm0, %xmm1
      	mulps	%xmm0, %xmm1
      	addps	%xmm0, %xmm1
      	movaps	%xmm1, 0
      
      llvm-svn: 65791
      a9e98122
  11. Mar 01, 2009
Loading