mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-20 04:15:53 +00:00

In SLPVectorizer, the vector build instructions (insertvalue for aggregate type) is passed to BoUpSLP.buildTree, it is treated as UserIgnoreList, so later in cost estimation, the cost of these instructions are not counted. For aggregate value, later usage are more likely to be done in scalar registers, either used as individual scalars or used as a whole for function call or return value. Ignore scalar extraction instructions may cause too aggressive vectorization for aggregate values, and slow down performance. So for vectorization of aggregate value, the scalar extraction instructions are required in cost estimation. Differential Revision: https://reviews.llvm.org/D41139 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320736 91177308-0d34-0410-b5e6-96231b3b80d8
20 lines
608 B
LLVM
20 lines
608 B
LLVM
; RUN: opt -S -mtriple=powerpc64-linux-gnu -mcpu=pwr9 -mattr=+vsx -slp-vectorizer < %s | FileCheck %s
|
|
|
|
%struct.S = type { i8*, i8* }
|
|
|
|
@kS0 = common global %struct.S zeroinitializer, align 8
|
|
|
|
define { i64, i64 } @getS() {
|
|
entry:
|
|
%0 = load i64, i64* bitcast (%struct.S* @kS0 to i64*), align 8
|
|
%1 = load i64, i64* bitcast (i8** getelementptr inbounds (%struct.S, %struct.S* @kS0, i64 0, i32 1) to i64*), align 8
|
|
%2 = insertvalue { i64, i64 } undef, i64 %0, 0
|
|
%3 = insertvalue { i64, i64 } %2, i64 %1, 1
|
|
ret { i64, i64 } %3
|
|
}
|
|
|
|
; CHECK: load i64
|
|
; CHECK-NOT: load <2 x i64>
|
|
; CHECK-NOT: extractelement
|
|
|