[PATCH] D57059: [SLP] Initial support for the vectorization of the non-power-of-2 vectors.

Valeriy Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 10:51:19 PST 2019


vdmitrie added a comment.

There is still problem with extracts. 
This case shows it:
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.S = type { [3 x float], [3 x float], [4 x float] }

define i32 @foo(i32 %0, i32* %1, float* %2)  {

  %t4 = alloca %struct.S, align 8
  %t8 = getelementptr inbounds %struct.S, %struct.S* %t4, i64 0, i32 1
  %t9 = getelementptr inbounds [3 x float], [3 x float]* %t8, i64 1, i64 0
  %t14 = getelementptr inbounds %struct.S, %struct.S* %t4, i64 0, i32 1, i64 0
  %t11 = getelementptr inbounds %struct.S, %struct.S* %t4, i64 0, i32 1, i64 1
  %t15 = load float, float* %t14, align 4
  %t16 = load float, float* %t11, align 4
  br label %t37

t37:

  %t18 = phi float [ %t16, %3 ], [ %x24, %t37 ]
  %t19 = phi float [ %t15, %3 ], [ %x23, %t37 ]
  %t20 = fdiv fast float 1.000000e+00, %t19
  %t24 = fdiv fast float 1.000000e+00, %t18
  %t21 = getelementptr inbounds %struct.S, %struct.S* %t4, i64 0, i32 2, i64 0
  %t25 = getelementptr inbounds %struct.S, %struct.S* %t4, i64 0, i32 2, i64 1
  %t31 = getelementptr inbounds %struct.S, %struct.S* %t4, i64 0, i32 2, i64 2
  %t33 = getelementptr inbounds %struct.S, %struct.S* %t4, i64 0, i32 2, i64 3
  store float %t20, float* %t21, align 4
  store float %t24, float* %t25, align 4
  store float %t24, float* %t31, align 4
  store float %t24, float* %t33, align 4
  %t88 = bitcast float* %t9 to <2 x float>*
  %t89 = load <2 x float>, <2 x float>* %t88, align 4
  %x23 = extractelement <2 x float> %t89, i32 0
  %x24 = extractelement <2 x float> %t89, i32 1
  br i1 undef, label %t37, label %t55

t55:

  ret i32 0

}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57059





More information about the llvm-commits mailing list