[llvm-bugs] [Bug 47494] New: [IR] Suboptimal vector code
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Sep 11 06:43:45 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=47494
Bug ID: 47494
Summary: [IR] Suboptimal vector code
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: david.bolvansky at gmail.com
CC: llvm-bugs at lists.llvm.org
void test(int* restrict r, int* restrict a){
for (int i = 0; i < 16; i++){
r[i] += r[i+1];
}
}
Clang -O3 -mavx2:
test: # @test
vmovdqu ymm0, ymmword ptr [rdi]
vmovdqu ymm1, ymmword ptr [rdi + 32]
vperm2i128 ymm2, ymm0, ymm1, 33 # ymm2 = ymm0[2,3],ymm1[0,1]
vpalignr ymm2, ymm2, ymm0, 4 # ymm2 =
ymm0[4,5,6,7,8,9,10,11,12,13,14,15],ymm2[0,1,2,3],ymm0[20,21,22,23,24,25,26,27,28,29,30,31],ymm2[16,17,18,19]
vpaddd ymm0, ymm0, ymm2
vmovdqu ymmword ptr [rdi], ymm0
vmovdqu xmm0, xmmword ptr [rdi + 48]
vpshufd xmm2, xmm0, 249 # xmm2 = xmm0[1,2,3,3]
vpinsrd xmm2, xmm2, dword ptr [rdi + 64], 3
vpalignr xmm0, xmm0, xmmword ptr [rdi + 32], 4 # xmm0 =
mem[4,5,6,7,8,9,10,11,12,13,14,15],xmm0[0,1,2,3]
vinserti128 ymm0, ymm0, xmm2, 1
vpaddd ymm0, ymm1, ymm0
vmovdqu ymmword ptr [rdi + 32], ymm0
vzeroupper
ret
ICC -O3 -mavx2:
test:
vmovdqu ymm0, YMMWORD PTR [rdi] #4.10
vmovdqu ymm2, YMMWORD PTR [32+rdi] #4.10
vpaddd ymm1, ymm0, YMMWORD PTR [4+rdi] #4.10
vpaddd ymm3, ymm2, YMMWORD PTR [36+rdi] #4.10
vmovdqu YMMWORD PTR [rdi], ymm1 #4.10
vmovdqu YMMWORD PTR [32+rdi], ymm3 #4.10
vzeroupper #6.1
ret #6.1
--
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/20200911/86cab9da/attachment.html>
More information about the llvm-bugs
mailing list