mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2025-01-13 18:00:05 +00:00
spirv-fuzz: Do not add synonym-creating loops in dead blocks (#3975)
Fixes #3954.
This commit is contained in:
parent
64eaa9832f
commit
88f7bcb6af
@ -72,10 +72,15 @@ void FuzzerPassAddLoopsToCreateIntConstantSynonyms::Apply() {
|
||||
// synonym. We cannot apply the transformation while iterating over the
|
||||
// module, because we are going to add new blocks.
|
||||
for (auto& function : *GetIRContext()->module()) {
|
||||
// Consider all blocks reachable from the first block of the function.
|
||||
// Consider all non-dead blocks reachable from the first block of the
|
||||
// function.
|
||||
GetIRContext()->cfg()->ForEachBlockInPostOrder(
|
||||
&*function.begin(),
|
||||
[&blocks](opt::BasicBlock* block) { blocks.push_back(block->id()); });
|
||||
&*function.begin(), [this, &blocks](opt::BasicBlock* block) {
|
||||
if (!GetTransformationContext()->GetFactManager()->BlockIsDead(
|
||||
block->id())) {
|
||||
blocks.push_back(block->id());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Make sure that the module has an OpTypeBool instruction, and 32-bit signed
|
||||
|
Loading…
Reference in New Issue
Block a user