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 correct
3 ; positions, and don't break rules of instruction domination and PHI nodes
4 ; grouping at top of basic block.
6 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
7 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
16 define spir_kernel void @foo(ptr addrspace(1) %_arg1) {
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, 3
25 br i1 %c1, label %l2, label %exit
28 %r3 = zext nneg i32 %r1 to i64
29 %r4 = getelementptr inbounds double, ptr addrspace(1) %_arg1, i64 %r3
30 %r5 = load double, ptr addrspace(1) %r4, align 8
31 %ins = insertelement <3 x double> %in, double %r5, i32 %r1
32 %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, 1