Index: llvm/lib/CodeGen/RegAllocGreedy.cpp =================================================================== --- llvm/lib/CodeGen/RegAllocGreedy.cpp +++ llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -1904,7 +1904,8 @@ const LiveInterval *LI; MCRegister PhysReg; std::tie(LI, PhysReg) = RecolorStack[I]; - Matrix->assign(*LI, PhysReg); + if (!LI->empty() && !MRI->reg_nodbg_empty(LI->reg())) + Matrix->assign(*LI, PhysReg); } // Pop the stack of recoloring attempts. Index: llvm/test/CodeGen/AArch64/regalloc-last-chance-recolor-with-split.mir =================================================================== --- llvm/test/CodeGen/AArch64/regalloc-last-chance-recolor-with-split.mir +++ llvm/test/CodeGen/AArch64/regalloc-last-chance-recolor-with-split.mir @@ -1,11 +1,12 @@ -# RUN: not --crash llc -mattr="+reserve-x28" --run-pass=greedy -verify-machineinstrs %s -o - 2>&1 | FileCheck %s +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py +# RUN: llc -mattr="+reserve-x28" --run-pass=greedy,virtregrewriter -verify-machineinstrs %s -o - | FileCheck %s -# CHECK: Non-empty but used interval +# CHECK-LABEL: ham --- | target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" target triple = "aarch64-none-linux-gnu" - + define void @ham(i8 addrspace(1)* %arg) #0 gc "statepoint-example" { bb: %tmp = call token (i64, i32, i8 addrspace(1)* (i64, i64, i64, i32*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i8i64i64i64p0i32f(i64 2882400000, i32 0, i8 addrspace(1)* (i64, i64, i64, i32*)* nonnull elementtype(i8 addrspace(1)* (i64, i64, i64, i32*)) @bar, i32 4, i32 0, i64 undef, i64 526, i64 2, i32* nonnull undef, i32 0, i32 0) [ "deopt"(i32 0, i32 1, i32 0, i32 42, i32 2, i32 14, i32 0, i32 3, i32 400, i32 3, i32 400, i32 0, i8 addrspace(1)* %arg, i32 7, i8* null, i32 3, i32 95, i32 7, i8* null, i32 3, i32 -11, i32 3, i32 -8280, i32 3, i32 45, i32 3, i32 230, i32 7, i8* null, i32 4, i64 5, i32 7, i8* null, i32 3, i32 1, i32 7, i8* null, i32 7, i8* null), "gc-live"(i8 addrspace(1)* %arg) ] @@ -32,14 +33,14 @@ %tmp21 = trunc i64 %tmp20 to i32 %tmp22 = trunc i64 2 to i32 br i1 undef, label %bb27.preheader, label %bb23 - + bb27.preheader: ; preds = %bb br label %bb27 - + bb23: ; preds = %bb %tmp24 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* nonnull elementtype(void ()) @wombat, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 0, i32 1, i32 0, i32 117, i32 2, i32 14, i32 0, i32 3, i32 3, i32 3, i32 109, i32 0, i8 addrspace(1)* %tmp19, i32 7, i8* null, i32 3, i32 %tmp17, i32 3, i32 %tmp22, i32 3, i32 3, i32 3, i32 -8280, i32 7, i8* null, i32 3, i32 230, i32 7, i8* null, i32 4, i64 5, i32 7, i8* null, i32 3, i32 1, i32 0, i8 addrspace(1)* undef, i32 7, i8* null), "gc-live"(i8 addrspace(1)* %tmp19, i8 addrspace(1)* undef, i8 addrspace(1)* undef) ] unreachable - + bb27: ; preds = %bb115, %bb27.preheader %tmp28 = phi i8 addrspace(1)* addrspace(1)* [ %tmp106, %bb115 ], [ undef, %bb27.preheader ] %tmp29 = phi i8 addrspace(1)* addrspace(1)* [ %tmp107, %bb115 ], [ undef, %bb27.preheader ] @@ -55,10 +56,10 @@ %tmp40 = icmp ne i64 undef, 0 %switch = icmp ult i1 %tmp40, true br i1 %switch, label %bb41, label %bb85 - + bb41: ; preds = %bb27 br i1 undef, label %bb48, label %bb42, !prof !0 - + bb42: ; preds = %bb41 %tmp43 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* nonnull elementtype(void ()) @wombat, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 0, i32 1, i32 0, i32 125, i32 0, i32 14, i32 0, i32 0, i8 addrspace(1)* %tmp19, i32 7, i8* null, i32 3, i32 %tmp17, i32 3, i32 %tmp22, i32 3, i32 undef, i32 3, i32 %tmp38, i32 7, i8* null, i32 3, i32 230, i32 7, i8* null, i32 4, i64 2, i32 7, i8* null, i32 3, i32 undef, i32 0, i8 addrspace(1)* %tmp34, i32 7, i8* null), "gc-live"(i8 addrspace(1)* %tmp33, i8 addrspace(1)* %tmp19, i8 addrspace(1)* %tmp34, i8 addrspace(1)* %tmp32) ] %tmp44 = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %tmp43, i32 2, i32 2) ; (%tmp34, %tmp34) @@ -66,7 +67,7 @@ %tmp46 = getelementptr inbounds i8, i8 addrspace(1)* %tmp44, i64 24 %tmp47 = bitcast i8 addrspace(1)* %tmp46 to i8 addrspace(1)* addrspace(1)* br label %bb48 - + bb48: ; preds = %bb42, %bb41 %tmp49 = phi i8 addrspace(1)* addrspace(1)* [ %tmp28, %bb41 ], [ undef, %bb42 ] %tmp50 = phi i8 addrspace(1)* addrspace(1)* [ %tmp29, %bb41 ], [ %tmp47, %bb42 ] @@ -76,41 +77,41 @@ %tmp54 = phi i8 addrspace(1)* [ %tmp33, %bb41 ], [ undef, %bb42 ] %tmp55 = phi i8 addrspace(1)* [ %tmp34, %bb41 ], [ %tmp44, %bb42 ] br label %bb79 - + bb79: ; preds = %bb79, %bb48 %tmp80 = icmp eq i64 undef, 400 br i1 %tmp80, label %bb81, label %bb79 - + bb81: ; preds = %bb79 store atomic i8 addrspace(1)* null, i8 addrspace(1)* addrspace(1)* %tmp49 unordered, align 8 br i1 undef, label %bb83, label %bb82 - + bb82: ; preds = %bb81 call void @blam.1() #4 br label %bb83 - + bb83: ; preds = %bb82, %bb81 %tmp84 = icmp eq i32 undef, 0 br i1 %tmp84, label %bb105, label %bb96, !prof !0 - + bb85: ; preds = %bb27 br i1 undef, label %bb86, label %bb90 - + bb86: ; preds = %bb85 %tmp87 = add i32 undef, %tmp37 %tmp88 = load atomic i8 addrspace(1)*, i8 addrspace(1)* addrspace(1)* %tmp29 unordered, align 8 %tmp89 = call token (i64, i32, void (i32)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidi32f(i64 2882400000, i32 0, void (i32)* nonnull elementtype(void (i32)) @blam, i32 1, i32 0, i32 10, i32 0, i32 0) [ "deopt"(i32 0, i32 1, i32 0, i32 237, i32 3, i32 14, i32 0, i32 0, i8 addrspace(1)* null, i32 3, i32 undef, i32 3, i32 undef, i32 0, i8 addrspace(1)* null, i32 7, i8* null, i32 7, i32 undef, i32 7, i32 undef, i32 7, i32 undef, i32 7, i32 undef, i32 7, i8* null, i32 7, i32 undef, i32 7, i8* null, i32 7, i64 undef, i32 7, i8* null, i32 7, i32 undef, i32 0, i8 addrspace(1)* null, i32 7, i8* null) ] unreachable - + bb90: ; preds = %bb85 %tmp91 = trunc i64 %tmp39 to i32 %tmp92 = call token (i64, i32, void (i32)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidi32f(i64 2882400000, i32 0, void (i32)* nonnull elementtype(void (i32)) @blam, i32 1, i32 0, i32 12, i32 0, i32 0) [ "deopt"(i32 0, i32 1, i32 0, i32 201, i32 4, i32 14, i32 0, i32 0, i8 addrspace(1)* undef, i32 3, i32 %tmp91, i32 0, i8 addrspace(1)* undef, i32 3, i32 %tmp91, i32 0, i8 addrspace(1)* %tmp19, i32 7, i8* null, i32 3, i32 %tmp17, i32 3, i32 %tmp22, i32 3, i32 undef, i32 3, i32 %tmp38, i32 7, i8* null, i32 3, i32 230, i32 7, i8* null, i32 4, i64 2, i32 7, i8* null, i32 7, i8* null, i32 0, i8 addrspace(1)* %tmp34, i32 7, i8* null), "gc-live"() ] unreachable - + bb94: ; preds = %bb115 %tmp95 = call token (i64, i32, void (i32)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidi32f(i64 2882400000, i32 0, void (i32)* nonnull elementtype(void (i32)) @blam, i32 1, i32 0, i32 10, i32 0, i32 0) [ "deopt"(i32 0, i32 1, i32 0, i32 395, i32 2, i32 14, i32 0, i32 0, i8 addrspace(1)* null, i32 3, i32 0, i32 0, i8 addrspace(1)* null, i32 7, i8* null, i32 7, i32 undef, i32 7, i32 undef, i32 7, i32 undef, i32 7, i32 undef, i32 7, i32 undef, i32 7, i32 undef, i32 7, i32 undef, i32 7, i64 undef, i32 7, i8* null, i32 7, i32 undef, i32 0, i8 addrspace(1)* null, i32 7, i8* null) ] unreachable - + bb96: ; preds = %bb83 %tmp97 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* nonnull elementtype(void ()) @wombat, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 0, i32 1, i32 0, i32 250, i32 0, i32 14, i32 0, i32 0, i8 addrspace(1)* %tmp19, i32 7, i8* null, i32 3, i32 %tmp17, i32 3, i32 %tmp22, i32 3, i32 undef, i32 3, i32 %tmp22, i32 7, i8* null, i32 3, i32 230, i32 7, i8* null, i32 4, i64 0, i32 7, i8* null, i32 3, i32 undef, i32 0, i8 addrspace(1)* %tmp55, i32 7, i8* null), "gc-live"(i8 addrspace(1)* null, i8 addrspace(1)* %tmp19, i8 addrspace(1)* %tmp55, i8 addrspace(1)* %tmp53, i8 addrspace(1)* %tmp54) ] %tmp98 = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %tmp97, i32 2, i32 2) ; (%tmp55, %tmp55) @@ -121,7 +122,7 @@ %tmp103 = getelementptr inbounds i8, i8 addrspace(1)* %tmp100, i64 848 %tmp104 = bitcast i8 addrspace(1)* %tmp103 to i8 addrspace(1)* addrspace(1)* br label %bb105 - + bb105: ; preds = %bb96, %bb83 %tmp106 = phi i8 addrspace(1)* addrspace(1)* [ %tmp49, %bb83 ], [ %tmp104, %bb96 ] %tmp107 = phi i8 addrspace(1)* addrspace(1)* [ %tmp50, %bb83 ], [ %tmp102, %bb96 ] @@ -137,7 +138,7 @@ store atomic i32 %0, i32 addrspace(1)* %1 unordered, align 8 %tmp114 = icmp eq i8 addrspace(1)* %tmp110, null br i1 %tmp114, label %bb120, label %bb115 - + bb115: ; preds = %bb105 %tmp116 = load atomic i32, i32 addrspace(1)* null unordered, align 4 %tmp117 = mul i32 %tmp116, %tmp22 @@ -145,51 +146,51 @@ %tmp118 = add nsw i32 %tmp37, -2 %tmp119 = icmp ugt i64 %tmp36, 107 br i1 %tmp119, label %bb94, label %bb27 - + bb120: ; preds = %bb105 %tmp121 = call anyregcc token (i64, i32, void (i32)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidi32f(i64 2882400000, i32 0, void (i32)* nonnull elementtype(void (i32)) @blam, i32 1, i32 0, i32 10, i32 0, i32 0) [ "deopt"(i32 0, i32 1, i32 0, i32 272, i32 2, i32 14, i32 0, i32 0, i8 addrspace(1)* null, i32 3, i32 %tmp22, i32 0, i8 addrspace(1)* null, i32 7, i8* null, i32 7, i32 undef, i32 7, i32 undef, i32 7, i32 undef, i32 7, i32 undef, i32 7, i8* null, i32 7, i32 undef, i32 7, i8* null, i32 7, i64 undef, i32 7, i8* null, i32 7, i32 undef, i32 0, i8 addrspace(1)* null, i32 7, i8* null) ] unreachable } - + declare i8 addrspace(1)* @barney(i8 addrspace(1)*) #1 - + declare i32 @snork(i8 addrspace(1)*, i32) #1 - + declare void @wobble(i32) #1 - + ; Function Attrs: argmemonly nounwind willreturn declare noalias i8 addrspace(1)* @llvm.orca.alloc.barrier.p1i8.p1i8(i8 addrspace(1)*) #2 - + declare i8 addrspace(1)* @bar(i64, i64, i64, i32*) #1 - + declare void @wombat() #1 - + declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 immarg, i32 immarg, void ()*, i32 immarg, i32 immarg, ...) #1 - + ; Function Attrs: nounwind readnone declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32 immarg, i32 immarg) #3 - + declare token @llvm.experimental.gc.statepoint.p0f_p1i8i64i64i64p0i32f(i64 immarg, i32 immarg, i8 addrspace(1)* (i64, i64, i64, i32*)*, i32 immarg, i32 immarg, ...) #1 - + ; Function Attrs: nounwind readnone declare i8 addrspace(1)* @llvm.experimental.gc.result.p1i8(token) #3 - + declare token @llvm.experimental.gc.statepoint.p0f_p1i8p1i8f(i64 immarg, i32 immarg, i8 addrspace(1)* (i8 addrspace(1)*)*, i32 immarg, i32 immarg, ...) #1 - + declare void @blam(i32) #1 - + declare token @llvm.experimental.gc.statepoint.p0f_isVoidi32f(i64 immarg, i32 immarg, void (i32)*, i32 immarg, i32 immarg, ...) #1 - + declare token @llvm.experimental.gc.statepoint.p0f_i32p1i8i32f(i64 immarg, i32 immarg, i32 (i8 addrspace(1)*, i32)*, i32 immarg, i32 immarg, ...) #1 - + declare void @blam.1() #1 - + attributes #0 = { "frame-pointer"="all" "target-features"="+reserve-x28" } attributes #1 = { "target-features"="+reserve-x28" } attributes #2 = { argmemonly nounwind willreturn "allocation-site" "target-features"="+reserve-x28" } attributes #3 = { nounwind readnone "target-features"="+reserve-x28" } attributes #4 = { cold nounwind "gc-leaf-function" } - + !0 = !{!"branch_weights", i32 983040, i32 1} ... @@ -387,10 +388,243 @@ constants: [] machineFunctionInfo: {} body: | + ; CHECK-LABEL: name: ham + ; CHECK: bb.0.bb: + ; CHECK-NEXT: successors: %bb.1(0x80000000), %bb.2(0x00000000) + ; CHECK-NEXT: liveins: $x0 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: renamable $x19 = COPY $x0 + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: dead $w1 = MOVi32imm 526, implicit-def $x1 + ; CHECK-NEXT: dead $w2 = MOVi32imm 2, implicit-def $x2 + ; CHECK-NEXT: renamable $w21 = MOVi32imm 2, implicit-def $x21 + ; CHECK-NEXT: renamable $x19 = STATEPOINT 2882400000, 0, 4, @bar, undef $x0, $x1, $x2, undef $x3, 2, 0, 2, 4, 2, 39, 2, 0, 2, 1, 2, 0, 2, 42, 2, 2, 2, 14, 2, 0, 2, 3, 2, 400, 2, 3, 2, 400, 2, 0, killed renamable $x19, 2, 7, 2, 0, 2, 3, 2, 95, 2, 7, 2, 0, 2, 3, 2, -11, 2, 3, 2, -8280, 2, 3, 2, 45, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 5, 2, 7, 2, 0, 2, 3, 2, 1, 2, 7, 2, 0, 2, 7, 2, 0, 2, 1, renamable $x19(tied-def 0), 2, 0, 2, 1, 0, 0, csr_aarch64_aapcs, implicit-def $sp, implicit-def $x0, implicit-def dead early-clobber $lr + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: renamable $x20 = COPY $x0 + ; CHECK-NEXT: DMB 11 + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: renamable $x20, renamable $x19 = STATEPOINT 2, 4, 1, undef renamable $x0, undef $x0, 2, 0, 2, 4, 2, 35, 2, 0, 2, 2, 2, 0, 2, 48, 2, 0, 2, 14, 2, 0, 2, 0, killed renamable $x19, 2, 7, 2, 0, 2, 3, 2, 95, 2, 7, 2, 0, 2, 3, 2, -11, 2, 3, 2, -8280, 2, 3, 2, 45, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 5, 2, 7, 2, 0, 2, 3, 2, 1, 2, 0, killed renamable $x20, 2, 7, 2, 0, 2, 2, renamable $x20(tied-def 0), renamable $x19(tied-def 1), 2, 0, 2, 2, 0, 0, 1, 1, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead $x0, implicit-def dead early-clobber $lr + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: $w1 = MOVi32imm 33333 + ; CHECK-NEXT: renamable $x20, renamable $x19 = STATEPOINT 2, 4, 2, undef renamable $x0, undef $x0, $w1, 2, 0, 2, 0, 2, 41, 2, 0, 2, 2, 2, 0, 2, 73, 2, 3, 2, 14, 2, 0, 2, 3, 2, 95, 2, 0, 2, 4278124286, 2, 0, 2, 4278124286, 2, 0, killed renamable $x19, 2, 7, 2, 0, 2, 7, 2, 0, 2, 7, 2, 0, 2, 3, 2, -11, 2, 3, 2, -8280, 2, 3, 2, 45, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 5, 2, 7, 2, 0, 2, 3, 2, 1, 2, 0, killed renamable $x20, 2, 7, 2, 0, 2, 3, renamable $x20(tied-def 0), renamable $x19(tied-def 1), 2, 4278124286, 2, 0, 2, 3, 0, 0, 1, 1, 2, 2, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead $w0, implicit-def dead early-clobber $lr + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: renamable $x20, renamable $x19 = STATEPOINT 2, 4, 2, undef renamable $x0, undef $x0, undef $w1, 2, 0, 2, 0, 2, 39, 2, 0, 2, 2, 2, 0, 2, 78, 2, 2, 2, 14, 2, 0, 2, 3, 2, 95, 2, 0, 2, 4278124286, 2, 0, killed renamable $x19, 2, 7, 2, 0, 2, 7, 2, 0, 2, 7, 2, 0, 2, 3, 2, -11, 2, 3, 2, -8280, 2, 3, 2, 45, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 5, 2, 7, 2, 0, 2, 3, 2, 1, 2, 0, killed renamable $x20, 2, 7, 2, 0, 2, 3, renamable $x20(tied-def 0), renamable $x19(tied-def 1), 2, 4278124286, 2, 0, 2, 3, 0, 0, 1, 1, 2, 2, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead $w0, implicit-def dead early-clobber $lr + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: renamable $x20, renamable $x19 = STATEPOINT 2, 4, 2, undef renamable $x0, undef $x0, undef $w1, 2, 0, 2, 0, 2, 37, 2, 0, 2, 2, 2, 0, 2, 83, 2, 1, 2, 14, 2, 0, 2, 3, 2, 95, 2, 0, killed renamable $x19, 2, 7, 2, 0, 2, 7, 2, 0, 2, 7, 2, 0, 2, 3, 2, -11, 2, 3, 2, -8280, 2, 3, 2, 45, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 5, 2, 7, 2, 0, 2, 3, 2, 1, 2, 0, killed renamable $x20, 2, 7, 2, 0, 2, 2, renamable $x20(tied-def 0), renamable $x19(tied-def 1), 2, 0, 2, 2, 0, 0, 1, 1, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead $w0, implicit-def dead early-clobber $lr + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: renamable $x19, dead renamable $x20 = STATEPOINT 2, 4, 1, undef renamable $x0, undef $w0, 2, 0, 2, 0, 2, 35, 2, 0, 2, 2, 2, 0, 2, 95, 2, 0, 2, 14, 2, 0, 2, 0, killed renamable $x19, 2, 7, 2, 0, 2, 3, 2, 95, 2, 7, 2, 0, 2, 3, 2, -11, 2, 3, 2, -8280, 2, 3, 2, 45, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 5, 2, 7, 2, 0, 2, 3, 2, 1, 2, 0, killed renamable $x20, 2, 7, 2, 0, 2, 2, renamable $x19(tied-def 0), renamable $x20(tied-def 1), 2, 0, 2, 2, 0, 0, 1, 1, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr + ; CHECK-NEXT: STRXui killed renamable $x19, %stack.0, 0 :: (store (s64) into %stack.0) + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: CBNZW $wzr, %bb.2 + ; CHECK-NEXT: B %bb.1 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.1.bb27.preheader: + ; CHECK-NEXT: successors: %bb.3(0x80000000) + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: renamable $x20 = LDRXui undef renamable $x8, 0 :: (load unordered (s64) from `i64 addrspace(1)* undef`, addrspace 1) + ; CHECK-NEXT: renamable $w24 = MOVi32imm -8280 + ; CHECK-NEXT: renamable $w23 = MOVi32imm -6 + ; CHECK-NEXT: renamable $w25 = MOVi32imm 3, implicit-def $x25 + ; CHECK-NEXT: renamable $w11 = MOVi32imm 2143289344 + ; CHECK-NEXT: renamable $x19 = IMPLICIT_DEF + ; CHECK-NEXT: dead renamable $x8 = IMPLICIT_DEF + ; CHECK-NEXT: renamable $x21 = IMPLICIT_DEF + ; CHECK-NEXT: renamable $x26 = IMPLICIT_DEF + ; CHECK-NEXT: renamable $x27 = IMPLICIT_DEF + ; CHECK-NEXT: renamable $x8 = IMPLICIT_DEF + ; CHECK-NEXT: KILL killed renamable $x8 + ; CHECK-NEXT: renamable $x8 = IMPLICIT_DEF + ; CHECK-NEXT: KILL killed renamable $x8 + ; CHECK-NEXT: renamable $w10 = MOVi32imm 2, implicit-def $x10 + ; CHECK-NEXT: B %bb.3 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.2.bb23: + ; CHECK-NEXT: successors: + ; CHECK-NEXT: liveins: $x21 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: renamable $w19 = MOVi32imm 95 + ; CHECK-NEXT: STATEPOINT 2882400000, 0, 0, @wombat, 2, 0, 2, 0, 2, 39, 2, 0, 2, 1, 2, 0, 2, 117, 2, 2, 2, 14, 2, 0, 2, 3, 2, 3, 2, 3, 2, 109, 2, 0, 1, 8, %stack.0, 0, 2, 7, 2, 0, 2, 3, killed renamable $w19, 2, 3, renamable $w21, 2, 3, 2, 3, 2, 3, 2, -8280, 2, 7, 2, 0, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 5, 2, 7, 2, 0, 2, 3, 2, 1, 2, 0, 2, 4278124286, 2, 7, 2, 0, 2, 2, 1, 8, %stack.0, 0, 2, 4278124286, 2, 0, 2, 2, 0, 0, 1, 1, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr, implicit killed $x21 :: (load store (s64) on %stack.0) + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.3.bb27: + ; CHECK-NEXT: successors: %bb.4(0x80000000), %bb.13(0x00000000) + ; CHECK-NEXT: liveins: $w11, $w23, $w24, $x10, $x19, $x20, $x21, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: renamable $x22 = nuw nsw ADDXri renamable $x25, 1, 0 + ; CHECK-NEXT: CBNZW $wzr, %bb.13 + ; CHECK-NEXT: B %bb.4 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.4.bb41: + ; CHECK-NEXT: successors: %bb.5(0x7ffff777), %bb.6(0x00000889) + ; CHECK-NEXT: liveins: $w11, $w23, $w24, $x10, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: CBZW $wzr, %bb.6 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.5: + ; CHECK-NEXT: successors: %bb.7(0x80000000) + ; CHECK-NEXT: liveins: $w11, $w23, $x10, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: B %bb.7 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.6.bb42: + ; CHECK-NEXT: successors: %bb.7(0x80000000) + ; CHECK-NEXT: liveins: $w23, $w24, $x20, $x22, $x25, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: renamable $x8 = LDRXui %stack.0, 0 :: (load (s64) from %stack.0) + ; CHECK-NEXT: STRXui killed renamable $x8, %stack.4, 0 :: (store (s64) into %stack.4) + ; CHECK-NEXT: renamable $w26 = MOVi32imm 95 + ; CHECK-NEXT: renamable $x19 = LDRXui %stack.1, 0 :: (load (s64) from %stack.1) + ; CHECK-NEXT: renamable $w21 = MOVi32imm 2, implicit-def $x21 + ; CHECK-NEXT: renamable $x27, renamable $x19 = STATEPOINT 2882400000, 0, 0, @wombat, 2, 0, 2, 0, 2, 35, 2, 0, 2, 1, 2, 0, 2, 125, 2, 0, 2, 14, 2, 0, 2, 0, 1, 8, %stack.4, 0, 2, 7, 2, 0, 2, 3, killed renamable $w26, 2, 3, renamable $w21, 2, 3, 2, 4278124286, 2, 3, killed renamable $w24, 2, 7, 2, 0, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 2, 2, 7, 2, 0, 2, 3, 2, 4278124286, 2, 0, killed renamable $x19, 2, 7, 2, 0, 2, 3, killed renamable $x27(tied-def 0), renamable $x19(tied-def 1), 1, 8, %stack.4, 0, 2, 0, 2, 3, 0, 0, 1, 1, 2, 2, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr, implicit killed $x21 :: (load store (s64) on %stack.4) + ; CHECK-NEXT: renamable $w11 = MOVi32imm 2143289344 + ; CHECK-NEXT: renamable $w10 = MOVi32imm 2, implicit-def $x10 + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: renamable $x26 = COPY $xzr + ; CHECK-NEXT: STRXui renamable $x19, %stack.1, 0 :: (store (s64) into %stack.1) + ; CHECK-NEXT: dead renamable $x8 = nuw ADDXri killed renamable $x19, 24, 0 + ; CHECK-NEXT: renamable $x19 = IMPLICIT_DEF + ; CHECK-NEXT: renamable $x21 = IMPLICIT_DEF + ; CHECK-NEXT: renamable $x8 = IMPLICIT_DEF + ; CHECK-NEXT: KILL killed renamable $x8 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.7.bb48: + ; CHECK-NEXT: successors: %bb.8(0x80000000) + ; CHECK-NEXT: liveins: $w11, $w23, $x10, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.8.bb79: + ; CHECK-NEXT: successors: %bb.9(0x04000000), %bb.8(0x7c000000) + ; CHECK-NEXT: liveins: $w11, $w23, $x10, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: CBNZW $wzr, %bb.8 + ; CHECK-NEXT: B %bb.9 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.9.bb81: + ; CHECK-NEXT: successors: %bb.11(0x78787f1d), %bb.10(0x078780e3) + ; CHECK-NEXT: liveins: $w11, $w23, $x10, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: STRXui $xzr, renamable $x19, 0 :: (store unordered (s64) into %ir.tmp49, addrspace 1) + ; CHECK-NEXT: CBNZW $wzr, %bb.11 + ; CHECK-NEXT: B %bb.10 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.10.bb82: + ; CHECK-NEXT: successors: %bb.11(0x80000000) + ; CHECK-NEXT: liveins: $w23, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: BL @blam.1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp + ; CHECK-NEXT: renamable $w11 = MOVi32imm 2143289344 + ; CHECK-NEXT: renamable $w10 = MOVi32imm 2, implicit-def $x10 + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.11.bb83: + ; CHECK-NEXT: successors: %bb.12(0x7ffff777), %bb.17(0x00000889) + ; CHECK-NEXT: liveins: $w11, $w23, $x10, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: CBZW $wzr, %bb.17 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.12: + ; CHECK-NEXT: successors: %bb.18(0x80000000) + ; CHECK-NEXT: liveins: $w11, $w23, $x10, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: B %bb.18 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.13.bb85: + ; CHECK-NEXT: successors: %bb.14(0x40000000), %bb.15(0x40000000) + ; CHECK-NEXT: liveins: $w24, $x10, $x22 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: CBNZW $wzr, %bb.15 + ; CHECK-NEXT: B %bb.14 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.14.bb86: + ; CHECK-NEXT: successors:{{ $}} + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: $w0 = MOVi32imm 10 + ; CHECK-NEXT: STATEPOINT 2882400000, 0, 1, @blam, $w0, 2, 0, 2, 0, 2, 41, 2, 0, 2, 1, 2, 0, 2, 237, 2, 3, 2, 14, 2, 0, 2, 0, 2, 0, 2, 3, 2, 4278124286, 2, 3, 2, 4278124286, 2, 0, 2, 0, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 0, 2, 0, 2, 7, 2, 0, 2, 1, 2, 0, 2, 0, 2, 1, 0, 0, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.15.bb90: + ; CHECK-NEXT: successors: + ; CHECK-NEXT: liveins: $w24, $x10, $x22 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: $w0 = MOVi32imm 12 + ; CHECK-NEXT: renamable $w8 = MOVi32imm 95 + ; CHECK-NEXT: STATEPOINT 2882400000, 0, 1, @blam, $w0, 2, 129, 2, 0, 2, 43, 2, 0, 2, 1, 2, 0, 2, 201, 2, 4, 2, 14, 2, 0, 2, 0, 2, 4278124286, 2, 3, renamable $w22, 2, 0, 2, 4278124286, 2, 3, renamable $w22, 2, 0, 1, 8, %stack.0, 0, 2, 7, 2, 0, 2, 3, killed renamable $w8, 2, 3, renamable $w10, 2, 3, 2, 4278124286, 2, 3, killed renamable $w24, 2, 7, 2, 0, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 2, 2, 7, 2, 0, 2, 7, 2, 0, 2, 0, 1, 8, %stack.1, 0, 2, 7, 2, 0, 2, 3, 2, 4278124286, 1, 8, %stack.0, 0, 1, 8, %stack.1, 0, 2, 0, 2, 3, 0, 0, 1, 1, 2, 2, csr_aarch64_allregs, implicit-def $sp, implicit-def dead early-clobber $lr, implicit killed $x10, implicit killed $x22 :: (load store (s64) on %stack.0), (load store (s64) on %stack.1) + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.16.bb94: + ; CHECK-NEXT: successors:{{ $}} + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: $w0 = MOVi32imm 10 + ; CHECK-NEXT: STATEPOINT 2882400000, 0, 1, @blam, $w0, 2, 0, 2, 0, 2, 39, 2, 0, 2, 1, 2, 0, 2, 395, 2, 2, 2, 14, 2, 0, 2, 0, 2, 0, 2, 3, 2, 0, 2, 0, 2, 0, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 0, 2, 0, 2, 7, 2, 0, 2, 1, 2, 0, 2, 0, 2, 1, 0, 0, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.17.bb96: + ; CHECK-NEXT: successors: %bb.18(0x80000000) + ; CHECK-NEXT: liveins: $w23, $x20, $x22, $x25, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: renamable $x8 = LDRXui %stack.0, 0 :: (load (s64) from %stack.0) + ; CHECK-NEXT: STRXui killed renamable $x8, %stack.3, 0 :: (store (s64) into %stack.3) + ; CHECK-NEXT: renamable $w24 = MOVi32imm 95 + ; CHECK-NEXT: renamable $x26 = LDRXui %stack.1, 0 :: (load (s64) from %stack.1) + ; CHECK-NEXT: renamable $x19 = LDRXui %stack.2, 0 :: (load (s64) from %stack.2) + ; CHECK-NEXT: renamable $w21 = MOVi32imm 2, implicit-def $x21 + ; CHECK-NEXT: renamable $x19, renamable $x27, renamable $x26 = STATEPOINT 2882400000, 0, 0, @wombat, 2, 0, 2, 0, 2, 35, 2, 0, 2, 1, 2, 0, 2, 250, 2, 0, 2, 14, 2, 0, 2, 0, 1, 8, %stack.3, 0, 2, 7, 2, 0, 2, 3, killed renamable $w24, 2, 3, renamable $w21, 2, 3, 2, 4278124286, 2, 3, renamable $w21, 2, 7, 2, 0, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 0, 2, 7, 2, 0, 2, 3, 2, 4278124286, 2, 0, killed renamable $x26, 2, 7, 2, 0, 2, 4, killed renamable $x19(tied-def 0), killed renamable $x27(tied-def 1), renamable $x26(tied-def 2), 1, 8, %stack.3, 0, 2, 0, 2, 4, 0, 0, 1, 1, 2, 2, 3, 3, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr, implicit killed $x21 :: (load store (s64) on %stack.3) + ; CHECK-NEXT: renamable $w11 = MOVi32imm 2143289344 + ; CHECK-NEXT: renamable $w10 = MOVi32imm 2, implicit-def $x10 + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: STRXui renamable $x26, %stack.1, 0 :: (store (s64) into %stack.1) + ; CHECK-NEXT: dead renamable $x8 = nuw ADDXri killed renamable $x26, 24, 0 + ; CHECK-NEXT: STRXui renamable $x19, %stack.2, 0 :: (store (s64) into %stack.2) + ; CHECK-NEXT: renamable $x19 = nuw ADDXri killed renamable $x19, 848, 0 + ; CHECK-NEXT: renamable $x21 = IMPLICIT_DEF + ; CHECK-NEXT: renamable $x26 = IMPLICIT_DEF + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.18.bb105: + ; CHECK-NEXT: successors: %bb.20(0x00000000), %bb.19(0x80000000) + ; CHECK-NEXT: liveins: $w11, $w23, $x10, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: STRWui renamable $w20, renamable $x26, 0 :: (store unordered (s32) into %ir.tmp109, addrspace 1) + ; CHECK-NEXT: STRWui renamable $w11, renamable $x21, 0 :: (store unordered (s32) into %ir.1, align 8, addrspace 1) + ; CHECK-NEXT: CBZX renamable $x27, %bb.20 + ; CHECK-NEXT: B %bb.19 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.19.bb115: + ; CHECK-NEXT: successors: %bb.16(0x00000000), %bb.3(0x80000000) + ; CHECK-NEXT: liveins: $w11, $w23, $x10, $x19, $x20, $x21, $x22, $x25, $x26, $x27 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: renamable $x8 = COPY $xzr + ; CHECK-NEXT: renamable $w9 = LDRWui renamable $x8, 0 :: (load unordered (s32) from `i32 addrspace(1)* null`, addrspace 1) + ; CHECK-NEXT: renamable $w9 = MADDWrrr killed renamable $w9, renamable $w10, $wzr + ; CHECK-NEXT: renamable $w23 = nsw SUBWri killed renamable $w23, 2, 0 + ; CHECK-NEXT: dead $xzr = SUBSXri killed renamable $x25, 107, 0, implicit-def $nzcv + ; CHECK-NEXT: renamable $x25 = COPY killed renamable $x22 + ; CHECK-NEXT: renamable $w24 = MOVi32imm 2 + ; CHECK-NEXT: STRWui killed renamable $w9, killed renamable $x8, 0 :: (store unordered (s32) into `i32 addrspace(1)* null`, addrspace 1) + ; CHECK-NEXT: Bcc 8, %bb.16, implicit killed $nzcv + ; CHECK-NEXT: B %bb.3 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: bb.20.bb120: + ; CHECK-NEXT: liveins: $x10 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp + ; CHECK-NEXT: $w0 = MOVi32imm 10 + ; CHECK-NEXT: STATEPOINT 2882400000, 0, 1, @blam, $w0, 2, 129, 2, 0, 2, 39, 2, 0, 2, 1, 2, 0, 2, 272, 2, 2, 2, 14, 2, 0, 2, 0, 2, 0, 2, 3, renamable $w10, 2, 0, 2, 0, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 0, 2, 0, 2, 7, 2, 0, 2, 1, 2, 0, 2, 0, 2, 1, 0, 0, csr_aarch64_allregs, implicit-def $sp, implicit-def dead early-clobber $lr, implicit killed $x10 + ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp bb.0.bb: successors: %bb.1(0x80000000), %bb.2(0x00000000) liveins: $x0 - + %49:gpr64 = COPY $x0 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp dead $w1 = MOVi32imm 526, implicit-def $x1 @@ -419,10 +653,10 @@ ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp CBNZW $wzr, %bb.2 B %bb.1 - + bb.1.bb27.preheader: successors: %bb.3(0x80000000) - + %74:gpr64 = LDRXui undef %75:gpr64sp, 0 :: (load unordered (s64) from `i64 addrspace(1)* undef`, addrspace 1) %13:gpr32 = MOVi32imm -8280 %130:gpr32common = MOVi32imm -6 @@ -436,34 +670,34 @@ %127:gpr64sp = IMPLICIT_DEF %10:gpr64sp = IMPLICIT_DEF B %bb.3 - + bb.2.bb23: - successors: - + successors: + ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp dead %49:gpr64 = STATEPOINT 2882400000, 0, 0, @wombat, 2, 0, 2, 0, 2, 39, 2, 0, 2, 1, 2, 0, 2, 117, 2, 2, 2, 14, 2, 0, 2, 3, 2, 3, 2, 3, 2, 109, 2, 0, %49, 2, 7, 2, 0, 2, 3, %0, 2, 3, %42.sub_32, 2, 3, 2, 3, 2, 3, 2, -8280, 2, 7, 2, 0, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 5, 2, 7, 2, 0, 2, 3, 2, 1, 2, 0, 2, 4278124286, 2, 7, 2, 0, 2, 2, %49(tied-def 0), 2, 4278124286, 2, 0, 2, 2, 0, 0, 1, 1, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp - + bb.3.bb27: successors: %bb.4(0x80000000), %bb.11(0x00000000) - + %14:gpr64sp = nuw nsw ADDXri %129, 1, 0 CBNZW $wzr, %bb.11 B %bb.4 - + bb.4.bb41: successors: %bb.19(0x7ffff777), %bb.5(0x00000889) - + CBZW $wzr, %bb.5 - + bb.19: successors: %bb.6(0x80000000) - + B %bb.6 - + bb.5.bb42: successors: %bb.6(0x80000000) - + ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp %102:gpr64 = COPY %49 %126:gpr64, %10:gpr64sp, dead %102:gpr64 = STATEPOINT 2882400000, 0, 0, @wombat, 2, 0, 2, 0, 2, 35, 2, 0, 2, 1, 2, 0, 2, 125, 2, 0, 2, 14, 2, 0, 2, 0, %102, 2, 7, 2, 0, 2, 3, %0, 2, 3, %42.sub_32, 2, 3, 2, 4278124286, 2, 3, %13, 2, 7, 2, 0, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 2, 2, 7, 2, 0, 2, 3, 2, 4278124286, 2, 0, %10, 2, 7, 2, 0, 2, 3, %126(tied-def 0), %10(tied-def 1), %102(tied-def 2), 2, 0, 2, 3, 0, 0, 1, 1, 2, 2, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr @@ -473,74 +707,74 @@ %122:gpr64sp = IMPLICIT_DEF %124:gpr64sp = IMPLICIT_DEF %127:gpr64sp = IMPLICIT_DEF - + bb.6.bb48: successors: %bb.7(0x80000000) - - + + bb.7.bb79: successors: %bb.8(0x04000000), %bb.7(0x7c000000) - + CBNZW $wzr, %bb.7 B %bb.8 - + bb.8.bb81: successors: %bb.10(0x78787f1d), %bb.9(0x078780e3) - + STRXui $xzr, %122, 0 :: (store unordered (s64) into %ir.tmp49, addrspace 1) CBNZW $wzr, %bb.10 B %bb.9 - + bb.9.bb82: successors: %bb.10(0x80000000) - + ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp BL @blam.1, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp - + bb.10.bb83: successors: %bb.20(0x7ffff777), %bb.15(0x00000889) - + CBZW $wzr, %bb.15 - + bb.20: successors: %bb.16(0x80000000) - + B %bb.16 - + bb.11.bb85: successors: %bb.12(0x40000000), %bb.13(0x40000000) - + CBNZW $wzr, %bb.13 B %bb.12 - + bb.12.bb86: - successors: - + successors: + ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp $w0 = MOVi32imm 10 STATEPOINT 2882400000, 0, 1, @blam, $w0, 2, 0, 2, 0, 2, 41, 2, 0, 2, 1, 2, 0, 2, 237, 2, 3, 2, 14, 2, 0, 2, 0, 2, 0, 2, 3, 2, 4278124286, 2, 3, 2, 4278124286, 2, 0, 2, 0, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 0, 2, 0, 2, 7, 2, 0, 2, 1, 2, 0, 2, 0, 2, 1, 0, 0, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp - + bb.13.bb90: - successors: - + successors: + ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp $w0 = MOVi32imm 12 dead %49:gpr64, dead %10:gpr64sp = STATEPOINT 2882400000, 0, 1, @blam, $w0, 2, 129, 2, 0, 2, 43, 2, 0, 2, 1, 2, 0, 2, 201, 2, 4, 2, 14, 2, 0, 2, 0, 2, 4278124286, 2, 3, %14.sub_32, 2, 0, 2, 4278124286, 2, 3, %14.sub_32, 2, 0, %49, 2, 7, 2, 0, 2, 3, %0, 2, 3, %42.sub_32, 2, 3, 2, 4278124286, 2, 3, %13, 2, 7, 2, 0, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 2, 2, 7, 2, 0, 2, 7, 2, 0, 2, 0, %10, 2, 7, 2, 0, 2, 3, 2, 4278124286, %49(tied-def 0), %10(tied-def 1), 2, 0, 2, 3, 0, 0, 1, 1, 2, 2, csr_aarch64_allregs, implicit-def $sp, implicit-def dead early-clobber $lr ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp - + bb.14.bb94: - successors: - + successors: + ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp $w0 = MOVi32imm 10 STATEPOINT 2882400000, 0, 1, @blam, $w0, 2, 0, 2, 0, 2, 39, 2, 0, 2, 1, 2, 0, 2, 395, 2, 2, 2, 14, 2, 0, 2, 0, 2, 0, 2, 3, 2, 0, 2, 0, 2, 0, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 4278124286, 2, 7, 2, 0, 2, 7, 2, 4278124286, 2, 0, 2, 0, 2, 7, 2, 0, 2, 1, 2, 0, 2, 0, 2, 1, 0, 0, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp - + bb.15.bb96: successors: %bb.16(0x80000000) - + ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp %111:gpr64 = COPY %49 %127:gpr64sp, %126:gpr64, %10:gpr64sp, dead %111:gpr64 = STATEPOINT 2882400000, 0, 0, @wombat, 2, 0, 2, 0, 2, 35, 2, 0, 2, 1, 2, 0, 2, 250, 2, 0, 2, 14, 2, 0, 2, 0, %111, 2, 7, 2, 0, 2, 3, %0, 2, 3, %42.sub_32, 2, 3, 2, 4278124286, 2, 3, %42.sub_32, 2, 7, 2, 0, 2, 3, 2, 230, 2, 7, 2, 0, 2, 4, 2, 0, 2, 7, 2, 0, 2, 3, 2, 4278124286, 2, 0, %10, 2, 7, 2, 0, 2, 4, %127(tied-def 0), %126(tied-def 1), %10(tied-def 2), %111(tied-def 3), 2, 0, 2, 4, 0, 0, 1, 1, 2, 2, 3, 3, csr_aarch64_aapcs, implicit-def $sp, implicit-def dead early-clobber $lr @@ -549,18 +783,18 @@ %122:gpr64sp = nuw ADDXri %127, 848, 0 %124:gpr64sp = IMPLICIT_DEF %125:gpr64sp = IMPLICIT_DEF - + bb.16.bb105: successors: %bb.18(0x00000000), %bb.17(0x80000000) - + STRWui %74.sub_32, %125, 0 :: (store unordered (s32) into %ir.tmp109, addrspace 1) STRWui %114, %124, 0 :: (store unordered (s32) into %ir.1, align 8, addrspace 1) CBZX %126, %bb.18 B %bb.17 - + bb.17.bb115: successors: %bb.14(0x00000000), %bb.3(0x80000000) - + %115:gpr64sp = COPY $xzr %116:gpr32 = LDRWui %115, 0 :: (load unordered (s32) from `i32 addrspace(1)* null`, addrspace 1) %117:gpr32 = MADDWrrr %116, %42.sub_32, $wzr @@ -571,7 +805,7 @@ STRWui %117, %115, 0 :: (store unordered (s32) into `i32 addrspace(1)* null`, addrspace 1) Bcc 8, %bb.14, implicit killed $nzcv B %bb.3 - + bb.18.bb120: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp $w0 = MOVi32imm 10 Index: llvm/test/CodeGen/AMDGPU/remaining-virtual-register-operands.ll =================================================================== --- llvm/test/CodeGen/AMDGPU/remaining-virtual-register-operands.ll +++ llvm/test/CodeGen/AMDGPU/remaining-virtual-register-operands.ll @@ -1,32 +1,17 @@ -; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -verify-machineinstrs < %s 2>%t.err | FileCheck %s -; RUN: FileCheck -check-prefix=ERR %s < %t.err +; RUN: not --crash llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -verify-machineinstrs < %s 2>&1 | FileCheck %s ; This testcase fails register allocation at the same time it performs ; virtual register splitting (by introducing VGPR to AGPR copies). We ; still need to enqueue and allocate the newly split vregs after the ; failure. +; The machine verifier complains about usage of register +; which is marked as killed in previous instruction. +; This happens due to when register allocator is out of registers +; it takes the first avialable register. -; ERR: error: ran out of registers during register allocation -; ERR-NEXT: error: ran out of registers during register allocation -; ERR-NEXT: error: ran out of registers during register allocation -; ERR-NOT: ERROR - -; CHECK: v_accvgpr_write_b32 -; CHECK: v_accvgpr_write_b32 -; CHECK: v_accvgpr_write_b32 -; CHECK: v_accvgpr_write_b32 -; CHECK: v_accvgpr_write_b32 -; CHECK: v_accvgpr_write_b32 -; CHECK: v_accvgpr_write_b32 - -; CHECK: v_accvgpr_read_b32 -; CHECK: v_accvgpr_read_b32 -; CHECK: v_accvgpr_read_b32 -; CHECK: v_accvgpr_read_b32 -; CHECK: v_accvgpr_read_b32 -; CHECK: v_accvgpr_read_b32 -; CHECK: v_accvgpr_read_b32 +; CHECK: error: ran out of registers during register allocation +; CHECK: Bad machine code: Using an undefined physical register define amdgpu_kernel void @alloc_failure_with_split_vregs(float %v0, float %v1) #0 { %agpr0 = call float asm sideeffect "; def $0", "=${a0}"() %agpr.vec = insertelement <16 x float> undef, float %agpr0, i32 0