; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=powerpc64-unknown-gnu-linux < %s | FileCheck %s -check-prefix=CHECK
; RUN: llc -mtriple=powerpc-unknown-gnu-linux < %s | FileCheck %s -check-prefix=CHECKBE

define i32 @xe_migrate_copy(ptr %m, ptr %dst, ptr %tile, ptr %0, ptr %primary_gt, i1 %tobool4, i1 %tobool9, i64 %1, i32 %conv55, i1 %tobool37.not) nounwind {
; CHECK-LABEL: xe_migrate_copy:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    mflr 0
; CHECK-NEXT:    stdu 1, -128(1)
; CHECK-NEXT:    lbz 4, 255(1)
; CHECK-NEXT:    andi. 4, 4, 1
; CHECK-NEXT:    std 0, 144(1)
; CHECK-NEXT:    crmove 20, 1
; CHECK-NEXT:    andi. 4, 9, 1
; CHECK-NEXT:    lwz 9, 244(1)
; CHECK-NEXT:    crmove 21, 1
; CHECK-NEXT:    andi. 4, 8, 1
; CHECK-NEXT:    li 4, 0
; CHECK-NEXT:    std 4, 112(1)
; CHECK-NEXT:    crandc 21, 21, 20
; CHECK-NEXT:    bc 12, 21, .LBB0_2
; CHECK-NEXT:  # %bb.1: # %while.body
; CHECK-NEXT:    crand 20, 20, 1
; CHECK-NEXT:    li 8, 0
; CHECK-NEXT:    bc 4, 20, .LBB0_3
; CHECK-NEXT:  .LBB0_2: # %while.body
; CHECK-NEXT:    li 8, 1
; CHECK-NEXT:  .LBB0_3: # %while.body
; CHECK-NEXT:    li 5, 0
; CHECK-NEXT:    li 6, 0
; CHECK-NEXT:    mr 4, 3
; CHECK-NEXT:    li 7, 0
; CHECK-NEXT:    li 10, 0
; CHECK-NEXT:    bl xe_migrate_ccs_copy
; CHECK-NEXT:    nop
; CHECK-NEXT:    addi 1, 1, 128
; CHECK-NEXT:    ld 0, 16(1)
; CHECK-NEXT:    mtlr 0
; CHECK-NEXT:    blr
;
; CHECKBE-LABEL: xe_migrate_copy:
; CHECKBE:       # %bb.0: # %entry
; CHECKBE-NEXT:    mflr 0
; CHECKBE-NEXT:    stwu 1, -32(1)
; CHECKBE-NEXT:    lbz 4, 55(1)
; CHECKBE-NEXT:    li 5, 0
; CHECKBE-NEXT:    stw 0, 36(1)
; CHECKBE-NEXT:    andi. 4, 4, 1
; CHECKBE-NEXT:    crmove 20, 1
; CHECKBE-NEXT:    andi. 4, 9, 1
; CHECKBE-NEXT:    crmove 21, 1
; CHECKBE-NEXT:    andi. 4, 8, 1
; CHECKBE-NEXT:    lwz 4, 48(1)
; CHECKBE-NEXT:    crandc 21, 21, 20
; CHECKBE-NEXT:    stw 5, 24(1)
; CHECKBE-NEXT:    stw 5, 20(1)
; CHECKBE-NEXT:    stw 5, 16(1)
; CHECKBE-NEXT:    stw 4, 12(1)
; CHECKBE-NEXT:    bc 12, 21, .LBB0_2
; CHECKBE-NEXT:  # %bb.1: # %while.body
; CHECKBE-NEXT:    crand 20, 20, 1
; CHECKBE-NEXT:    li 8, 0
; CHECKBE-NEXT:    bc 4, 20, .LBB0_3
; CHECKBE-NEXT:  .LBB0_2: # %while.body
; CHECKBE-NEXT:    li 8, 1
; CHECKBE-NEXT:  .LBB0_3: # %while.body
; CHECKBE-NEXT:    mr 4, 3
; CHECKBE-NEXT:    li 6, 0
; CHECKBE-NEXT:    li 7, 0
; CHECKBE-NEXT:    li 9, 0
; CHECKBE-NEXT:    li 10, 0
; CHECKBE-NEXT:    stw 8, 8(1)
; CHECKBE-NEXT:    bl xe_migrate_ccs_copy
; CHECKBE-NEXT:    lwz 0, 36(1)
; CHECKBE-NEXT:    addi 1, 1, 32
; CHECKBE-NEXT:    mtlr 0
; CHECKBE-NEXT:    blr

entry:
  br label %while.body

while.body:
  %cond53.in = select i1 %tobool37.not, i1 %tobool4, i1 %tobool9
  %call57 = call zeroext i32 @xe_migrate_ccs_copy(ptr noundef %m, ptr noundef %m, i64 0, i1 false, i64 0, i1 %cond53.in, i32 %conv55, i64 0, i1 false)
  ret i32 %call57
}

declare i32 @xe_migrate_ccs_copy(ptr, ptr, i64, i1, i64, i1, i32, i64, i1)
