73 lines · plain
1; RUN: llc -mtriple=hexagon < %s | FileCheck %s2 3target triple = "hexagon"4%type.0 = type { i32, ptr, i32, i32, i32 }5 6; Check that CFI is before the packet with call+allocframe.7; CHECK-LABEL: danny:8; CHECK: cfi_def_cfa9; CHECK: call throw10; CHECK-NEXT: allocframe11 12; Expect packet:13; {14; call throw15; allocframe(#0)16; }17 18define ptr @danny(ptr %p0, i32 %p1) #0 {19entry:20 %t0 = getelementptr inbounds %type.0, ptr %p0, i32 0, i32 421 %t1 = load i32, ptr %t0, align 422 %th = icmp ugt i32 %t1, %p123 br i1 %th, label %if.end, label %if.then24 25if.then: ; preds = %entry26 tail call void @throw(ptr nonnull %p0)27 unreachable28 29if.end: ; preds = %entry30 %t6 = getelementptr inbounds %type.0, ptr %p0, i32 0, i32 331 %t2 = load i32, ptr %t6, align 432 %t9 = add i32 %t2, %p133 %ta = lshr i32 %t9, 434 %tb = and i32 %t9, 1535 %t7 = getelementptr inbounds %type.0, ptr %p0, i32 0, i32 236 %t3 = load i32, ptr %t7, align 437 %tc = icmp ult i32 %ta, %t338 %td = select i1 %tc, i32 0, i32 %t339 %te = sub i32 %ta, %td40 %t8 = getelementptr inbounds %type.0, ptr %p0, i32 0, i32 141 %t4 = load ptr, ptr %t8, align 442 %tf = getelementptr inbounds ptr, ptr %t4, i32 %te43 %t5 = load ptr, ptr %tf, align 444 %tg = getelementptr inbounds i8, ptr %t5, i32 %tb45 ret ptr %tg46}47 48; Check that CFI is after allocframe.49; CHECK-LABEL: sammy:50; CHECK: allocframe51; CHECK: cfi_def_cfa52 53define void @sammy(ptr %p0, i32 %p1) #0 {54entry:55 %t0 = icmp sgt i32 %p1, 056 br i1 %t0, label %if.then, label %if.else57if.then:58 call void @throw(ptr nonnull %p0)59 br label %if.end60if.else:61 call void @nothrow() #262 br label %if.end63if.end:64 ret void65}66 67declare void @throw(ptr) #168declare void @nothrow() #269 70attributes #0 = { "target-cpu"="hexagonv55" }71attributes #1 = { noreturn "target-cpu"="hexagonv55" }72attributes #2 = { nounwind "target-cpu"="hexagonv55" }73