https://llvm.org/bugs/show_bug.cgi?id=27780
Bug ID: 27780
Summary: Inverted masks can be used for better codegen
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: X86
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Given this IR:
define <32 x i8> @constant_pblendvb_avx2(<32 x i8> %xyzw, <32 x i8> %abcd) {
entry:
%select = select <32 x i1> <i1 false, i1 false, i1 true, i1 false, i1 true,
i1 true, i1 true, i1 false, i1 false, i1 false, i1 true, i1 false, i1 true, i1
true, i1 true, i1 false, i1 false, i1 false, i1 true, i1 false, i1 true, i1
true, i1 true, i1 false, i1 false, i1 false, i1 true, i1 false, i1 true, i1
true, i1 true, i1 false>, <32 x i8> %xyzw, <32 x i8> %abcd
ret <32 x i8> %select
}
Up until r269676, with SSH4.1, we used to lower to:
movdqa %xmm0, %xmm4
movaps {{.*#+}} xmm0 = [255,255,0,255,0,0,0,255,255,255,0,255,0,0,0,255]
pblendvb %xmm2, %xmm4
pblendvb %xmm3, %xmm1
movdqa %xmm4, %xmm0
Now, we lower it to:
movdqa %xmm0, %xmm4
movaps {{.*#+}} xmm0 = [0,0,255,0,255,255,255,0,0,0,255,0,255,255,255,0]
pblendvb %xmm4, %xmm2
pblendvb %xmm1, %xmm3
movdqa %xmm2, %xmm0
movdqa %xmm3, %xmm1
This isn't directly related to r269676, it's just that the CG got lucky before.
The underlying issue is that when the output of the blend is constrained (in
this case, because the function's return value must live in xmm0 and xmm1) we
could invert the mask to avoid a copy.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs