[PATCH] D81682: [PGO] Extend the value profile buckets for mem op sizes.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 16:19:12 PDT 2020


MaskRay reopened this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

Chatted with @yamauchi in another channel. Reverted in 27650ec5541cd604a5027ad63895e0badfd35efe <https://reviews.llvm.org/rG27650ec5541cd604a5027ad63895e0badfd35efe>

It caused `__llvm_profile_instrument_range` related crash in PGO-instrumented clang (on many source files):

    1│ Dump of assembler code for function __llvm_profile_instrument_target:
    2│    0x000055555dba0820 <+0>:     push   %rbp
    3│    0x000055555dba0821 <+1>:     mov    %rsp,%rbp
    4│    0x000055555dba0824 <+4>:     push   %r15
    5│    0x000055555dba0826 <+6>:     push   %r14
    6│    0x000055555dba0828 <+8>:     push   %r12
    7│    0x000055555dba082a <+10>:    push   %rbx
    8│    0x000055555dba082b <+11>:    test   %rsi,%rsi
    9│    0x000055555dba082e <+14>:    je     0x55555dba098c <__llvm_profile_instrument_target+364>
   10│    0x000055555dba0834 <+20>:    mov    %edx,%r14d
   11│    0x000055555dba0837 <+23>:    mov    %rsi,%rbx
   12│    0x000055555dba083a <+26>:    mov    %rdi,%r15
   13│    0x000055555dba083d <+29>:    mov    0x20(%rsi),%r12
   14│    0x000055555dba0841 <+33>:    test   %r12,%r12
   15│    0x000055555dba0844 <+36>:    je     0x55555dba08bd <__llvm_profile_instrument_target+157>
   16│    0x000055555dba0846 <+38>:    mov    %r14d,%r14d
   17│    0x000055555dba0849 <+41>:    mov    (%r12,%r14,8),%rsi
   18│    0x000055555dba084d <+45>:    test   %rsi,%rsi
   19│    0x000055555dba0850 <+48>:    je     0x55555dba091a <__llvm_profile_instrument_target+250>
   20│    0x000055555dba0856 <+54>:    mov    $0xffffffffffffffff,%rdx
   21│    0x000055555dba085d <+61>:    xor    %ecx,%ecx
   22│    0x000055555dba085f <+63>:    xor    %eax,%eax
   23│    0x000055555dba0861 <+65>:    nopw   %cs:0x0(%rax,%rax,1)
   24│    0x000055555dba086b <+75>:    nopl   0x0(%rax,%rax,1)
   25│    0x000055555dba0870 <+80>:    mov    %rsi,%rbx
   26│    0x000055555dba0873 <+83>:    mov    0x8(%rsi),%rsi    ####### %rsi=-1 on this line
   27│    0x000055555dba0877 <+87>:    cmp    %r15,(%rbx)
   28│    0x000055555dba087a <+90>:    je     0x55555dba0976 <__llvm_profile_instrument_target+342>
   29│    0x000055555dba0880 <+96>:    cmp    %rdx,%rsi
   30│    0x000055555dba0883 <+99>:    cmovb  %rbx,%rax
   31│    0x000055555dba0887 <+103>:   cmovb  %rsi,%rdx
   32│    0x000055555dba088b <+107>:   add    $0x1,%cl
   33│    0x000055555dba088e <+110>:   mov    0x10(%rbx),%rsi
   34│    0x000055555dba0892 <+114>:   test   %rsi,%rsi
   35│    0x000055555dba0895 <+117>:   jne    0x55555dba0870 <__llvm_profile_instrument_target+80>
   36│    0x000055555dba0897 <+119>:   movzbl %cl,%ecx
   37│    0x000055555dba089a <+122>:   cmp    %ecx,0x6cffac(%rip)        # 0x55555e27084c <VPMaxNumValsPerSite>
  ** Dump of assembler code for function __llvm_profile_instrument_target: (55555dba0820 - 55555dba0a37) **                                                                                                                               
  (gdb) i r rsi
  rsi            0xffffffffffffffff  -1
  (gdb) 



  (gdb) bt
  #0  0x000055555dba0873 in __llvm_profile_instrument_target ()
  #1  0x000055555d88de3f in llvm::APInt::udiv(llvm::APInt const&) const ()
  #2  0x000055555d2e203d in getRangeForAffineARHelper(llvm::APInt, llvm::ConstantRange const&, llvm::APInt const&, unsigned int, bool) ()
  #3  0x000055555d2e1585 in llvm::ScalarEvolution::getRangeForAffineAR(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV const*, unsigned int) ()
  #4  0x000055555d2dfc38 in llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) ()


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81682/new/

https://reviews.llvm.org/D81682





More information about the llvm-commits mailing list