From dc9c6407d622246be341885405da1b268de17b8c Mon Sep 17 00:00:00 2001 From: Alastair Donaldson Date: Wed, 21 Oct 2020 20:50:45 +0100 Subject: [PATCH] spirv-fuzz: Avoid irrelevant constants in synonym-creating loops (#3967) Fixes #3956. --- ...uzzer_pass_add_loops_to_create_int_constant_synonyms.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp b/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp index 1b286dd1..ee05b684 100644 --- a/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp +++ b/source/fuzz/fuzzer_pass_add_loops_to_create_int_constant_synonyms.cpp @@ -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() &&