Previously only the very first gather/buildvector node might be probed for reshuffling of other nodes. But the compiler may do the same for other gather/buildvector nodes too, just need to check the dependency and postpone the emission of the dependent nodes, if the origin nodes were not emitted yet. Part of D110978 Differential Revision: https://reviews.llvm.org/D144958
19 lines
757 B
LLVM
19 lines
757 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=slp-vectorizer -S -o - -mtriple=x86_64-unknown-linux -mcpu=bdver2 -slp-schedule-budget=1 | FileCheck %s
|
|
|
|
define <2 x i8> @g(<2 x i8> %x, <2 x i8> %y) {
|
|
; CHECK-LABEL: @g(
|
|
; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]], <2 x i32> <i32 0, i32 3>
|
|
; CHECK-NEXT: [[TMP2:%.*]] = mul <2 x i8> [[TMP1]], [[TMP1]]
|
|
; CHECK-NEXT: ret <2 x i8> [[TMP2]]
|
|
;
|
|
%x0 = extractelement <2 x i8> %x, i32 0
|
|
%y1 = extractelement <2 x i8> %y, i32 1
|
|
%x0x0 = mul i8 %x0, %x0
|
|
%y1y1 = mul i8 %y1, %y1
|
|
%ins1 = insertelement <2 x i8> undef, i8 %x0x0, i32 0
|
|
%ins2 = insertelement <2 x i8> %ins1, i8 %y1y1, i32 1
|
|
ret <2 x i8> %ins2
|
|
}
|
|
|