aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Fischer <greg@lunarg.com>2022-08-23 12:01:32 -0600
committerGitHub <noreply@github.com>2022-08-23 12:01:32 -0600
commitb41e3e1311c22b923435dbd7fb97666c37d4633a (patch)
tree41438bcef7e0135891e9b8f143c2c1fd31046fab
parent3c1a14b2b609ae5a352e39ef6b5baf8f64c32ec7 (diff)
downloadSPIRV-Tools-b41e3e1311c22b923435dbd7fb97666c37d4633a.tar.gz
Disable DebugInfoMgr during the entire CompactIds pass (#4905)
This is because the DebugInfo manager requires valid SPIR-V which is not always true during this pass. Add comment
-rw-r--r--source/opt/compact_ids_pass.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/opt/compact_ids_pass.cpp b/source/opt/compact_ids_pass.cpp
index 70848d79..5a2a54b1 100644
--- a/source/opt/compact_ids_pass.cpp
+++ b/source/opt/compact_ids_pass.cpp
@@ -44,6 +44,11 @@ Pass::Status CompactIdsPass::Process() {
bool modified = false;
std::unordered_map<uint32_t, uint32_t> result_id_mapping;
+ // Disable automatic DebugInfo analysis for the life of the CompactIds pass.
+ // The DebugInfo manager requires the SPIR-V to be valid to run, but this is
+ // not true at all times in CompactIds as it remaps all ids.
+ context()->InvalidateAnalyses(IRContext::kAnalysisDebugInfo);
+
context()->module()->ForEachInst(
[&result_id_mapping, &modified](Instruction* inst) {
auto operand = inst->begin();