brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.3 KiB · 8921b38 Raw
216 lines · plain
1; RUN: llc -mtriple=hexagon -O2 < %s | FileCheck %s2; We do not want to see a new value compare after the convert3; CHECK: r{{[0-9]+}} = convert_df2w4; CHECK-NOT: if (!cmp.eq(r{{[0-9]+}}.new,r{{[0-9]+}})jump5; r3 = convert_df2w(r1:0):chop6; if (!cmp.eq(r3.new, r2)) jump:nt .LBB0_137 8target triple = "hexagon"9 10%s.0 = type { %s.1, ptr, ptr }11%s.1 = type { i16, i16, i32 }12%s.2 = type { i8, i32, i32, i16, i16, i16, i32, i8, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, ptr }13%s.3 = type { [2 x i16], i16, i16, i16, i16, [13 x i16], i16, i16, [2 x ptr], [25 x i16], [49 x i16], [6 x i16], [49 x i16] }14 15@g0 = internal constant %s.0 { %s.1 { i16 705, i16 0, i32 16 }, ptr @g1, ptr @g2 }, align 416@g1 = private unnamed_addr constant [110 x i8] c"Assertion ............................................................................................ failed\00", align 117@g2 = private unnamed_addr constant [13 x i8] c"............\00", align 118 19define signext i16 @f0(ptr %a0) #0 {20b0:21  %v0 = alloca i16, align 222  %v1 = alloca i16, align 223  %v2 = getelementptr inbounds %s.2, ptr %a0, i32 0, i32 1924  %v3 = load ptr, ptr %v2, align 4, !tbaa !025  %v4 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 12, i32 026  %v5 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 227  %v6 = call signext i16 @f1(ptr %v4, ptr %v5, ptr %a0)28  %v7 = icmp eq i16 %v6, 029  br i1 %v7, label %b1, label %b1330 31b1:                                               ; preds = %b032  %v8 = getelementptr inbounds %s.2, ptr %a0, i32 0, i32 1133  %v9 = load i16, ptr %v8, align 2, !tbaa !434  %v10 = sext i16 %v9 to i3235  %v11 = load i16, ptr %v5, align 2, !tbaa !436  %v12 = sext i16 %v11 to i3237  %v13 = call i32 @llvm.hexagon.A2.subh.l16.sat.ll(i32 %v10, i32 %v12)38  %v14 = trunc i32 %v13 to i1639  %v15 = icmp sgt i16 %v14, 040  br i1 %v15, label %b13, label %b241 42b2:                                               ; preds = %b143  %v16 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 8, i32 144  %v17 = load ptr, ptr %v16, align 4, !tbaa !045  call void @f2(ptr %v17, ptr %v1, ptr %v4, i16 signext %v11, i16 signext %v9)46  %v18 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 8, i32 047  %v19 = load ptr, ptr %v18, align 4, !tbaa !048  %v20 = load ptr, ptr %v16, align 4, !tbaa !049  %v21 = load i16, ptr %v1, align 2, !tbaa !450  call void @f3(ptr %v19, ptr %v0, ptr %v20, i16 signext %v21)51  %v22 = load i16, ptr %v0, align 2, !tbaa !452  store i16 %v22, ptr %v3, align 2, !tbaa !453  %v24 = load i16, ptr %v1, align 2, !tbaa !454  %v25 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 0, i32 155  store i16 %v24, ptr %v25, align 2, !tbaa !456  %v26 = load i16, ptr %v0, align 2, !tbaa !457  %v27 = sext i16 %v26 to i3258  %v28 = icmp slt i16 %v26, 159  br i1 %v28, label %b13, label %b360 61b3:                                               ; preds = %b262  %v29 = call i32 @llvm.hexagon.S2.asr.r.r.sat(i32 48, i32 1)63  %v30 = call i32 @llvm.hexagon.A2.sath(i32 %v29)64  %v31 = shl i32 %v30, 1665  %v32 = ashr exact i32 %v31, 1666  %v33 = call i32 @llvm.hexagon.A2.subh.l16.sat.ll(i32 %v27, i32 %v32)67  %v34 = trunc i32 %v33 to i1668  %v35 = icmp sgt i16 %v34, 069  br i1 %v35, label %b13, label %b470 71b4:                                               ; preds = %b372  %v36 = load ptr, ptr %v18, align 4, !tbaa !073  %v37 = load i16, ptr %v36, align 2, !tbaa !474  %v38 = getelementptr inbounds i16, ptr %v36, i32 %v2775  %v39 = load i16, ptr %v38, align 2, !tbaa !476  %v40 = sext i16 %v37 to i3277  %v41 = call i32 @llvm.hexagon.A2.subh.l16.sat.ll(i32 %v40, i32 32)78  %v42 = trunc i32 %v41 to i1679  %v43 = icmp sgt i16 %v42, 080  br i1 %v43, label %b13, label %b581 82b5:                                               ; preds = %b483  %v44 = sext i16 %v39 to i3284  %v45 = call i32 @llvm.hexagon.A2.subh.l16.sat.ll(i32 %v40, i32 %v44)85  %v46 = and i32 %v45, 3276886  %v47 = icmp eq i32 %v46, 087  br i1 %v47, label %b13, label %b688 89b6:                                               ; preds = %b590  %v48 = load i16, ptr %v1, align 2, !tbaa !491  %v49 = sext i16 %v48 to i3292  %v50 = load ptr, ptr %v16, align 4, !tbaa !093  %v51 = getelementptr inbounds i16, ptr %v50, i32 %v4994  %v52 = load i16, ptr %v51, align 2, !tbaa !495  %v53 = getelementptr inbounds %s.2, ptr %a0, i32 0, i32 1496  %v54 = load i16, ptr %v53, align 2, !tbaa !497  %v55 = icmp eq i16 %v54, 098  br i1 %v55, label %b7, label %b899 100b7:                                               ; preds = %b6101  %v56 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 1102  store i16 1, ptr %v56, align 2, !tbaa !4103  br label %b11104 105b8:                                               ; preds = %b6106  %v57 = load i16, ptr %v50, align 2, !tbaa !4107  %v58 = sext i16 %v57 to i32108  %v59 = sext i16 %v52 to i32109  %v60 = call signext i16 @f4(i32 %v58, i32 %v59)110  %v61 = sext i16 %v60 to i32111  %v62 = call i32 @llvm.hexagon.S2.asr.r.r.sat(i32 %v61, i32 2)112  %v63 = call i32 @llvm.hexagon.A2.sath(i32 %v62)113  %v64 = shl i32 %v63, 16114  %v65 = ashr exact i32 %v64, 16115  %v66 = load i16, ptr %v53, align 2, !tbaa !4116  %v67 = sext i16 %v66 to i32117  %v68 = call i32 @llvm.hexagon.M2.mpy.acc.sat.ll.s1(i32 1024, i32 %v65, i32 %v67)118  %v69 = shl i32 %v68, 16119  %v70 = ashr exact i32 %v69, 16120  %v71 = call i32 @llvm.hexagon.S2.asr.r.r.sat(i32 %v70, i32 1)121  %v72 = call i32 @llvm.hexagon.A2.sath(i32 %v71)122  %v73 = shl i32 %v72, 16123  %v74 = ashr exact i32 %v73, 16124  %v75 = call i32 @llvm.hexagon.S2.asr.r.r.sat(i32 %v74, i32 10)125  %v76 = call i32 @llvm.hexagon.A2.sath(i32 %v75)126  %v77 = shl i32 %v76, 16127  %v78 = ashr exact i32 %v77, 16128  %v79 = sitofp i16 %v66 to float129  %v80 = sitofp i16 %v52 to float130  %v81 = sitofp i16 %v57 to float131  %v82 = fdiv float %v80, %v81132  %v83 = call float @f7(float %v82, i32 0)133  %v84 = fmul float %v79, %v83134  %v85 = fdiv float %v84, 0x3FE62E4300000000135  %v86 = fpext float %v85 to double136  %v87 = fadd double %v86, 5.000000e-01137  %v88 = fptosi double %v87 to i32138  %v89 = icmp eq i32 %v78, %v88139  br i1 %v89, label %b10, label %b9140 141b9:                                               ; preds = %b8142  call void @f5(ptr @g0) #2143  unreachable144 145b10:                                              ; preds = %b8146  %v90 = trunc i32 %v76 to i16147  %v91 = icmp eq i32 %v78, 0148  %v92 = select i1 %v91, i16 1, i16 %v90149  %v93 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 1150  store i16 %v92, ptr %v93, align 2, !tbaa !4151  br label %b11152 153b11:                                              ; preds = %b10, %b7154  %v94 = phi i16 [ %v92, %b10 ], [ 1, %b7 ]155  %v95 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 7156  store i16 %v94, ptr %v95, align 2, !tbaa !4157  %v96 = sext i16 %v94 to i32158  %v97 = call i32 @llvm.hexagon.A2.subh.l16.sat.ll(i32 %v96, i32 5)159  %v98 = trunc i32 %v97 to i16160  %v99 = icmp sgt i16 %v98, 0161  br i1 %v99, label %b13, label %b12162 163b12:                                              ; preds = %b11164  %v100 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 11, i32 0165  %v101 = load ptr, ptr %v18, align 4, !tbaa !0166  %v102 = load i16, ptr %v0, align 2, !tbaa !4167  call void @f6(ptr %v100, i16 signext %v94, ptr %v101, i16 signext %v102)168  %v103 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 3169  store i16 %v37, ptr %v103, align 2, !tbaa !4170  %v104 = getelementptr inbounds %s.3, ptr %v3, i32 0, i32 4171  store i16 %v39, ptr %v104, align 2, !tbaa !4172  br label %b13173 174b13:                                              ; preds = %b12, %b11, %b5, %b4, %b3, %b2, %b1, %b0175  %v105 = phi i16 [ 0, %b12 ], [ -1, %b1 ], [ -1, %b0 ], [ -1, %b3 ], [ -1, %b2 ], [ -1, %b5 ], [ -1, %b4 ], [ -1, %b11 ]176  ret i16 %v105177}178 179declare signext i16 @f1(ptr, ptr, ptr) #0180 181; Function Attrs: nounwind readnone182declare i32 @llvm.hexagon.A2.subh.l16.sat.ll(i32, i32) #1183 184declare void @f2(ptr, ptr, ptr, i16 signext, i16 signext) #0185 186declare void @f3(ptr, ptr, ptr, i16 signext) #0187 188; Function Attrs: nounwind readnone189declare i32 @llvm.hexagon.A2.sath(i32) #1190 191; Function Attrs: nounwind readnone192declare i32 @llvm.hexagon.S2.asr.r.r.sat(i32, i32) #1193 194declare signext i16 @f4(i32, i32) #0195 196; Function Attrs: nounwind readnone197declare i32 @llvm.hexagon.M2.mpy.acc.sat.ll.s1(i32, i32, i32) #1198 199; Function Attrs: noreturn200declare void @f5(ptr) #2201 202declare void @f6(ptr, i16 signext, ptr, i16 signext) #0203 204declare float @f7(float, i32) #0205 206attributes #0 = { nounwind "target-cpu"="hexagonv55" }207attributes #1 = { nounwind readnone }208attributes #2 = { noreturn }209 210!0 = !{!1, !1, i64 0}211!1 = !{!"any pointer", !2}212!2 = !{!"omnipotent char", !3}213!3 = !{!"Simple C/C++ TBAA"}214!4 = !{!5, !5, i64 0}215!5 = !{!"short", !2}216