<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Performance regression saw after https://reviews.llvm.org/D107998"
href="https://bugs.llvm.org/show_bug.cgi?id=51540">51540</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Performance regression saw after https://reviews.llvm.org/D107998
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>wmi@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=25169" name="attach_25169" title="testcase 1.cc">attachment 25169</a> <a href="attachment.cgi?id=25169&action=edit" title="testcase 1.cc">[details]</a></span>
testcase 1.cc
We have seen ~10% performance regression on two of our internal microbenchmark
on x86-64. Here is a small testcase to reproduce it.
clang-with-D107998 -O3 -fexperimental-new-pass-manager -std=c++17
-fsized-deallocation -msse4.2 -fno-omit-frame-pointer -S 1.cc -o 1.s
clang-without-D107998 -O3 -fexperimental-new-pass-manager -std=c++17
-fsized-deallocation -msse4.2 -fno-omit-frame-pointer -S 1.cc -o 2.s
Look at the first block in the loop in function _Z1rv. 1.s has 20 instructions
while 2.s has 16 instructions.
1.s
.LBB1_1: # =>This Inner Loop Header: Depth=1
movq %r15, %rbx
shrq $2, %rbx
movq %r15, %rcx
#APP
andl $3, %ecx
#NO_APP
setne %dl
leaq 1(%rcx), %rsi
movswq f(%r15,%r15), %rax
movzbl (%r14,%rbx), %r15d
addq $2, %rbx
movzbl (%r14,%rcx), %edi
testb %dl, %dl
cmovneq %rdi, %r15
testb %dl, %dl
cmovneq %rsi, %rbx
#APP
#NO_APP
movzbl %al, %r12d
movl f(,%rcx,4), %ecx
andl q(%rip), %ecx
movq %rax, %r13
subq %rcx, %r13
jg .LBB1_2
2.s
.LBB1_1: # =>This Inner Loop Header: Depth=1
movswq f(%r14,%r14), %rax
movq %r14, %rcx
shrq $2, %rcx
#APP
andl $3, %r14d
#NO_APP
movzbl (%r15,%rcx), %ebx
movzbl (%r15,%r14), %edx
cmovneq %rdx, %rbx
leaq 1(%r15,%r14), %rsi
leaq 2(%r15,%rcx), %r15
cmovneq %rsi, %r15
#APP
#NO_APP
movzbl %al, %r12d
movl f(,%r14,4), %ecx
andl q(%rip), %ecx
movq %rax, %r14
subq %rcx, %r14
jg .LBB1_2</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>