Skip to content

[inline asm] Add -print-schedule scheduling comments to inline asm #34510

Closed
@RKSimon

Description

@RKSimon
Bugzilla Link 35162
Resolution FIXED
Resolved on Nov 19, 2017 06:13
Version unspecified
OS Windows NT
Blocks #31672
CC @adibiagio,@topperc,@efriedma-quic,@rotateright,@ZviRackover
Fixed by commit(s) 317782

Extended Description

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions