[llvm] [DAG] isSplatValue - node is a splat if all demanded elts have the same whole constant value (PR #74443)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 04:25:08 PST 2023


================
@@ -25,18 +25,20 @@ define <4 x i64> @var_shuffle_v4i64(<4 x i64> %v, <4 x i64> %indices) nounwind {
 ;
 ; AVX1-LABEL: var_shuffle_v4i64:
 ; AVX1:       # %bb.0:
-; AVX1-NEXT:    vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,2,3]
-; AVX1-NEXT:    vpaddq %xmm1, %xmm1, %xmm3
-; AVX1-NEXT:    vextractf128 $1, %ymm1, %xmm1
+; AVX1-NEXT:    vextractf128 $1, %ymm1, %xmm2
----------------
RKSimon wrote:

Its replaced a ymm constant pool entry of `<4 x i64> <i64 2,i64 2,i64 2,i64 2>`, which is then split into 2 xmm folded loads in vpcmpgtq - into a single vmovddup. So increase by 1 instruction (extra line for comment), but replaced 2 xmm folded loads with a single broadcast load.

https://github.com/llvm/llvm-project/pull/74443


More information about the llvm-commits mailing list