[llvm-bugs] [Bug 42935] New: [X86] znver missing cmpxchg8b feature, resulting in expanded atomicrmw

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 8 09:32:51 PDT 2019


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

            Bug ID: 42935
           Summary: [X86] znver missing cmpxchg8b feature, resulting in
                    expanded atomicrmw
           Product: libraries
           Version: 9.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: nikita.ppv at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

define i64 @test(i64* %p) {
  %x = atomicrmw sub i64* %p, i64 1 seq_cst 
  ret i64 %x 
} 

Under -mcpu=znver1 results in:

        pushq   %rax
        .cfi_def_cfa_offset 16
        movl    $1, %esi
        movl    $5, %edx
        callq   __atomic_fetch_sub_8
        popq    %rcx
        .cfi_def_cfa_offset 8
        retq

While it should produce a "lock xaddq" instruction.

This issue was introduced in https://reviews.llvm.org/D59576, where the
CMPXCHG8B feature flag was not added to ZNFeatures.

-- 
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/20190808/964a7f9b/attachment.html>


More information about the llvm-bugs mailing list