[PATCH] D17289: [X86] Fix False Data Dependency in popcnt

Steven Noonan via llvm-commits llvm-commits at lists.llvm.org
Sun May 1 10:47:29 PDT 2016


tycho requested changes to this revision.
tycho added a reviewer: tycho.
tycho added a comment.

Also I just tested the current patch revision. There's an error in how it is checking whether the destination register is used as the input. The input of popcnt can be a memory location, and the destination register may be part of the address calculation:

  200:   48 31 f6                xor    %rsi,%rsi          # clobbered rsi
  203:   f3 49 0f b8 34 f4       popcnt (%r12,%rsi,8),%rsi # oops, used rsi
  209:   48 01 de                add    %rbx,%rsi
  20c:   8d 7a fd                lea    -0x3(%rdx),%edi
  20f:   48 31 ff                xor    %rdi,%rdi          # clobbered rdi
  212:   f3 49 0f b8 3c fc       popcnt (%r12,%rdi,8),%rdi # oops, used rdi
  218:   48 01 f7                add    %rsi,%rdi
  21b:   8d 72 fe                lea    -0x2(%rdx),%esi
  21e:   48 31 f6                xor    %rsi,%rsi          # clobbered rsi
  221:   f3 49 0f b8 34 f4       popcnt (%r12,%rsi,8),%rsi # oops, used rsi
  227:   48 01 fe                add    %rdi,%rsi
  22a:   8d 7a ff                lea    -0x1(%rdx),%edi
  22d:   48 31 db                xor    %rbx,%rbx          # ok
  230:   f3 49 0f b8 1c fc       popcnt (%r12,%rdi,8),%rbx # ok


Repository:
  rL LLVM

http://reviews.llvm.org/D17289





More information about the llvm-commits mailing list