Home | History | Annotate | Download | only in Hexagon
      1 ; RUN: llc -march=hexagon -O2 -disable-hexagon-misched < %s | FileCheck %s
      2 
      3 target triple = "hexagon-unknown--elf"
      4 
      5 ; CHECK-LABEL: f1:
      6 ; CHECK-DAG:      r16 = ##.Lg0+32767
      7 ; CHECK-DAG:      r17 = ##g1+32767
      8 
      9 ; CHECK-LABEL: LBB0_2:
     10 ; CHECK:        {
     11 ; CHECK-DAG:      call f0
     12 ; CHECK-DAG:      r0 = add(r16,#-32767)
     13 ; CHECK-DAG:      r1 = add(r17,#-32767)
     14 ; CHECK:        }
     15 
     16 ; CHECK-LABEL: LBB0_3:
     17 ; CHECK:        {
     18 ; CHECK-DAG:      call f0
     19 ; CHECK-DAG:      r0 = add(r16,#-32767)
     20 ; CHECK-DAG:      r1 = add(r17,#-32757)
     21 ; CHECK:        }
     22 
     23 ; CHECK-LABEL: LBB0_4:
     24 ; CHECK:        {
     25 ; CHECK-DAG:      call f0
     26 ; CHECK-DAG:      r0 = add(r16,#-32767)
     27 ; CHECK-DAG:      r1 = add(r17,#-32747)
     28 ; CHECK:        }
     29 
     30 ; CHECK-LABEL: LBB0_5:
     31 ; CHECK:        {
     32 ; CHECK-DAG:      call f0
     33 ; CHECK-DAG:      r0 = add(r16,#-32767)
     34 ; CHECK-DAG:      r1 = add(r17,#-32737)
     35 ; CHECK:        }
     36 
     37 ; CHECK-LABEL: LBB0_6:
     38 ; CHECK:        {
     39 ; CHECK-DAG:      call f0
     40 ; CHECK-DAG:      r0 = add(r16,#-32767)
     41 ; CHECK-DAG:      r1 = add(r17,#-32727)
     42 ; CHECK:        }
     43 
     44 ; CHECK-LABEL: LBB0_7:
     45 ; CHECK:        {
     46 ; CHECK-DAG:      call f0
     47 ; CHECK-DAG:      r0 = add(r16,#-32767)
     48 ; CHECK-DAG:      r1 = add(r17,#-32717)
     49 ; CHECK:        }
     50 
     51 ; CHECK-LABEL: LBB0_8:
     52 ; CHECK:        {
     53 ; CHECK-DAG:      call f0
     54 ; CHECK-DAG:      r0 = add(r16,#-32767)
     55 ; CHECK-DAG:      r1 = add(r17,#-32707)
     56 ; CHECK:        }
     57 
     58 ; CHECK-LABEL: LBB0_9:
     59 ; CHECK:        {
     60 ; CHECK-DAG:      call f0
     61 ; CHECK-DAG:      r0 = add(r16,#-32767)
     62 ; CHECK-DAG:      r1 = add(r17,#-32697)
     63 ; CHECK:        }
     64 
     65 ; CHECK-LABEL: LBB0_10:
     66 ; CHECK:        {
     67 ; CHECK-DAG:      call f0
     68 ; CHECK-DAG:      r0 = add(r16,#-32767)
     69 ; CHECK-DAG:      r1 = add(r17,#-32687)
     70 ; CHECK:        }
     71 
     72 ; CHECK-LABEL: LBB0_11:
     73 ; CHECK:        {
     74 ; CHECK-DAG:      call f0
     75 ; CHECK-DAG:      r0 = add(r16,#-32767)
     76 ; CHECK-DAG:      r1 = add(r17,#-32677)
     77 ; CHECK:        }
     78 
     79 @g0 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1
     80 @g1 = internal constant [10 x [10 x i8]] [[10 x i8] c"[0000]\00\00\00\00", [10 x i8] c"[0001]\00\00\00\00", [10 x i8] c"[0002]\00\00\00\00", [10 x i8] c"[0003]\00\00\00\00", [10 x i8] c"[0004]\00\00\00\00", [10 x i8] c"[0005]\00\00\00\00", [10 x i8] c"[0006]\00\00\00\00", [10 x i8] c"[0007]\00\00\00\00", [10 x i8] c"[0008]\00\00\00\00", [10 x i8] c"[0009]\00\00\00\00"], align 16
     81 
     82 declare i32 @f0(i8*, i8*)
     83 
     84 ; Function Attrs: nounwind
     85 define i32 @f1(i32 %a0, i8** %a1) #0 {
     86 b0:
     87   %v01 = alloca i32, align 4
     88   %v12 = alloca i32, align 4
     89   %v23 = alloca i8**, align 4
     90   %v34 = alloca i32, align 4
     91   store i32 0, i32* %v01
     92   store i32 %a0, i32* %v12, align 4
     93   store i8** %a1, i8*** %v23, align 4
     94   %v45 = load i8**, i8*** %v23, align 4
     95   %v56 = getelementptr inbounds i8*, i8** %v45, i32 1
     96   %v67 = load i8*, i8** %v56, align 4
     97   %v78 = call i32 @f2(i8* %v67)
     98   store i32 %v78, i32* %v34, align 4
     99   %v89 = load i32, i32* %v34, align 4
    100   switch i32 %v89, label %b11 [
    101     i32 0, label %b1
    102     i32 1, label %b2
    103     i32 2, label %b3
    104     i32 3, label %b4
    105     i32 4, label %b5
    106     i32 5, label %b6
    107     i32 6, label %b7
    108     i32 7, label %b8
    109     i32 8, label %b9
    110     i32 9, label %b10
    111   ]
    112 
    113 b1:                                               ; preds = %b0
    114   %v910 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 0
    115   %v10 = getelementptr inbounds [10 x i8], [10 x i8]* %v910, i32 0, i32 0
    116   %v11 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v10)
    117   br label %b2
    118 
    119 b2:                                               ; preds = %b1, %b0
    120   %v1211 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 1
    121   %v13 = getelementptr inbounds [10 x i8], [10 x i8]* %v1211, i32 0, i32 0
    122   %v14 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v13)
    123   br label %b3
    124 
    125 b3:                                               ; preds = %b2, %b0
    126   %v15 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 2
    127   %v16 = getelementptr inbounds [10 x i8], [10 x i8]* %v15, i32 0, i32 0
    128   %v17 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v16)
    129   br label %b4
    130 
    131 b4:                                               ; preds = %b3, %b0
    132   %v18 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 3
    133   %v19 = getelementptr inbounds [10 x i8], [10 x i8]* %v18, i32 0, i32 0
    134   %v20 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v19)
    135   br label %b5
    136 
    137 b5:                                               ; preds = %b4, %b0
    138   %v21 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 4
    139   %v22 = getelementptr inbounds [10 x i8], [10 x i8]* %v21, i32 0, i32 0
    140   %v2312 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v22)
    141   br label %b6
    142 
    143 b6:                                               ; preds = %b5, %b0
    144   %v24 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 5
    145   %v25 = getelementptr inbounds [10 x i8], [10 x i8]* %v24, i32 0, i32 0
    146   %v26 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v25)
    147   br label %b7
    148 
    149 b7:                                               ; preds = %b6, %b0
    150   %v27 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 6
    151   %v28 = getelementptr inbounds [10 x i8], [10 x i8]* %v27, i32 0, i32 0
    152   %v29 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v28)
    153   br label %b8
    154 
    155 b8:                                               ; preds = %b7, %b0
    156   %v30 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 7
    157   %v31 = getelementptr inbounds [10 x i8], [10 x i8]* %v30, i32 0, i32 0
    158   %v32 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v31)
    159   br label %b9
    160 
    161 b9:                                               ; preds = %b8, %b0
    162   %v33 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 8
    163   %v3413 = getelementptr inbounds [10 x i8], [10 x i8]* %v33, i32 0, i32 0
    164   %v35 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v3413)
    165   br label %b10
    166 
    167 b10:                                              ; preds = %b9, %b0
    168   %v36 = getelementptr inbounds [10 x [10 x i8]], [10 x [10 x i8]]* @g1, i32 0, i32 9
    169   %v37 = getelementptr inbounds [10 x i8], [10 x i8]* %v36, i32 0, i32 0
    170   %v38 = call i32 @f0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @g0, i32 0, i32 0), i8* %v37)
    171   br label %b11
    172 
    173 b11:                                              ; preds = %b10, %b0
    174   ret i32 0
    175 }
    176 
    177 ; Function Attrs: nounwind
    178 declare i32 @f2(i8*) #0
    179 
    180 attributes #0 = { nounwind }
    181