40 lines · plain
1; The goal of the test is to check that newly inserted internal (spv)2; intrinsic functions for PHI's operands are inserted at the correct3; positions, and don't break rules of instruction domination and PHI nodes4; grouping at top of basic block.5 6; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s7; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}8 9; CHECK: OpFunction10; CHECK: OpBranch11; CHECK: OpLabel12; CHECK: OpPhi13; CHECK: OpPhi14; CHECK: OpPhi15 16define spir_kernel void @foo(ptr addrspace(1) %_arg1) {17entry:18 br label %l119 20l1:21 %sw = phi <4 x double> [ %vec, %l2 ], [ <double 0.0, double 0.0, double 0.0, double poison>, %entry ]22 %in = phi <3 x double> [ %ins, %l2 ], [ zeroinitializer, %entry ]23 %r1 = phi i32 [ %r2, %l2 ], [ 0, %entry ]24 %c1 = icmp ult i32 %r1, 325 br i1 %c1, label %l2, label %exit26 27l2:28 %r3 = zext nneg i32 %r1 to i6429 %r4 = getelementptr inbounds double, ptr addrspace(1) %_arg1, i64 %r330 %r5 = load double, ptr addrspace(1) %r4, align 831 %ins = insertelement <3 x double> %in, double %r5, i32 %r132 %exp = shufflevector <3 x double> %ins, <3 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>33 %vec = shufflevector <4 x double> %exp, <4 x double> %sw, <4 x i32> <i32 0, i32 1, i32 2, i32 7>34 %r2 = add nuw nsw i32 %r1, 135 br label %l136 37exit:38 ret void39}40