brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.1 KiB · 0418ece Raw
190 lines · plain
1# RUN: llc -run-pass=aarch64-expand-pseudo -mtriple=arm64-apple-ios -o - -emit-call-site-info %s -verify-machineinstrs | FileCheck %s2 3--- |4  define void @test_1_callsite_info() {5    ret void6  }7 8  define void @test_bl_pass_x0_arg() {9    ret void10  }11 12  define void @test_bl_pass_x0_x1_x2_args() {13    ret void14  }15 16  define void @test_bl_pass_w0_w1_args() {17    ret void18  }19 20  define void @test_blr_pass_w0_w1_args() {21    ret void22  }23 24  define void @foo(i32 %a) {25    ret void26  }27 28  define void @test_blr_undef_arg_in_x0() {29    ret void30  }31 32  define void @test_no_nop() {33    ret void34  }35 36  declare ptr @attachedcall()37 38  declare ptr @objc_retainAutoreleasedReturnValue()39...40---41 42# CHECK-LABEL: : test_1_callsite_info43# CHECK:       bb.0:44# CHECK-NEXT: liveins:45# CHECK-NEXT: {{  $}}46# CHECK-NEXT:    BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $x0, implicit $sp, implicit $xzr, implicit $fp {47# CHECK-NEXT:      BLR $x0, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x048# CHECK-NEXT:      ORRXrs $xzr, $fp, 049# CHECK-NEXT:      BL @attachedcall, implicit-def $lr, implicit internal $sp50# CHECK-NEXT:   }51# CHECK-NEXT:    RET undef $lr, implicit killed $w052#53name: test_1_callsite_info54callSites:55  - {bb: 0, offset: 0, fwdArgRegs:56    - { arg: 0, reg: '$x0' } }57body:             |58    bb.0:59        liveins: $lr, $x060 61        BLR_RVMARKER @attachedcall, 1, $x0, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x062        RET_ReallyLR implicit killed $w063...64 65# CHECK-LABEL: : test_bl_pass_x0_arg66# CHECK:       bb.0:67# CHECK-NEXT: liveins:68# CHECK-NEXT: {{  $}}69# CHECK-NEXT:     BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $sp, implicit $x0, implicit $xzr, implicit $fp {70# CHECK-NEXT:      BL @foo, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x071# CHECK-NEXT:      $fp = ORRXrs $xzr, $fp, 072# CHECK-NEXT:      BL @attachedcall, implicit-def $lr, implicit internal $sp73# CHECK-NEXT:    }74# CHECK-NEXT:    RET undef $lr, implicit killed $w075#76name: test_bl_pass_x0_arg77body:             |78    bb.0:79        liveins: $lr, $x080 81        BLR_RVMARKER @attachedcall, 1, @foo, $x0, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x082        RET_ReallyLR implicit killed $w083...84 85# CHECK-LABEL: : test_bl_pass_x0_x1_x2_args86# CHECK:       bb.0:87# CHECK-NEXT: liveins:88# CHECK-NEXT: {{  $}}89# CHECK-NEXT:     BUNDLE implicit-def $lr, implicit-def $sp, implicit-def $x0, implicit-def $fp, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $xzr, implicit $fp {90# CHECK-NEXT:      BL @foo, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $x091# CHECK-NEXT:      $fp = ORRXrs $xzr, $fp, 092# CHECK-NEXT:      BL @attachedcall, implicit-def $lr, implicit internal $sp93# CHECK-NEXT:    }94# CHECK-NEXT:    RET undef $lr95#96name: test_bl_pass_x0_x1_x2_args97body:             |98    bb.0:99        liveins: $lr, $x0, $x1, $x2100 101        BLR_RVMARKER @attachedcall, 1, @foo, $x0, $x1, $x2, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $x0102        RET_ReallyLR103...104 105# CHECK-LABEL: : test_bl_pass_w0_w1_args106# CHECK:       bb.0:107# CHECK-NEXT: liveins:108# CHECK-NEXT: {{  $}}109# CHECK-NEXT:     BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $sp, implicit $w0, implicit $w1, implicit $xzr, implicit $fp {110# CHECK-NEXT:      BL @foo, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit $w1, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0111# CHECK-NEXT:      $fp = ORRXrs $xzr, $fp, 0112# CHECK-NEXT:      BL @attachedcall, implicit-def $lr, implicit internal $sp113# CHECK-NEXT:    }114# CHECK-NEXT:    RET undef $lr, implicit killed $w0115#116name: test_bl_pass_w0_w1_args117body:             |118    bb.0:119        liveins: $lr, $w0, $w1120 121        BLR_RVMARKER @attachedcall, 1, @foo, $w0, $w1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0122        RET_ReallyLR implicit killed $w0123...124 125 126# CHECK-LABEL: : test_blr_pass_w0_w1_args127# CHECK:       bb.0:128# CHECK-NEXT: liveins:129# CHECK-NEXT: {{  $}}130# CHECK-NEXT:     BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $x8, implicit $sp, implicit $w0, implicit $w1, implicit $xzr, implicit $fp {131# CHECK-NEXT:      BLR $x8, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit $w1, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0132# CHECK-NEXT:      $fp = ORRXrs $xzr, $fp, 0133# CHECK-NEXT:      BL @attachedcall, implicit-def $lr, implicit internal $sp134# CHECK-NEXT:    }135# CHECK-NEXT:    RET undef $lr, implicit killed $w0136#137name: test_blr_pass_w0_w1_args138body:             |139    bb.0:140        liveins: $lr, $x8, $w0, $w1141 142        BLR_RVMARKER @attachedcall, 1, $x8, $w0, $w1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0143        RET_ReallyLR implicit killed $w0144...145 146# Test for https://github.com/llvm/llvm-project/issues/68005.147#148# CHECK-LABEL: : test_blr_undef_arg_in_x0149# CHECK:       bb.0:150# CHECK-NEXT: liveins:151# CHECK-NEXT: {{  $}}152# CHECK-NEXT:    BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $sp, implicit undef $x0, implicit $xzr, implicit $fp {153# CHECK-NEXT:      BL @foo, csr_darwin_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit undef $x0, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0154# CHECK-NEXT:      $fp = ORRXrs $xzr, $fp, 0155# CHECK-NEXT:      BL @objc_retainAutoreleasedReturnValue, implicit-def $lr, implicit internal $sp156# CHECK-NEXT:    }157# CHECK-NEXT:    RET undef $lr158#159name: test_blr_undef_arg_in_x0160tracksRegLiveness: true161body:             |162  bb.0:163    liveins: $lr164 165    BLR_RVMARKER @objc_retainAutoreleasedReturnValue, 1, @foo, undef $x0, csr_darwin_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0166    RET_ReallyLR167...168 169# CHECK-LABEL: : test_no_nop170# CHECK:       bb.0:171# CHECK-NEXT: liveins:172# CHECK-NEXT: {{  $}}173# CHECK-NEXT:    BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit $x0, implicit $sp {174# CHECK-NEXT:      BLR $x0, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0175# CHECK-NEXT:      BL @attachedcall, implicit-def $lr, implicit internal $sp176# CHECK-NEXT:   }177# CHECK-NEXT:    RET undef $lr, implicit killed $w0178#179name: test_no_nop180callSites:181  - {bb: 0, offset: 0, fwdArgRegs:182    - { arg: 0, reg: '$x0' } }183body:             |184    bb.0:185        liveins: $lr, $x0186 187        BLR_RVMARKER @attachedcall, 0, $x0, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0188        RET_ReallyLR implicit killed $w0189...190