Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Transforms/SLPVectorizer/X86/vectorize-widest-phis.ll
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py | ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py | ||||
; RUN: opt -slp-vectorizer -S -mcpu=cascadelake -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s | ; RUN: opt -slp-vectorizer -S -mcpu=cascadelake -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s | ||||
define void @foo() { | define void @foo() { | ||||
; CHECK-LABEL: @foo( | ; CHECK-LABEL: @foo( | ||||
; CHECK-NEXT: entry: | ; CHECK-NEXT: entry: | ||||
; CHECK-NEXT: [[CONV:%.*]] = uitofp i16 undef to float | ; CHECK-NEXT: [[CONV:%.*]] = uitofp i16 undef to float | ||||
; CHECK-NEXT: [[SUB:%.*]] = fsub float 6.553500e+04, undef | ; CHECK-NEXT: [[SUB:%.*]] = fsub float 6.553500e+04, undef | ||||
; CHECK-NEXT: br label [[BB1:%.*]] | ; CHECK-NEXT: br label [[BB1:%.*]] | ||||
; CHECK: bb1: | ; CHECK: bb1: | ||||
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> poison, float [[SUB]], i32 0 | ; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> poison, float [[SUB]], i32 0 | ||||
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x float> [[TMP0]], float [[CONV]], i32 1 | ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x float> [[TMP0]], float [[CONV]], i32 1 | ||||
; CHECK-NEXT: br label [[BB2:%.*]] | ; CHECK-NEXT: br label [[BB2:%.*]] | ||||
; CHECK: bb2: | ; CHECK: bb2: | ||||
; CHECK-NEXT: [[TMP2:%.*]] = phi <4 x float> [ [[TMP1]], [[BB1]] ], [ [[TMP18:%.*]], [[BB3:%.*]] ] | ; CHECK-NEXT: [[TMP2:%.*]] = phi <4 x float> [ [[TMP1]], [[BB1]] ], [ [[TMP14:%.*]], [[BB3:%.*]] ] | ||||
; CHECK-NEXT: [[TMP3:%.*]] = load double, double* undef, align 8 | ; CHECK-NEXT: [[TMP3:%.*]] = load double, double* undef, align 8 | ||||
; CHECK-NEXT: br i1 undef, label [[BB3]], label [[BB4:%.*]] | ; CHECK-NEXT: br i1 undef, label [[BB3]], label [[BB4:%.*]] | ||||
; CHECK: bb4: | ; CHECK: bb4: | ||||
; CHECK-NEXT: [[CONV2:%.*]] = uitofp i16 undef to double | ; CHECK-NEXT: [[CONV2:%.*]] = uitofp i16 undef to double | ||||
; CHECK-NEXT: [[TMP4:%.*]] = fpext <4 x float> [[TMP2]] to <4 x double> | ; CHECK-NEXT: [[TMP4:%.*]] = fpext <4 x float> [[TMP2]] to <4 x double> | ||||
; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x double> <double undef, double poison>, double [[TMP3]], i32 1 | ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x double> <double undef, double poison>, double [[TMP3]], i32 1 | ||||
; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> <double undef, double poison>, double [[CONV2]], i32 1 | ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> <double undef, double poison>, double [[CONV2]], i32 1 | ||||
; CHECK-NEXT: [[TMP7:%.*]] = fsub <2 x double> [[TMP5]], [[TMP6]] | ; CHECK-NEXT: [[TMP7:%.*]] = fsub <2 x double> [[TMP5]], [[TMP6]] | ||||
; CHECK-NEXT: [[TMP8:%.*]] = fadd <2 x double> [[TMP5]], [[TMP6]] | ; CHECK-NEXT: [[TMP8:%.*]] = fadd <2 x double> [[TMP5]], [[TMP6]] | ||||
; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <2 x double> [[TMP7]], <2 x double> [[TMP8]], <2 x i32> <i32 0, i32 3> | ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <2 x double> [[TMP7]], <2 x double> [[TMP8]], <2 x i32> <i32 0, i32 3> | ||||
; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x double> [[TMP9]], i32 0 | ; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <2 x double> [[TMP9]], <2 x double> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> | ||||
; CHECK-NEXT: [[TMP11:%.*]] = insertelement <4 x double> poison, double [[TMP10]], i32 0 | ; CHECK-NEXT: [[TMP11:%.*]] = fcmp ogt <4 x double> [[TMP10]], [[TMP4]] | ||||
; CHECK-NEXT: [[TMP12:%.*]] = extractelement <2 x double> [[TMP9]], i32 1 | ; CHECK-NEXT: [[TMP12:%.*]] = fptrunc <4 x double> [[TMP10]] to <4 x float> | ||||
; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x double> [[TMP11]], double [[TMP12]], i32 1 | ; CHECK-NEXT: [[TMP13:%.*]] = select <4 x i1> [[TMP11]], <4 x float> [[TMP2]], <4 x float> [[TMP12]] | ||||
; CHECK-NEXT: [[TMP14:%.*]] = fcmp ogt <4 x double> [[TMP13]], [[TMP4]] | |||||
; CHECK-NEXT: [[TMP15:%.*]] = shufflevector <2 x double> [[TMP9]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef> | |||||
; CHECK-NEXT: [[TMP16:%.*]] = fptrunc <4 x double> [[TMP15]] to <4 x float> | |||||
; CHECK-NEXT: [[TMP17:%.*]] = select <4 x i1> [[TMP14]], <4 x float> [[TMP2]], <4 x float> [[TMP16]] | |||||
; CHECK-NEXT: br label [[BB3]] | ; CHECK-NEXT: br label [[BB3]] | ||||
; CHECK: bb3: | ; CHECK: bb3: | ||||
; CHECK-NEXT: [[TMP18]] = phi <4 x float> [ [[TMP17]], [[BB4]] ], [ [[TMP2]], [[BB2]] ] | ; CHECK-NEXT: [[TMP14]] = phi <4 x float> [ [[TMP13]], [[BB4]] ], [ [[TMP2]], [[BB2]] ] | ||||
; CHECK-NEXT: br label [[BB2]] | ; CHECK-NEXT: br label [[BB2]] | ||||
; | ; | ||||
entry: | entry: | ||||
%conv = uitofp i16 undef to float | %conv = uitofp i16 undef to float | ||||
%sub = fsub float 6.553500e+04, undef | %sub = fsub float 6.553500e+04, undef | ||||
br label %bb1 | br label %bb1 | ||||
bb1: | bb1: | ||||
Show All 39 Lines |