Home | History | Annotate | Download | only in Hexagon
      1 ; RUN: llc -march=hexagon -O2 < %s | FileCheck %s
      2 ; CHECK-NOT: if {{.*}} cmp{{.*}}jump
      3 
      4 %s.0 = type opaque
      5 %s.1 = type { i8*, i8*, %s.2*, i32, [0 x i8] }
      6 %s.2 = type opaque
      7 
      8 @g0 = private unnamed_addr constant [29 x i8] c"BUG: failure at %s:%d/%s()!\0A\00", align 1
      9 @g1 = private unnamed_addr constant [11 x i8] c"fs/namei.c\00", align 1
     10 @g2 = private unnamed_addr constant [8 x i8] c"putname\00", align 1
     11 @g3 = private unnamed_addr constant [5 x i8] c"BUG!\00", align 1
     12 @g4 = external global %s.0*, align 4
     13 
     14 ; Function Attrs: nounwind
     15 define void @f0(%s.1* %a0) #0 {
     16 b0:
     17   %v0 = alloca %s.1*, align 4
     18   store %s.1* %a0, %s.1** %v0, align 4
     19   br label %b1, !llvm.loop !0
     20 
     21 b1:                                               ; preds = %b0
     22   %v1 = load %s.1*, %s.1** %v0, align 4
     23   %v2 = getelementptr inbounds %s.1, %s.1* %v1, i32 0, i32 3
     24   %v3 = load i32, i32* %v2, align 4
     25   %v4 = icmp sle i32 %v3, 0
     26   %v5 = xor i1 %v4, true
     27   %v6 = xor i1 %v5, true
     28   %v7 = zext i1 %v6 to i32
     29   %v8 = call i32 @llvm.expect.i32(i32 %v7, i32 0)
     30   %v9 = icmp ne i32 %v8, 0
     31   br i1 %v9, label %b2, label %b5
     32 
     33 b2:                                               ; preds = %b1
     34   br label %b3
     35 
     36 b3:                                               ; preds = %b2
     37   %v10 = call i32 (i8*, ...) @f1(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @g0, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @g1, i32 0, i32 0), i32 246, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @g2, i32 0, i32 0))
     38   call void (i8*, ...) @f2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @g3, i32 0, i32 0))
     39   unreachable
     40 
     41 b4:                                               ; No predecessors!
     42   br label %b5
     43 
     44 b5:                                               ; preds = %b4, %b1
     45   br label %b6
     46 
     47 b6:                                               ; preds = %b5
     48   %v11 = load %s.1*, %s.1** %v0, align 4
     49   %v12 = getelementptr inbounds %s.1, %s.1* %v11, i32 0, i32 3
     50   %v13 = load i32, i32* %v12, align 4
     51   %v14 = add i32 %v13, -1
     52   store i32 %v14, i32* %v12, align 4
     53   %v15 = icmp sgt i32 %v14, 0
     54   br i1 %v15, label %b7, label %b8
     55 
     56 b7:                                               ; preds = %b6
     57   br label %b11
     58 
     59 b8:                                               ; preds = %b6
     60   %v16 = load %s.1*, %s.1** %v0, align 4
     61   %v17 = getelementptr inbounds %s.1, %s.1* %v16, i32 0, i32 0
     62   %v18 = load i8*, i8** %v17, align 4
     63   %v19 = load %s.1*, %s.1** %v0, align 4
     64   %v20 = getelementptr inbounds %s.1, %s.1* %v19, i32 0, i32 4
     65   %v21 = getelementptr inbounds [0 x i8], [0 x i8]* %v20, i32 0, i32 0
     66   %v22 = icmp ne i8* %v18, %v21
     67   br i1 %v22, label %b9, label %b10
     68 
     69 b9:                                               ; preds = %b8
     70   %v23 = load %s.0*, %s.0** @g4, align 4
     71   %v24 = load %s.1*, %s.1** %v0, align 4
     72   %v25 = getelementptr inbounds %s.1, %s.1* %v24, i32 0, i32 0
     73   %v26 = load i8*, i8** %v25, align 4
     74   call void @f3(%s.0* %v23, i8* %v26)
     75   %v27 = load %s.1*, %s.1** %v0, align 4
     76   %v28 = bitcast %s.1* %v27 to i8*
     77   call void @f4(i8* %v28)
     78   br label %b11
     79 
     80 b10:                                              ; preds = %b8
     81   %v29 = load %s.0*, %s.0** @g4, align 4
     82   %v30 = load %s.1*, %s.1** %v0, align 4
     83   %v31 = bitcast %s.1* %v30 to i8*
     84   call void @f3(%s.0* %v29, i8* %v31)
     85   br label %b11
     86 
     87 b11:                                              ; preds = %b10, %b9, %b7
     88   ret void
     89 }
     90 
     91 ; Function Attrs: nounwind readnone
     92 declare i32 @llvm.expect.i32(i32, i32) #1
     93 
     94 ; Function Attrs: nounwind
     95 declare i32 @f1(i8*, ...) #0
     96 
     97 ; Function Attrs: noreturn
     98 declare void @f2(i8*, ...) #2
     99 
    100 ; Function Attrs: nounwind
    101 declare void @f3(%s.0*, i8*) #0
    102 
    103 ; Function Attrs: nounwind
    104 declare void @f4(i8*) #0
    105 
    106 attributes #0 = { nounwind }
    107 attributes #1 = { nounwind readnone }
    108 attributes #2 = { noreturn }
    109 
    110 !0 = distinct !{!0, !1}
    111 !1 = !{!"llvm.loop.threadify", i32 101214632}
    112