brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.5 KiB · c961315 Raw
102 lines · plain
1; RUN: llc -mtriple=hexagon -O2 -fp-contract=fast < %s -pipeliner-experimental-cg=true | FileCheck %s2 3; Test that the memoperands for instructions in the epilog are updated4; correctly. Previously, the pipeliner updated the offset for the memoperands5; in the epilog. But, the value of the offset is incorrect when control flow6; branches around the kernel.7 8; In this test, we check that a load and store to the same location are not9; swapped due to a bad offset in the memoperands. The store and load are both10; to r29+32. If the memoperands are updated incorrectly, these are swapped.11 12; CHECK: [[REG0:r([0-9]+)]] = add(r29,#24)13; CHECK: memw([[REG0]]++#4) = r{{[0-9]+}}14; CHECK: r{{[0-9]+}} = memw(r29+#{{[0-9]+}})15 16%s.0 = type { %s.1 }17%s.1 = type { %s.2 }18%s.2 = type { %s.3 }19%s.3 = type { [9 x float] }20%s.4 = type { %s.5 }21%s.5 = type { %s.6 }22%s.6 = type { %s.7 }23%s.7 = type { [3 x float] }24 25@g0 = external hidden unnamed_addr constant [29 x i8], align 126 27define i32 @f0() unnamed_addr {28b0:29  %v0 = alloca %s.0, align 430  %v1 = alloca %s.4, align 431  %v2 = bitcast ptr %v0 to ptr32  call void @llvm.lifetime.start.p0(i64 36, ptr %v2)33  %v3 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 034  store float 0x3FEFFF7160000000, ptr %v3, align 435  %v4 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 136  store float 0xBF87867F00000000, ptr %v4, align 437  %v5 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 238  store float 0xBF6185CEE0000000, ptr %v5, align 439  %v6 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 340  store float 0x3F8780BAA0000000, ptr %v6, align 441  %v7 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 442  store float 0x3FEFFF5C60000000, ptr %v7, align 443  %v8 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 544  store float 0xBF74717160000000, ptr %v8, align 445  %v9 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 646  store float 0x3F61FF7160000000, ptr %v9, align 447  %v10 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 748  store float 0x3F74573A80000000, ptr %v10, align 449  %v11 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 850  store float 0x3FEFFFE080000000, ptr %v11, align 451  %v12 = bitcast ptr %v1 to ptr52  call void @llvm.lifetime.start.p0(i64 12, ptr %v12)53  br label %b154 55b1:                                               ; preds = %b1, %b056  %v13 = phi i32 [ 0, %b0 ], [ %v29, %b1 ]57  %v14 = mul nuw nsw i32 %v13, 358  %v15 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %v1459  %v16 = load float, ptr %v15, align 460  %v17 = fmul float %v16, 0x3FE7B2B12000000061  %v18 = add nuw nsw i32 %v14, 162  %v19 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %v1863  %v20 = load float, ptr %v19, align 464  %v21 = fmul float %v20, 0x3FDA8BC9C000000065  %v22 = fsub float %v21, %v1766  %v23 = add nuw nsw i32 %v14, 267  %v24 = getelementptr inbounds %s.0, ptr %v0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %v2368  %v25 = load float, ptr %v24, align 469  %v26 = fmul float %v25, 0x40030D670000000070  %v27 = fadd float %v22, %v2671  %v28 = getelementptr inbounds %s.4, ptr %v1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %v1372  store float %v27, ptr %v28, align 473  %v29 = add nuw nsw i32 %v13, 174  %v30 = icmp eq i32 %v29, 375  br i1 %v30, label %b2, label %b176 77b2:                                               ; preds = %b178  %v31 = getelementptr inbounds %s.4, ptr %v1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 079  %v32 = load float, ptr %v31, align 480  %v33 = fpext float %v32 to double81  %v34 = getelementptr inbounds %s.4, ptr %v1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 182  %v35 = load float, ptr %v34, align 483  %v36 = fpext float %v35 to double84  %v37 = getelementptr inbounds %s.4, ptr %v1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 285  %v38 = load float, ptr %v37, align 486  %v39 = fpext float %v38 to double87  %v40 = tail call i32 (ptr, ...) @f1(ptr @g0, double %v33, double %v36, double %v39)88  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %v12)89  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %v2)90  ret i32 091}92 93declare i32 @f1(ptr nocapture readonly, ...) local_unnamed_addr94 95; Function Attrs: argmemonly nounwind96declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #097 98; Function Attrs: argmemonly nounwind99declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #0100 101attributes #0 = { argmemonly nounwind }102