mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-24 04:20:13 +00:00
56d0f50357
Based on the OpLine spec, an OpLine instruction must be applied to the instructions physically following it up to the first occurrence of the next end of block, the next OpLine instruction, or the next OpNoLine instruction. ``` OpLine %file 0 0 OpNoLine OpLine %file 1 1 OpStore %foo %int_1 %value = OpLoad %int %foo OpLine %file 2 2 ``` For the above code, the current spirv-opt keeps three line instructions `OpLine %file 0 0`, `OpNoLine`, and `OpLine %file 1 1` in `std::vector<Instruction> dbg_line_insts_` of Instruction class for `OpStore %foo %int_1`. It does not put any line instruction to `std::vector<Instruction> dbg_line_insts_` of `%value = OpLoad %int %foo` even though `OpLine %file 1 1` must be applied to `%value = OpLoad %int %foo` based on the spec. This results in the missing line information for `%value = OpLoad %int %foo` while each spirv-opt pass optimizes the code. We have to put `OpLine %file 1 1` to `std::vector<Instruction> dbg_line_insts_` of both `%value = OpLoad %int %foo` and `OpStore %foo %int_1`. This commit conducts the line instruction propagation and skips emitting the eliminated line instructions at the end, which are the same with PropagateLineInfoPass and RedundantLineInfoElimPass. This commit removes PropagateLineInfoPass and RedundantLineInfoElimPass. KhronosGroup/glslang#2440 is a related PR that stop using PropagateLineInfoPass and RedundantLineInfoElimPass from glslang. When the code in this PR applied, the glslang tests will pass. |
||
---|---|---|
.. | ||
fuzz | ||
link | ||
opt | ||
reduce | ||
util | ||
val | ||
assembly_grammar.cpp | ||
assembly_grammar.h | ||
binary.cpp | ||
binary.h | ||
cfa.h | ||
CMakeLists.txt | ||
diagnostic.cpp | ||
diagnostic.h | ||
disassemble.cpp | ||
disassemble.h | ||
enum_set.h | ||
enum_string_mapping.cpp | ||
enum_string_mapping.h | ||
ext_inst.cpp | ||
ext_inst.h | ||
extensions.cpp | ||
extensions.h | ||
instruction.h | ||
latest_version_glsl_std_450_header.h | ||
latest_version_opencl_std_header.h | ||
latest_version_spirv_header.h | ||
libspirv.cpp | ||
macro.h | ||
name_mapper.cpp | ||
name_mapper.h | ||
opcode.cpp | ||
opcode.h | ||
operand.cpp | ||
operand.h | ||
parsed_operand.cpp | ||
parsed_operand.h | ||
pch_source.cpp | ||
pch_source.h | ||
print.cpp | ||
print.h | ||
software_version.cpp | ||
spirv_constant.h | ||
spirv_definition.h | ||
spirv_endian.cpp | ||
spirv_endian.h | ||
spirv_fuzzer_options.cpp | ||
spirv_fuzzer_options.h | ||
spirv_optimizer_options.cpp | ||
spirv_optimizer_options.h | ||
spirv_reducer_options.cpp | ||
spirv_reducer_options.h | ||
spirv_target_env.cpp | ||
spirv_target_env.h | ||
spirv_validator_options.cpp | ||
spirv_validator_options.h | ||
table.cpp | ||
table.h | ||
text_handler.cpp | ||
text_handler.h | ||
text.cpp | ||
text.h |