[llvm-bugs] [Bug 38917] New: Failure to hoist repeated vextractf128 from switch cases
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Sep 12 11:27:25 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=38917
Bug ID: 38917
Summary: Failure to hoist repeated vextractf128 from switch
cases
Product: new-bugs
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: llvm-dev at redking.me.uk
CC: llvm-bugs at lists.llvm.org
Simplified (masked store style) example:
https://gcc.godbolt.org/z/g7URz3
void store07(__m256i a, __m256i v, int *f) {
switch(_mm256_movemask_ps(a)) {
case 0xff:
f[7] = _mm256_extract_epi32(v, 7);
case 0x7f:
f[6] = _mm256_extract_epi32(v, 6);
case 0x3f:
f[5] = _mm256_extract_epi32(v, 5);
case 0x1f:
f[4] = _mm256_extract_epi32(v, 4);
case 0x0f:
f[3] = _mm256_extract_epi32(v, 3);
case 0x07:
f[2] = _mm256_extract_epi32(v, 2);
case 0x03:
f[1] = _mm256_extract_epi32(v, 1);
case 0x01:
f[0] = _mm256_extract_epi32(v, 0);
break;
}
}
_Z7store07Dv4_xS_Pi: # @_Z7store07Dv4_xS_Pi
vmovmskps %ymm0, %eax
cmpl $62, %eax
jg .LBB0_3
decl %eax
cmpl $30, %eax
ja .LBB0_14
jmpq *.LJTI0_0(,%rax,8)
.LBB0_3:
cmpl $63, %eax
je .LBB0_8
cmpl $255, %eax
je .LBB0_6
cmpl $127, %eax
je .LBB0_7
.LBB0_14:
retq
.LBB0_6:
vextractf128 $1, %ymm1, %xmm0
vextractps $3, %xmm0, 28(%rdi)
.LBB0_7:
vextractf128 $1, %ymm1, %xmm0
vextractps $2, %xmm0, 24(%rdi)
.LBB0_8:
vextractf128 $1, %ymm1, %xmm0
vextractps $1, %xmm0, 20(%rdi)
.LBB0_9:
vextractf128 $1, %ymm1, %xmm0
vmovss %xmm0, 16(%rdi)
.LBB0_10:
vextractps $3, %xmm1, 12(%rdi)
.LBB0_11:
vextractps $2, %xmm1, 8(%rdi)
.LBB0_12:
vextractps $1, %xmm1, 4(%rdi)
.LBB0_13:
vmovss %xmm1, (%rdi)
retq
Shouldn't CSE be able to hoist the repeated vextractf128 instructions out from
the switch cases?
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180912/e61dbd56/attachment.html>
More information about the llvm-bugs
mailing list