[PATCH] D56082: [X86][SLP] Enable SLP vectorization for 128-bit horizontal X86 instructions (add, sub)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 27 10:53:14 PST 2018


craig.topper added a comment.

I'm concerned about integer types. Without -x86-experimental-vector-widening-legalization we end up promoting v2i32 to v2i64 during type legalization. An X86 specific DAG combine turns some v2i64 operations back to v4i32 based on the result being truncated, but it isn't always able to rearrange the shuffles well.

Changing semi-vec-reg-128bit.ll to use i32 instead of float results in this code instead of phaddd. Even with -mcpu=btver2 which is needed to generate haddps for the float type for this test.

  	vpshufd	$245, %xmm0, %xmm1      # xmm1 = xmm0[1,1,3,3]
  	vpaddd	%xmm1, %xmm0, %xmm0
  	vpshufd	$232, %xmm0, %xmm0      # xmm0 = xmm0[0,2,2,3]
  	vmovq	%xmm0, (%rdi)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56082/new/

https://reviews.llvm.org/D56082





More information about the llvm-commits mailing list