[llvm-bugs] [Bug 51540] New: Performance regression saw after https://reviews.llvm.org/D107998

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 19 09:05:20 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51540

            Bug ID: 51540
           Summary: Performance regression saw after
                    https://reviews.llvm.org/D107998
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: wmi at google.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 25169
  --> https://bugs.llvm.org/attachment.cgi?id=25169&action=edit
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

-- 
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/20210819/07e2201d/attachment.html>


More information about the llvm-bugs mailing list