[llvm-bugs] [Bug 48782] New: llvm.abs ignores prof metadata

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 17 12:06:25 PST 2021


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

            Bug ID: 48782
           Summary: llvm.abs ignores prof metadata
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

LLVM seems to ignore prof metadata for llvm.abs.

int abs(int v) {
    return __builtin_expect(v > 0, 1) ? v : -v;
}

LLVM trunk -O3
abs: # @abs
  mov eax, edi
  neg eax
  cmovl eax, edi
  ret


LLVM 11 -O3
abs: # @abs
  mov eax, edi
  test edi, edi
  js .LBB0_1
  ret
.LBB0_1:
  neg eax
  ret


https://godbolt.org/z/KfzbKd

p.s: same issue for smin/smax/umin/umax?

-- 
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/20210117/3a62cfff/attachment.html>


More information about the llvm-bugs mailing list