1# RUN: llc -march=hexagon -run-pass hexagon-early-if %s -o - | FileCheck %s 2 3# Test that the LIFETIME_END instruction is not speculated and moved to a 4# different basic block. 5 6# CHECK: bb.1.b1: 7# CHECK: LIFETIME_END 8# CHECK: bb.2.b2: 9 10--- | 11 12 %s.0 = type { %s.1 } 13 %s.1 = type { %s.2 } 14 %s.2 = type { %s.3 } 15 %s.3 = type { %s.4 } 16 %s.4 = type { %s.5 } 17 %s.5 = type { i32, i32, i8* } 18 19 declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #0 20 21 define hidden fastcc void @f0() { 22 b0: 23 %v0 = alloca %s.0, align 4 24 %v1 = load i8, i8* undef, align 1 25 %v2 = add i8 %v1, -102 26 %v3 = icmp ult i8 %v2, 1 27 br i1 %v3, label %b1, label %b2 28 29 b1: ; preds = %b0 30 %v4 = bitcast %s.0* %v0 to i8* 31 call void @llvm.lifetime.end.p0i8(i64 12, i8* nonnull %v4) 32 br label %b2 33 34 b2: ; preds = %b1, %b0 35 ret void 36 } 37 38 attributes #0 = { argmemonly nounwind } 39 40... 41--- 42name: f0 43alignment: 16 44registers: 45 - { id: 0, class: intregs, preferred-register: '' } 46 - { id: 1, class: intregs, preferred-register: '' } 47 - { id: 2, class: predregs, preferred-register: '' } 48 - { id: 3, class: predregs, preferred-register: '' } 49liveins: 50frameInfo: 51 maxAlignment: 4 52fixedStack: 53stack: 54 - { id: 0, name: v0, type: default, offset: 0, size: 12, alignment: 4 } 55constants: 56body: | 57 bb.0.b0: 58 successors: %bb.1.b1(0x40000000), %bb.2.b2(0x40000000) 59 60 %1 = IMPLICIT_DEF 61 %0 = L2_loadrb_io killed %1, 0 :: (load 1 from `i8* undef`) 62 %2 = C2_cmpeqi killed %0, 102 63 %3 = COPY killed %2 64 J2_jumpf killed %3, %bb.2.b2, implicit-def dead $pc 65 J2_jump %bb.1.b1, implicit-def dead $pc 66 67 bb.1.b1: 68 successors: %bb.2.b2(0x80000000) 69 70 LIFETIME_END %stack.0.v0 71 72 bb.2.b2: 73 PS_jmpret $r31, implicit-def dead $pc 74 75... 76