annotate test/CodeGen/Hexagon/pic-regusage.ll @ 146:3fc4d5c3e21e

set tail call flag for code segment in CGCAll
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:23:36 +0900
parents 1172e4bd9c6f
children c2174574ed3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
120
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
1 ; RUN: llc -march=hexagon -relocation-model=pic < %s | FileCheck %s
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
2
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
3 ; Force the use of R14 (by clobbering everything else in the inline asm).
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
4 ; Make sure that R14 is not set before the __save call (which will clobber
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
5 ; R14, R15 and R28).
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
6 ; CHECK: call __save_r16_through_r27
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
7 ; CHECK: }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
8 ; CHECK: r14{{ *}}=
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
9
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
10 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
11
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
12 ; Function Attrs: nounwind optsize
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
13 define i32 @_Z7testR14Pi(i32* nocapture %res) #0 {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
14 entry:
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
15 %0 = load i32, i32* %res, align 4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
16 %1 = tail call { i32, i32 } asm "r0=$2\0A\09$1=add(r0,#$3)\0A\09$0=add(r0,#$4)\0A\09", "=r,=r,r,i,i,~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r15},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r24},~{r25},~{r26},~{r27}"(i32 %0, i32 40, i32 50) #1
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
17 %asmresult = extractvalue { i32, i32 } %1, 0
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
18 %asmresult1 = extractvalue { i32, i32 } %1, 1
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
19 store i32 %asmresult, i32* %res, align 4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
20 %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %asmresult1) #2
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
21 %2 = load i32, i32* %res, align 4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
22 %call2 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %2) #2
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
23 ret i32 0
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
24 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
25
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
26 ; Function Attrs: nounwind optsize
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
27 declare i32 @printf(i8*, ...) #0
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
28
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
29 ; Same as above for R15.
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
30 ; CHECK: call __save_r16_through_r27
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
31 ; CHECK: }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
32 ; CHECK: r15{{ *}}=
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
33
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
34 ; Function Attrs: nounwind optsize
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
35 define i32 @_Z7testR15Pi(i32* nocapture %res) #0 {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
36 entry:
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
37 %0 = load i32, i32* %res, align 4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
38 %1 = tail call { i32, i32 } asm "r0=$2\0A\09$1=add(r0,#$3)\0A\09$0=add(r0,#$4)\0A\09", "=r,=r,r,i,i,~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r24},~{r25},~{r26},~{r27}"(i32 %0, i32 40, i32 50) #1
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
39 %asmresult = extractvalue { i32, i32 } %1, 0
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
40 %asmresult1 = extractvalue { i32, i32 } %1, 1
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
41 store i32 %asmresult, i32* %res, align 4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
42 %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %asmresult1) #2
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
43 %2 = load i32, i32* %res, align 4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
44 %call2 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %2) #2
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
45 ret i32 0
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
46 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
47
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
48 ; Same as above for R28.
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
49 ; CHECK: call __save_r16_through_r27
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
50 ; CHECK: }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
51 ; CHECK: r28{{ *}}=
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
52
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
53 ; Function Attrs: nounwind optsize
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
54 define i32 @_Z7testR28Pi(i32* nocapture %res) #0 {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
55 entry:
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
56 %0 = load i32, i32* %res, align 4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
57 %1 = tail call { i32, i32 } asm "r0=$2\0A\09$1=add(r0,#$3)\0A\09$0=add(r0,#$4)\0A\09", "=r,=r,r,i,i,~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r24},~{r25},~{r26}"(i32 %0, i32 40, i32 50) #1
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
58 %asmresult = extractvalue { i32, i32 } %1, 0
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
59 %asmresult1 = extractvalue { i32, i32 } %1, 1
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
60 store i32 %asmresult, i32* %res, align 4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
61 %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %asmresult1) #2
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
62 %2 = load i32, i32* %res, align 4
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
63 %call2 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %2) #2
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
64 ret i32 0
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
65 }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
66
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
67 attributes #0 = { nounwind optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
68 attributes #1 = { nounwind }
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
69 attributes #2 = { nounwind optsize }