reader/spirv: Always run the cleanup transforms

The SPIR-V cleanup transforms were only being run if the
DecomposeStridedMatrix transform needed to be run - despite
the RemoveUnreachableStatements transform needing to be run, always.

Change-Id: I5dc28a79200ab67c96fb793980412a5632e26026
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78780
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2022-02-01 09:09:12 +00:00
committed by Tint LUCI CQ
parent f67b6373a6
commit 5416d9ba2a
3 changed files with 230 additions and 243 deletions

View File

@@ -50,18 +50,12 @@ Program Parse(const std::vector<uint32_t>& input) {
return program;
}
// If the generated program contains matrices with a custom MatrixStride
// attribute then we need to decompose these into an array of vectors
if (transform::DecomposeStridedMatrix().ShouldRun(&program)) {
transform::Manager manager;
manager.Add<transform::Unshadow>();
manager.Add<transform::SimplifyPointers>();
manager.Add<transform::DecomposeStridedMatrix>();
manager.Add<transform::RemoveUnreachableStatements>();
return manager.Run(&program).program;
}
return program;
transform::Manager manager;
manager.Add<transform::Unshadow>();
manager.Add<transform::SimplifyPointers>();
manager.Add<transform::DecomposeStridedMatrix>();
manager.Add<transform::RemoveUnreachableStatements>();
return manager.Run(&program).program;
}
} // namespace spirv