[llvm-bugs] [Bug 28765] New: Post-RA scheduler moves code across asm sideeffect

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 28 21:05:42 PDT 2016


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

            Bug ID: 28765
           Summary: Post-RA scheduler moves code across asm sideeffect
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: Matthew.Arsenault at amd.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

define void @loop(i32 addrspace(1)* %arg) nounwind {
bb:
  br label %bb2

bb2:
  %loop.idx = phi i32 [ 0, %bb ], [ %inc, %bb2 ]
  call void asm sideeffect "
    v_nop_e64
    v_nop_e64", ""()
  %inc = add nsw i32 %loop.idx, 1
  %cmp = icmp slt i32 %inc, 10
  br i1 %cmp, label %bb2, label %bb3 ; -

bb3:
  ret void
}

llc -march=amdgcn on this testcase shows the add and compare are moved before
the inlineasm by the post-RA scheduler:


BB0_1:                                  ; %bb2
                                        ; =>This Inner Loop Header: Depth=1
    v_add_i32_e32 v0, vcc, 1, v0
    v_cmp_gt_i32_e32 vcc, 10, v0
    ;;#ASMSTART

    v_nop_e64
    v_nop_e64
    ;;#ASMEND
    s_and_b64 vcc, exec, vcc
    s_cbranch_vccnz BB0_1

-- 
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/20160729/2c698b46/attachment-0001.html>


More information about the llvm-bugs mailing list