llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

AVX-512 Not optimal lowering for mask_blend intrinsics.

Open igor-breger opened this issue 9 years ago • 2 comments

Bugzilla Link 31534
Resolution FIXED
Resolved on Jan 13, 2017 03:07
Version trunk
OS All
CC @delena,@igor-breger,@RKSimon,@ZviRackover

Extended Description

In case mask is constant mask_blend intrinsic generate not optimal sequence. It should generate vpblendm instruction.

__m512i test_mm512_mask_blend_epi32(__m512i __A, __m512i __W) { return _mm512_mask_blend_epi32(0xaaaa,__A,__W); }

define <8 x i64> @​test_mm512_mask_blend_epi32(<8 x i64> %__A, <8 x i64> %__W) local_unnamed_addr #​0 { entry: %0 = bitcast <8 x i64> %__W to <16 x i32> %1 = bitcast <8 x i64> %__A to <16 x i32> %2 = shufflevector <16 x i32> %0, <16 x i32> %1, <16 x i32> <i32 16, i32 1, i32 18, i32 3, i32 20, i32 5, i32 22, i32 7, i32 24, i32 9, i32 26, i32 11, i32 28, i32 13, i32 30, i32 15> %3 = bitcast <16 x i32> %2 to <8 x i64> ret <8 x i64> %3 }

BB#0: # %entry

vmovdqa32	.LCPI2_0(%rip), %zmm2 # zmm2 = [0,17,2,19,4,21,6,23,8,25,10,27,12,29,14,31]
vpermt2d	%zmm1, %zmm2, %zmm0
retq

.Lfunc_end2:

igor-breger avatar Jan 04 '17 16:01 igor-breger

Fix - Committed r291888.

llvmbot avatar Jan 13 '17 11:01 llvmbot

Hi , I added new pattern for the shuffle to blend for AVX512 you can find more information in the https://reviews.llvm.org/D28483

Regards, Michael Zuckerman

llvmbot avatar Jan 12 '17 11:01 llvmbot