[llvm-bugs] [Bug 35162] New: [inline asm] Add -print-schedule scheduling comments to inline asm

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 1 12:41:09 PDT 2017


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

            Bug ID: 35162
           Summary: [inline asm] Add -print-schedule scheduling comments
                    to inline asm
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: andrew.v.tischenko at gmail.com, craig.topper at gmail.com,
                    gadi.haber at intel.com, llvm-bugs at lists.llvm.org,
                    spatel+llvm at rotateright.com, zvi.rackover at intel.com

As part of increasing scheduler model test coverage it would be very useful to
be get scheduling comments on ir instructions from inline asm:

define i64 @test_bsr64(i64 %a0, i64 *%a1) nounwind {
  %1 = tail call i64 asm "bsr $1, $0", "=r,r"(i64 %a0) nounwind
  %2 = tail call i64 asm "bsr $1, $0", "=r,*m"(i64 *%a1) nounwind
  %3 = or i64 %1, %2
  ret i64 %3
}

define i64 @test_bswap64(i64 %a0) nounwind {
  %1 = tail call i64 asm "bswap $0", "=r,0"(i64 %a0) nounwind
  ret i64 %1
}

Interestingly the bswap case succeeds but the bsr cases fail:


llc -mtriple=x86_64-unknown -mcpu=btver2 -print-schedule

test_bsr64:                             # @test_bsr64
# BB#0:
        #APP
        bsrq    (%rsi), %rax
        #NO_APP
        #APP
        bsrq    %rdi, %rcx
        #NO_APP
        orq     %rcx, %rax              #  sched: [1:0.50]
        retq                            #  sched: [4:1.00]

test_bswap64:                           # @test_bswap64
# BB#0:
        bswapq  %rdi                    #  sched: [1:0.50]
        movq    %rdi, %rax              #  sched: [1:0.17]
        retq                            #  sched: [4:1.00]

-- 
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/20171101/e2e899bb/attachment.html>


More information about the llvm-bugs mailing list