spirv-fuzz: Avoid irrelevant constants in synonym-creating loops (#3967)

Fixes #3956.
This commit is contained in:
Alastair Donaldson 2020-10-21 20:50:45 +01:00 committed by GitHub
parent 26954c281e
commit dc9c6407d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,6 +50,12 @@ void FuzzerPassAddLoopsToCreateIntConstantSynonyms::Apply() {
auto constant = GetIRContext()->get_constant_mgr()->FindDeclaredConstant(
constant_def->result_id());
// We do not consider irrelevant constants
if (GetTransformationContext()->GetFactManager()->IdIsIrrelevant(
constant_def->result_id())) {
continue;
}
// We only consider integer constants (scalar or vector).
if (!constant->AsIntConstant() &&
!(constant->AsVectorConstant() &&