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

Function TEST_F

test/opt/loop_optimizations/loop_fission.cpp:62–204  ·  view source on GitHub ↗

Generated from the following GLSL #version 430 void main(void) { float A[10]; float B[10]; for (int i = 0; i < 10; i++) { A[i] = B[i]; B[i] = A[i]; } } Result should be equivalent to: void main(void) { float A[10]; float B[10]; for (int i = 0; i < 10; i++) { A[i] = B[i]; } for (int i = 0; i < 10; i++) { B[i] = A[i]; } } *

Source from the content-addressed store, hash-verified

60}
61*/
62TEST_F(FissionClassTest, SimpleFission) {
63 // clang-format off
64 // With LocalMultiStoreElimPass
65const std::string source = R"(OpCapability Shader
66%1 = OpExtInstImport "GLSL.std.450"
67OpMemoryModel Logical GLSL450
68OpEntryPoint Fragment %2 "main"
69OpExecutionMode %2 OriginUpperLeft
70OpSource GLSL 430
71OpName %2 "main"
72OpName %3 "i"
73OpName %4 "A"
74OpName %5 "B"
75%6 = OpTypeVoid
76%7 = OpTypeFunction %6
77%8 = OpTypeInt 32 1
78%9 = OpTypePointer Function %8
79%10 = OpConstant %8 0
80%11 = OpConstant %8 10
81%12 = OpTypeBool
82%13 = OpTypeFloat 32
83%14 = OpTypeInt 32 0
84%15 = OpConstant %14 10
85%16 = OpTypeArray %13 %15
86%17 = OpTypePointer Function %16
87%18 = OpTypePointer Function %13
88%19 = OpConstant %8 1
89%2 = OpFunction %6 None %7
90%20 = OpLabel
91%3 = OpVariable %9 Function
92%4 = OpVariable %17 Function
93%5 = OpVariable %17 Function
94OpBranch %21
95%21 = OpLabel
96%22 = OpPhi %8 %10 %20 %23 %24
97OpLoopMerge %25 %24 None
98OpBranch %26
99%26 = OpLabel
100%27 = OpSLessThan %12 %22 %11
101OpBranchConditional %27 %28 %25
102%28 = OpLabel
103%29 = OpAccessChain %18 %5 %22
104%30 = OpLoad %13 %29
105%31 = OpAccessChain %18 %4 %22
106OpStore %31 %30
107%32 = OpAccessChain %18 %4 %22
108%33 = OpLoad %13 %32
109%34 = OpAccessChain %18 %5 %22
110OpStore %34 %33
111OpBranch %24
112%24 = OpLabel
113%23 = OpIAdd %8 %22 %19
114OpBranch %21
115%25 = OpLabel
116OpReturn
117OpFunctionEnd
118)";
119

Callers

nothing calls this directly

Calls 10

GetFunctionFunction · 0.85
NumLoopsMethod · 0.80
NumImmediateChildrenMethod · 0.80
pre_beginMethod · 0.80
SetContextForTestingMethod · 0.80
getMethod · 0.80
BuildModuleFunction · 0.50
moduleMethod · 0.45
GetLoopDescriptorMethod · 0.45
ProcessMethod · 0.45

Tested by

no test coverage detected