Skip to content

Commit ed8bd04

Browse files
authored
Do not use PropagateLineInfoPass and RedundantLineInfoElimPass (KhronosGroup#2440)
* Do not use PropagateLineInfoPass and RedundantLineInfoElimPass Since spirv-opt will remove PropagateLineInfoPass and RedundantLineInfoElimPass, glslang should not use it. spirv-opt will propagate the line instructions and eliminate the redundant lines by default in IR loading/emission. * Update known_good.json for spirv-tool
1 parent 142cb87 commit ed8bd04

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

SPIRV/SpvTools.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,7 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
174174
// line information into all SPIR-V instructions. This avoids loss of
175175
// information when instructions are deleted or moved. Later, remove
176176
// redundant information to minimize final SPRIR-V size.
177-
if (options->generateDebugInfo) {
178-
optimizer.RegisterPass(spvtools::CreatePropagateLineInfoPass());
179-
}
180-
else if (options->stripDebugInfo) {
177+
if (options->stripDebugInfo) {
181178
optimizer.RegisterPass(spvtools::CreateStripDebugInfoPass());
182179
}
183180
optimizer.RegisterPass(spvtools::CreateWrapOpKillPass());
@@ -207,9 +204,6 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
207204
}
208205
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
209206
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
210-
if (options->generateDebugInfo) {
211-
optimizer.RegisterPass(spvtools::CreateRedundantLineInfoElimPass());
212-
}
213207

214208
spvtools::OptimizerOptions spvOptOptions;
215209
optimizer.SetTargetEnv(MapToSpirvToolsEnv(intermediate.getSpv(), logger));

known_good.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"site" : "github",
66
"subrepo" : "KhronosGroup/SPIRV-Tools",
77
"subdir" : "External/spirv-tools",
8-
"commit" : "a1d38174b1f7d2651c718ae661886d606cb50a32"
8+
"commit" : "56d0f50357a192602216bfc4873e714905323e35"
99
},
1010
{
1111
"name" : "spirv-tools/external/spirv-headers",

0 commit comments

Comments
 (0)