MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / TEST

Function TEST

test/opt/loop_optimizations/dependence_analysis.cpp:49–170  ·  view source on GitHub ↗

Generated from the following GLSL fragment shader with --eliminate-local-multi-store #version 440 core void main(){ int[10] arr; int[10] arr2; int a = 2; for (int i = 0; i < 10; i++) { arr[a] = arr[3]; arr[a*2] = arr[a+3]; arr[6] = arr2[6]; arr[a+5] = arr2[7]; } } */

Source from the content-addressed store, hash-verified

47}
48*/
49TEST(DependencyAnalysis, ZIV) {
50 const std::string text = R"( OpCapability Shader
51 %1 = OpExtInstImport "GLSL.std.450"
52 OpMemoryModel Logical GLSL450
53 OpEntryPoint Fragment %4 "main"
54 OpExecutionMode %4 OriginUpperLeft
55 OpSource GLSL 440
56 OpName %4 "main"
57 OpName %25 "arr"
58 OpName %39 "arr2"
59 %2 = OpTypeVoid
60 %3 = OpTypeFunction %2
61 %6 = OpTypeInt 32 1
62 %7 = OpTypePointer Function %6
63 %9 = OpConstant %6 2
64 %11 = OpConstant %6 0
65 %18 = OpConstant %6 10
66 %19 = OpTypeBool
67 %21 = OpTypeInt 32 0
68 %22 = OpConstant %21 10
69 %23 = OpTypeArray %6 %22
70 %24 = OpTypePointer Function %23
71 %27 = OpConstant %6 3
72 %38 = OpConstant %6 6
73 %44 = OpConstant %6 5
74 %46 = OpConstant %6 7
75 %51 = OpConstant %6 1
76 %4 = OpFunction %2 None %3
77 %5 = OpLabel
78 %25 = OpVariable %24 Function
79 %39 = OpVariable %24 Function
80 OpBranch %12
81 %12 = OpLabel
82 %53 = OpPhi %6 %11 %5 %52 %15
83 OpLoopMerge %14 %15 None
84 OpBranch %16
85 %16 = OpLabel
86 %20 = OpSLessThan %19 %53 %18
87 OpBranchConditional %20 %13 %14
88 %13 = OpLabel
89 %28 = OpAccessChain %7 %25 %27
90 %29 = OpLoad %6 %28
91 %30 = OpAccessChain %7 %25 %9
92 OpStore %30 %29
93 %32 = OpIMul %6 %9 %9
94 %34 = OpIAdd %6 %9 %27
95 %35 = OpAccessChain %7 %25 %34
96 %36 = OpLoad %6 %35
97 %37 = OpAccessChain %7 %25 %32
98 OpStore %37 %36
99 %40 = OpAccessChain %7 %39 %38
100 %41 = OpLoad %6 %40
101 %42 = OpAccessChain %7 %25 %38
102 OpStore %42 %41
103 %45 = OpIAdd %6 %9 %44
104 %47 = OpAccessChain %7 %39 %46
105 %48 = OpLoad %6 %47
106 %49 = OpAccessChain %7 %25 %45

Callers

nothing calls this directly

Calls 15

GetFunctionFunction · 0.85
GetBasicBlockFunction · 0.85
DistanceEntryClass · 0.85
DistanceVectorClass · 0.85
PartitionSubscriptsFunction · 0.85
getMethod · 0.80
GetDependenceMethod · 0.80
SetDebugStreamMethod · 0.80
GetScalarEvolutionMethod · 0.80
IntersectConstraintsMethod · 0.80
AsDependencePointMethod · 0.80

Tested by

no test coverage detected