Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/CodeGen/X86/tail-dup-asm-goto.ll
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||||
; RUN: llc -mtriple=x86_64-linux -stop-after=early-tailduplication \ | ; RUN: llc -mtriple=x86_64-linux -stop-after=early-tailduplication \ | ||||
; RUN: -verify-machineinstrs=0 < %s | FileCheck %s | ; RUN: -verify-machineinstrs < %s | FileCheck %s | ||||
; Ensure that we don't duplicate a block with an "INLINEASM_BR" instruction | ; Ensure that we don't duplicate a block with an "INLINEASM_BR" instruction | ||||
; during code gen. | ; during code gen. | ||||
declare dso_local void @foo() | declare dso_local void @foo() | ||||
define ptr @test1(ptr %arg1, ptr %arg2) { | define ptr @test1(ptr %arg1, ptr %arg2) { | ||||
; CHECK-LABEL: name: test1 | ; CHECK-LABEL: name: test1 | ||||
; CHECK: bb.0.bb: | ; CHECK: bb.0.bb: | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
bb17.i.i.i: ; preds = %bb110 | bb17.i.i.i: ; preds = %bb110 | ||||
br label %kmem_cache_has_cpu_partial.exit | br label %kmem_cache_has_cpu_partial.exit | ||||
kmem_cache_has_cpu_partial.exit: ; preds = %bb110 | kmem_cache_has_cpu_partial.exit: ; preds = %bb110 | ||||
ret ptr %i10.1 | ret ptr %i10.1 | ||||
} | } | ||||
; The intent of this test is to test what happens when we have a callbr where | ; The intent of this test is to test what happens when we have a callbr where | ||||
nickdesaulniers: I should test that this crashes prior to my change, since the reproducer was found on ppc… | |||||
Cool; yeah, after I rebase I should add -verify-machineinstrs to this test; it now asserts for this addition with the assertion I added recently in D130290. nickdesaulniers: Cool; yeah, after I rebase I should add `-verify-machineinstrs` to this test; it now asserts… | |||||
; BOTH the fallthrough/direct target and the indirect target are the same basic | ; BOTH the fallthrough/direct target and the indirect target are the same basic | ||||
; block. We might one day permit tail duplication here, but we need to ensure | ; block. We might one day permit tail duplication here, but we need to ensure | ||||
; that we don't crash or run afoul of any MachineVerifier checks. | ; that we don't crash or run afoul of any MachineVerifier checks. | ||||
; FIXME: enable -verify-machineinstrs for this test! | |||||
define void @ceph_con_v2_try_read(i32 %__trans_tmp_3.sroa.0.0.copyload, i1 %tobool.not.i.i) nounwind { | define void @ceph_con_v2_try_read(i32 %__trans_tmp_3.sroa.0.0.copyload, i1 %tobool.not.i.i) nounwind { | ||||
; CHECK-LABEL: name: ceph_con_v2_try_read | ; CHECK-LABEL: name: ceph_con_v2_try_read | ||||
; CHECK: bb.0.entry: | ; CHECK: bb.0.entry: | ||||
; CHECK-NEXT: successors: %bb.1(0x80000000) | ; CHECK-NEXT: successors: %bb.1(0x80000000) | ||||
; CHECK-NEXT: liveins: $edi, $esi | ; CHECK-NEXT: liveins: $edi, $esi | ||||
; CHECK-NEXT: {{ $}} | ; CHECK-NEXT: {{ $}} | ||||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY $esi | ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY $esi | ||||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr32 = COPY $edi | ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr32 = COPY $edi | ||||
Show All 17 Lines | define void @ceph_con_v2_try_read(i32 %__trans_tmp_3.sroa.0.0.copyload, i1 %tobool.not.i.i) nounwind { | ||||
; CHECK-NEXT: CALL64r killed [[SUBREG_TO_REG]], csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def $eax | ; CHECK-NEXT: CALL64r killed [[SUBREG_TO_REG]], csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def $eax | ||||
; CHECK-NEXT: ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp | ; CHECK-NEXT: ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp | ||||
; CHECK-NEXT: [[COPY3:%[0-9]+]]:gr32 = COPY $eax | ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gr32 = COPY $eax | ||||
; CHECK-NEXT: TEST8ri [[COPY2]], 1, implicit-def $eflags | ; CHECK-NEXT: TEST8ri [[COPY2]], 1, implicit-def $eflags | ||||
; CHECK-NEXT: JCC_1 %bb.4, 4, implicit $eflags | ; CHECK-NEXT: JCC_1 %bb.4, 4, implicit $eflags | ||||
; CHECK-NEXT: JMP_1 %bb.3 | ; CHECK-NEXT: JMP_1 %bb.3 | ||||
; CHECK-NEXT: {{ $}} | ; CHECK-NEXT: {{ $}} | ||||
; CHECK-NEXT: bb.3.if.else.i.i: | ; CHECK-NEXT: bb.3.if.else.i.i: | ||||
; CHECK-NEXT: successors: %bb.1(0x80000000) | ; CHECK-NEXT: successors: %bb.5(0x80000000) | ||||
; CHECK-NEXT: {{ $}} | ; CHECK-NEXT: {{ $}} | ||||
; CHECK-NEXT: INLINEASM_BR &"", 1 /* sideeffect attdialect */, 13 /* imm */, %bb.5 | ; CHECK-NEXT: INLINEASM_BR &"", 1 /* sideeffect attdialect */, 13 /* imm */, %bb.5 | ||||
; CHECK-NEXT: LIFETIME_END %stack.0.skip.i.i | ; CHECK-NEXT: JMP_1 %bb.5 | ||||
; CHECK-NEXT: JMP_1 %bb.1 | |||||
; CHECK-NEXT: {{ $}} | ; CHECK-NEXT: {{ $}} | ||||
; CHECK-NEXT: bb.4.process_message_header.exit.i: | ; CHECK-NEXT: bb.4.process_message_header.exit.i: | ||||
; CHECK-NEXT: successors: %bb.1(0x80000000) | ; CHECK-NEXT: successors: %bb.1(0x80000000) | ||||
; CHECK-NEXT: {{ $}} | ; CHECK-NEXT: {{ $}} | ||||
; CHECK-NEXT: LIFETIME_END %stack.0.skip.i.i | ; CHECK-NEXT: LIFETIME_END %stack.0.skip.i.i | ||||
; CHECK-NEXT: JMP_1 %bb.1 | ; CHECK-NEXT: JMP_1 %bb.1 | ||||
; CHECK-NEXT: {{ $}} | ; CHECK-NEXT: {{ $}} | ||||
; CHECK-NEXT: bb.5.if.end.i (machine-block-address-taken, inlineasm-br-indirect-target): | ; CHECK-NEXT: bb.5.if.end.i (machine-block-address-taken, inlineasm-br-indirect-target): | ||||
Show All 30 Lines |
I should test that this crashes prior to my change, since the reproducer was found on ppc, though I don't think the issue is target specific. If so, I will pre-commit the additional test, and rebase this so we can better see the resulting changes to the test.