Skip to content
  1. Mar 09, 2008
    • Chris Lattner's avatar
      Fix two problems in SelectionDAGLegalize::ExpandBUILD_VECTOR's handling · 322c826c
      Chris Lattner authored
      of BUILD_VECTORS that only have two unique elements:
      
      1. The previous code was nondeterminstic, because it walked a map in
         SDOperand order, which isn't determinstic.
      2. The previous code didn't handle the case when one element was undef
         very well.  Now we ensure that the generated shuffle mask has the
         undef vector on the RHS (instead of potentially being on the LHS)
         and that any elements that refer to it are themselves undef.  This
         allows us to compile CodeGen/X86/vec_set-9.ll into:
      
      _test3:
      	movd	%rdi, %xmm0
      	punpcklqdq	%xmm0, %xmm0
      	ret
      
      instead of:
      
      _test3:
      	movd	%rdi, %xmm1
      	#IMPLICIT_DEF %xmm0
      	punpcklqdq	%xmm1, %xmm0
      	ret
      
      ... saving a register.
      
      llvm-svn: 48060
      322c826c
    • Chris Lattner's avatar
      Teach SD some vector identities, allowing us to compile vec_set-9 into: · a1f25b00
      Chris Lattner authored
      _test3:
      	movd	%rdi, %xmm1
      	#IMPLICIT_DEF %xmm0
      	punpcklqdq	%xmm1, %xmm0
      	ret
      
      instead of:
      
      _test3:
      	#IMPLICIT_DEF %rax
      	movd	%rax, %xmm0
      	movd	%rdi, %xmm1
      	punpcklqdq	%xmm1, %xmm0
      	ret
      
      This is still not ideal.  There is no reason to two xmm regs.
      
      llvm-svn: 48058
      a1f25b00
  2. Mar 08, 2008
  3. Mar 07, 2008
Loading