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: unassignedb...@nondot.org
          Reporter: matthew.arsena...@amd.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to