94 lines · plain
1; RUN: llc < %s -mtriple=i386-linux-gnu -mattr=+avx512fp16 -mattr=+avx512vl -o - | FileCheck %s2 3; This test checks that only a single je gets generated in the final code4; for lowering the CMOV pseudos that get created for this IR.5; CHECK-LABEL: foo1:6; CHECK: je7; CHECK-NOT: je8define <8 x half> @foo1(i32 %v1, <8 x half> %v2, <8 x half> %v3, <8 x half> %v4) nounwind {9entry:10 %cmp = icmp eq i32 %v1, 011 %t1 = select i1 %cmp, <8 x half> %v2, <8 x half> %v312 %t2 = select i1 %cmp, <8 x half> %v3, <8 x half> %v413 %sub = fsub <8 x half> %t1, %t214 ret <8 x half> %sub15}16 17; This test checks that only a single ja gets generated in the final code18; for lowering the CMOV pseudos that get created for this IR. This combines19; all the supported types together into one long string of selects based20; on the same condition.21; CHECK-LABEL: foo2:22; CHECK: ja23; CHECK-NOT: ja24define void @foo2(i32 %v1,25 half %v32, half %v33,26 <8 x half> %v52, <8 x half> %v53,27 <16 x half> %v122, <16 x half> %v123,28 <32 x half> %v132, <32 x half> %v133,29 ptr %dst) nounwind {30entry:31 %add.ptr31 = getelementptr inbounds i8, ptr %dst, i32 232 33 %add.ptr51 = getelementptr inbounds i8, ptr %dst, i32 434 35 %add.ptr121 = getelementptr inbounds i8, ptr %dst, i32 2036 37 %add.ptr131 = getelementptr inbounds i8, ptr %dst, i32 5238 39 ; These operations are necessary, because select of two single use loads40 ; ends up getting optimized into a select of two leas, followed by a41 ; single load of the selected address.42 43 %t33 = fadd half %v33, %v3244 %t53 = fadd <8 x half> %v53, %v5245 %t123 = fadd <16 x half> %v123, %v12246 %t133 = fadd <32 x half> %v133, %v13247 48 %cmp = icmp ugt i32 %v1, 3149 %t31 = select i1 %cmp, half %v32, half %t3350 %t51 = select i1 %cmp, <8 x half> %v52, <8 x half> %t5351 %t121 = select i1 %cmp, <16 x half> %v122, <16 x half> %t12352 %t131 = select i1 %cmp, <32 x half> %v132, <32 x half> %t13353 54 store half %t31, ptr %add.ptr31, align 255 store <8 x half> %t51, ptr %add.ptr51, align 1656 store <16 x half> %t121, ptr %add.ptr121, align 3257 store <32 x half> %t131, ptr %add.ptr131, align 6458 59 ret void60}61 62; This test checks that only a single jne gets generated in the final code63; for lowering the CMOV pseudos that get created for this IR.64define dso_local <32 x half> @foo3(<32 x half> %a, <32 x half> %b, i1 zeroext %sign) local_unnamed_addr #0 {65; CHECK-LABEL: foo3:66; CHECK: jne67; CHECK-NOT: jne68entry:69 %spec.select = select i1 %sign, <32 x half> %a, <32 x half> %b70 ret <32 x half> %spec.select71}72 73; This test checks that only a single jne gets generated in the final code74; for lowering the CMOV pseudos that get created for this IR.75define dso_local <16 x half> @foo4(<16 x half> %a, <16 x half> %b, i1 zeroext %sign) local_unnamed_addr #0 {76; CHECK-LABEL: foo4:77; CHECK: jne78; CHECK-NOT: jne79entry:80 %spec.select = select i1 %sign, <16 x half> %a, <16 x half> %b81 ret <16 x half> %spec.select82}83 84; This test checks that only a single jne gets generated in the final code85; for lowering the CMOV pseudos that get created for this IR.86define dso_local <8 x half> @foo5(<8 x half> %a, <8 x half> %b, i1 zeroext %sign) local_unnamed_addr #0 {87; CHECK-LABEL: foo5:88; CHECK: jne89; CHECK-NOT: jne90entry:91 %spec.select = select i1 %sign, <8 x half> %a, <8 x half> %b92 ret <8 x half> %spec.select93}94