https://bugs.llvm.org/show_bug.cgi?id=46393
Bug ID: 46393
Summary: Failure to optimize vpmovsxwd+vpslld properly
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: unassignedb...@nondot.org
Reporter: gabrav...@gmail.com
CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
llvm-...@redking.me.uk, spatel+l...@rotateright.com
typedef int32_t v8i32 __attribute__((vector_size(32)));
v8i32 f(__m128i a, uint8_t u)
{
return __builtin_ia32_pslldi256((v8i32)_mm256_maskz_cvtepi16_epi32(u, a),
16);
}
With -O3 -march=tigerlake, GCC outputs this :
f(long long __vector(2), unsigned char):
kmovb k1, edi
vpmovsxwd ymm0{k1}{z}, xmm0
vpslld ymm0, ymm0, 16
ret
LLVM outputs this :
.LCPI0_0:
.short 16 # 0x10
.short 0 # 0x0
.short 18 # 0x12
.short 1 # 0x1
.short 20 # 0x14
.short 2 # 0x2
.short 22 # 0x16
.short 3 # 0x3
.short 24 # 0x18
.short 4 # 0x4
.short 26 # 0x1a
.short 5 # 0x5
.short 28 # 0x1c
.short 6 # 0x6
.short 30 # 0x1e
.short 7 # 0x7
f(long long __vector(2), unsigned char):
vmovdqa ymm1, ymmword ptr [rip + .LCPI0_0] # ymm1 =
[16,0,18,1,20,2,22,3,24,4,26,5,28,6,30,7]
kmovd k1, edi
vpxor xmm2, xmm2, xmm2
vpermi2w ymm1, ymm0, ymm2
vmovdqa32 ymm0 {k1} {z}, ymm1
ret
I've been incapable of narrowing this down to any specific flag other than
-march=tigerlake.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs