1 ; RUN: llc -march=hexagon < %s | FileCheck %s
2 ; Check that "r0 = rN" is packetized together with dealloc_return.
5 ; CHECK: dealloc_return
7 target triple = "hexagon-unknown--elf"
9 ; Function Attrs: nounwind
10 define i8* @fred(i8* %user_context, i32 %x) #0 {
12 %and14 = add i32 %x, 255
13 %add1 = and i32 %and14, -128
14 %call = tail call i8* @malloc(i32 %add1) #1
15 %cmp = icmp eq i8* %call, null
16 br i1 %cmp, label %cleanup, label %if.end
18 if.end: ; preds = %entry
19 %0 = ptrtoint i8* %call to i32
20 %sub4 = add i32 %0, 131
21 %and5 = and i32 %sub4, -128
22 %1 = inttoptr i32 %and5 to i8*
23 %2 = inttoptr i32 %and5 to i8**
24 %arrayidx = getelementptr inbounds i8*, i8** %2, i32 -1
25 store i8* %call, i8** %arrayidx, align 4
28 cleanup: ; preds = %if.end, %entry
29 %retval.0 = phi i8* [ %1, %if.end ], [ null, %entry ]
33 ; Function Attrs: nounwind
34 declare noalias i8* @malloc(i32) local_unnamed_addr #1
36 attributes #0 = { nounwind }
37 attributes #1 = { nobuiltin nounwind }