Don't remove SPIR-V blocks before codegen.
A removed block releases its instructions, so Module::idToInstruction suddenly contains dangling references. The original motivation for block removal was to skip some unreachable blocks, but that's already achieved by InReadableOrder.cpp. Also updated stale comments.
This commit is contained in:
@@ -205,12 +205,6 @@ public:
|
||||
|
||||
void dump(std::vector<unsigned int>& out) const
|
||||
{
|
||||
// skip the degenerate unreachable blocks
|
||||
// TODO: code gen: skip all unreachable blocks (transitive closure)
|
||||
// (but, until that's done safer to keep non-degenerate unreachable blocks, in case others depend on something)
|
||||
if (unreachable && instructions.size() <= 2)
|
||||
return;
|
||||
|
||||
instructions[0]->dump(out);
|
||||
for (int i = 0; i < (int)localVariables.size(); ++i)
|
||||
localVariables[i]->dump(out);
|
||||
|
||||
Reference in New Issue
Block a user