spirv-fuzz: Report fresh ids in transformations (#3856)
Adds a virtual method, GetFreshIds(), to Transformation. Every transformation uses this to indicate which ids in its protobuf message are fresh ids. This means that when replaying a sequence of transformations the replayer can obtain a smallest id that is not in use by the module already and that will not be used by any transformation by necessity. Ids greater than or equal to this id can be used as overflow ids. Fixes #3851.
This commit is contained in:
Родитель
c6ca885c0b
Коммит
fcb22ecf0f
|
@ -18,13 +18,19 @@ namespace spvtools {
|
||||||
namespace fuzz {
|
namespace fuzz {
|
||||||
|
|
||||||
CounterOverflowIdSource::CounterOverflowIdSource(uint32_t first_available_id)
|
CounterOverflowIdSource::CounterOverflowIdSource(uint32_t first_available_id)
|
||||||
: next_available_id_(first_available_id) {}
|
: next_available_id_(first_available_id), issued_ids_() {}
|
||||||
|
|
||||||
bool CounterOverflowIdSource::HasOverflowIds() const { return true; }
|
bool CounterOverflowIdSource::HasOverflowIds() const { return true; }
|
||||||
|
|
||||||
uint32_t CounterOverflowIdSource::GetNextOverflowId() {
|
uint32_t CounterOverflowIdSource::GetNextOverflowId() {
|
||||||
|
issued_ids_.insert(next_available_id_);
|
||||||
return next_available_id_++;
|
return next_available_id_++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::unordered_set<uint32_t>&
|
||||||
|
CounterOverflowIdSource::GetIssuedOverflowIds() const {
|
||||||
|
return issued_ids_;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -35,8 +35,12 @@ class CounterOverflowIdSource : public OverflowIdSource {
|
||||||
// account for the case where the maximum allowed id is reached.
|
// account for the case where the maximum allowed id is reached.
|
||||||
uint32_t GetNextOverflowId() override;
|
uint32_t GetNextOverflowId() override;
|
||||||
|
|
||||||
|
const std::unordered_set<uint32_t>& GetIssuedOverflowIds() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t next_available_id_;
|
uint32_t next_available_id_;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> issued_ids_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#define SOURCE_FUZZ_OVERFLOW_ID_SOURCE_H_
|
#define SOURCE_FUZZ_OVERFLOW_ID_SOURCE_H_
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
namespace spvtools {
|
namespace spvtools {
|
||||||
namespace fuzz {
|
namespace fuzz {
|
||||||
|
@ -98,6 +99,10 @@ class OverflowIdSource {
|
||||||
// Precondition: HasOverflowIds() must hold. Returns the next available
|
// Precondition: HasOverflowIds() must hold. Returns the next available
|
||||||
// overflow id.
|
// overflow id.
|
||||||
virtual uint32_t GetNextOverflowId() = 0;
|
virtual uint32_t GetNextOverflowId() = 0;
|
||||||
|
|
||||||
|
// Returns the set of overflow ids from this source that have been previously
|
||||||
|
// issued via calls to GetNextOverflowId().
|
||||||
|
virtual const std::unordered_set<uint32_t>& GetIssuedOverflowIds() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
|
|
|
@ -738,11 +738,12 @@ message TransformationAddFunction {
|
||||||
// Id of an existing global value with the same return type as the function
|
// Id of an existing global value with the same return type as the function
|
||||||
// that can be used to replace OpKill and OpReachable instructions with
|
// that can be used to replace OpKill and OpReachable instructions with
|
||||||
// ReturnValue instructions. Ignored if the function has void return type.
|
// ReturnValue instructions. Ignored if the function has void return type.
|
||||||
|
// Only relevant if |is_livesafe| holds.
|
||||||
uint32 kill_unreachable_return_value_id = 6;
|
uint32 kill_unreachable_return_value_id = 6;
|
||||||
|
|
||||||
// A mapping (represented as a sequence) from every access chain result id in
|
// A mapping (represented as a sequence) from every access chain result id in
|
||||||
// the function to the ids required to clamp its indices to ensure they are in
|
// the function to the ids required to clamp its indices to ensure they are in
|
||||||
// bounds.
|
// bounds; only relevant if |is_livesafe| holds.
|
||||||
repeated AccessChainClampingInfo access_chain_clamping_info = 7;
|
repeated AccessChainClampingInfo access_chain_clamping_info = 7;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
#include "source/fuzz/replayer.h"
|
#include "source/fuzz/replayer.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
@ -33,15 +34,14 @@ Replayer::Replayer(
|
||||||
const std::vector<uint32_t>& binary_in,
|
const std::vector<uint32_t>& binary_in,
|
||||||
const protobufs::FactSequence& initial_facts,
|
const protobufs::FactSequence& initial_facts,
|
||||||
const protobufs::TransformationSequence& transformation_sequence_in,
|
const protobufs::TransformationSequence& transformation_sequence_in,
|
||||||
uint32_t num_transformations_to_apply, uint32_t first_overflow_id,
|
uint32_t num_transformations_to_apply, bool validate_during_replay,
|
||||||
bool validate_during_replay, spv_validator_options validator_options)
|
spv_validator_options validator_options)
|
||||||
: target_env_(target_env),
|
: target_env_(target_env),
|
||||||
consumer_(std::move(consumer)),
|
consumer_(std::move(consumer)),
|
||||||
binary_in_(binary_in),
|
binary_in_(binary_in),
|
||||||
initial_facts_(initial_facts),
|
initial_facts_(initial_facts),
|
||||||
transformation_sequence_in_(transformation_sequence_in),
|
transformation_sequence_in_(transformation_sequence_in),
|
||||||
num_transformations_to_apply_(num_transformations_to_apply),
|
num_transformations_to_apply_(num_transformations_to_apply),
|
||||||
first_overflow_id_(first_overflow_id),
|
|
||||||
validate_during_replay_(validate_during_replay),
|
validate_during_replay_(validate_during_replay),
|
||||||
validator_options_(validator_options) {}
|
validator_options_(validator_options) {}
|
||||||
|
|
||||||
|
@ -90,13 +90,24 @@ Replayer::ReplayerResult Replayer::Run() {
|
||||||
last_valid_binary = binary_in_;
|
last_valid_binary = binary_in_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We find the smallest id that is (a) not in use by the original module, and
|
||||||
|
// (b) not used by any transformation in the sequence to be replayed. This
|
||||||
|
// serves as a starting id from which to issue overflow ids if they are
|
||||||
|
// required during replay.
|
||||||
|
uint32_t first_overflow_id = ir_context->module()->id_bound();
|
||||||
|
for (auto& transformation : transformation_sequence_in_.transformation()) {
|
||||||
|
auto fresh_ids = Transformation::FromMessage(transformation)->GetFreshIds();
|
||||||
|
if (!fresh_ids.empty()) {
|
||||||
|
first_overflow_id =
|
||||||
|
std::max(first_overflow_id,
|
||||||
|
*std::max_element(fresh_ids.begin(), fresh_ids.end()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<TransformationContext> transformation_context =
|
std::unique_ptr<TransformationContext> transformation_context =
|
||||||
first_overflow_id_ == 0
|
MakeUnique<TransformationContext>(
|
||||||
? MakeUnique<TransformationContext>(
|
MakeUnique<FactManager>(ir_context.get()), validator_options_,
|
||||||
MakeUnique<FactManager>(ir_context.get()), validator_options_)
|
MakeUnique<CounterOverflowIdSource>(first_overflow_id));
|
||||||
: MakeUnique<TransformationContext>(
|
|
||||||
MakeUnique<FactManager>(ir_context.get()), validator_options_,
|
|
||||||
MakeUnique<CounterOverflowIdSource>(first_overflow_id_));
|
|
||||||
transformation_context->GetFactManager()->AddFacts(consumer_, initial_facts_);
|
transformation_context->GetFactManager()->AddFacts(consumer_, initial_facts_);
|
||||||
|
|
||||||
// We track the largest id bound observed, to ensure that it only increases
|
// We track the largest id bound observed, to ensure that it only increases
|
||||||
|
|
|
@ -50,8 +50,7 @@ class Replayer {
|
||||||
const std::vector<uint32_t>& binary_in,
|
const std::vector<uint32_t>& binary_in,
|
||||||
const protobufs::FactSequence& initial_facts,
|
const protobufs::FactSequence& initial_facts,
|
||||||
const protobufs::TransformationSequence& transformation_sequence_in,
|
const protobufs::TransformationSequence& transformation_sequence_in,
|
||||||
uint32_t num_transformations_to_apply, uint32_t first_overflow_id,
|
uint32_t num_transformations_to_apply, bool validate_during_replay,
|
||||||
bool validate_during_replay,
|
|
||||||
spv_validator_options validator_options);
|
spv_validator_options validator_options);
|
||||||
|
|
||||||
// Disables copy/move constructor/assignment operations.
|
// Disables copy/move constructor/assignment operations.
|
||||||
|
@ -67,11 +66,6 @@ class Replayer {
|
||||||
// the input binary and the context in which it will execute are provided via
|
// the input binary and the context in which it will execute are provided via
|
||||||
// |initial_facts_|.
|
// |initial_facts_|.
|
||||||
//
|
//
|
||||||
// |first_overflow_id_| should be set to 0 if overflow ids are not available
|
|
||||||
// during replay. Otherwise |first_overflow_id_| must be larger than any id
|
|
||||||
// referred to in |binary_in_| or |transformation_sequence_in_|, and overflow
|
|
||||||
// ids will be available during replay starting from this value.
|
|
||||||
//
|
|
||||||
// On success, returns a successful result status together with the
|
// On success, returns a successful result status together with the
|
||||||
// transformations that were applied, the IR for the transformed module, and
|
// transformations that were applied, the IR for the transformed module, and
|
||||||
// the transformation context that arises from applying these transformations.
|
// the transformation context that arises from applying these transformations.
|
||||||
|
@ -98,10 +92,6 @@ class Replayer {
|
||||||
// The number of transformations that should be replayed.
|
// The number of transformations that should be replayed.
|
||||||
const uint32_t num_transformations_to_apply_;
|
const uint32_t num_transformations_to_apply_;
|
||||||
|
|
||||||
// Zero if overflow ids are not available, otherwise hold the value of the
|
|
||||||
// smallest id that may be used for overflow purposes.
|
|
||||||
const uint32_t first_overflow_id_;
|
|
||||||
|
|
||||||
// Controls whether the validator should be run after every replay step.
|
// Controls whether the validator should be run after every replay step.
|
||||||
const bool validate_during_replay_;
|
const bool validate_during_replay_;
|
||||||
|
|
||||||
|
|
|
@ -109,8 +109,7 @@ Shrinker::ShrinkerResult Shrinker::Run() {
|
||||||
transformation_sequence_in_,
|
transformation_sequence_in_,
|
||||||
static_cast<uint32_t>(
|
static_cast<uint32_t>(
|
||||||
transformation_sequence_in_.transformation_size()),
|
transformation_sequence_in_.transformation_size()),
|
||||||
/* No overflow ids */ 0, validate_during_replay_,
|
validate_during_replay_, validator_options_)
|
||||||
validator_options_)
|
|
||||||
.Run();
|
.Run();
|
||||||
if (initial_replay_result.status !=
|
if (initial_replay_result.status !=
|
||||||
Replayer::ReplayerResultStatus::kComplete) {
|
Replayer::ReplayerResultStatus::kComplete) {
|
||||||
|
@ -135,12 +134,6 @@ Shrinker::ShrinkerResult Shrinker::Run() {
|
||||||
std::vector<uint32_t>(), protobufs::TransformationSequence()};
|
std::vector<uint32_t>(), protobufs::TransformationSequence()};
|
||||||
}
|
}
|
||||||
|
|
||||||
// The largest id used by the module before any shrinking has been applied
|
|
||||||
// serves as the first id that can be used for overflow purposes.
|
|
||||||
const uint32_t first_overflow_id = GetIdBound(current_best_binary);
|
|
||||||
assert(first_overflow_id >= GetIdBound(binary_in_) &&
|
|
||||||
"Applying transformations should only increase a module's id bound.");
|
|
||||||
|
|
||||||
uint32_t attempt = 0; // Keeps track of the number of shrink attempts that
|
uint32_t attempt = 0; // Keeps track of the number of shrink attempts that
|
||||||
// have been tried, whether successful or not.
|
// have been tried, whether successful or not.
|
||||||
|
|
||||||
|
@ -202,7 +195,7 @@ Shrinker::ShrinkerResult Shrinker::Run() {
|
||||||
transformations_with_chunk_removed,
|
transformations_with_chunk_removed,
|
||||||
static_cast<uint32_t>(
|
static_cast<uint32_t>(
|
||||||
transformations_with_chunk_removed.transformation_size()),
|
transformations_with_chunk_removed.transformation_size()),
|
||||||
first_overflow_id, validate_during_replay_, validator_options_)
|
validate_during_replay_, validator_options_)
|
||||||
.Run();
|
.Run();
|
||||||
if (replay_result.status != Replayer::ReplayerResultStatus::kComplete) {
|
if (replay_result.status != Replayer::ReplayerResultStatus::kComplete) {
|
||||||
// Replay should not fail; if it does, we need to abort shrinking.
|
// Replay should not fail; if it does, we need to abort shrinking.
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#define SOURCE_FUZZ_TRANSFORMATION_H_
|
#define SOURCE_FUZZ_TRANSFORMATION_H_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
|
#include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
|
||||||
#include "source/fuzz/transformation_context.h"
|
#include "source/fuzz/transformation_context.h"
|
||||||
|
@ -58,6 +59,13 @@ namespace fuzz {
|
||||||
|
|
||||||
class Transformation {
|
class Transformation {
|
||||||
public:
|
public:
|
||||||
|
virtual ~Transformation();
|
||||||
|
|
||||||
|
// Factory method to obtain a transformation object from the protobuf
|
||||||
|
// representation of a transformation given by |message|.
|
||||||
|
static std::unique_ptr<Transformation> FromMessage(
|
||||||
|
const protobufs::Transformation& message);
|
||||||
|
|
||||||
// A precondition that determines whether the transformation can be cleanly
|
// A precondition that determines whether the transformation can be cleanly
|
||||||
// applied in a semantics-preserving manner to the SPIR-V module given by
|
// applied in a semantics-preserving manner to the SPIR-V module given by
|
||||||
// |ir_context|, in the presence of facts and other contextual information
|
// |ir_context|, in the presence of facts and other contextual information
|
||||||
|
@ -77,16 +85,13 @@ class Transformation {
|
||||||
virtual void Apply(opt::IRContext* ir_context,
|
virtual void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const = 0;
|
TransformationContext* transformation_context) const = 0;
|
||||||
|
|
||||||
|
// Returns the set of fresh ids that appear in the transformation's protobuf
|
||||||
|
// message.
|
||||||
|
virtual std::unordered_set<uint32_t> GetFreshIds() const = 0;
|
||||||
|
|
||||||
// Turns the transformation into a protobuf message for serialization.
|
// Turns the transformation into a protobuf message for serialization.
|
||||||
virtual protobufs::Transformation ToMessage() const = 0;
|
virtual protobufs::Transformation ToMessage() const = 0;
|
||||||
|
|
||||||
virtual ~Transformation();
|
|
||||||
|
|
||||||
// Factory method to obtain a transformation object from the protobuf
|
|
||||||
// representation of a transformation given by |message|.
|
|
||||||
static std::unique_ptr<Transformation> FromMessage(
|
|
||||||
const protobufs::Transformation& message);
|
|
||||||
|
|
||||||
// Helper that returns true if and only if (a) |id| is a fresh id for the
|
// Helper that returns true if and only if (a) |id| is a fresh id for the
|
||||||
// module, and (b) |id| is not in |ids_used_by_this_transformation|, a set of
|
// module, and (b) |id| is not in |ids_used_by_this_transformation|, a set of
|
||||||
// ids already known to be in use by a transformation. This is useful when
|
// ids already known to be in use by a transformation. This is useful when
|
||||||
|
|
|
@ -407,5 +407,14 @@ bool TransformationAccessChain::ValidIndexToComposite(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAccessChain::GetFreshIds() const {
|
||||||
|
std::unordered_set<uint32_t> result = {message_.fresh_id()};
|
||||||
|
for (auto& fresh_ids_for_clamping : message_.fresh_ids_for_clamping()) {
|
||||||
|
result.insert(fresh_ids_for_clamping.first());
|
||||||
|
result.insert(fresh_ids_for_clamping.second());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -76,6 +76,8 @@ class TransformationAccessChain : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -230,5 +230,14 @@ void TransformationAddBitInstructionSynonym::AddOpBitwiseOrOpNotSynonym(
|
||||||
MakeDataDescriptor(bit_instruction->result_id(), {}));
|
MakeDataDescriptor(bit_instruction->result_id(), {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t>
|
||||||
|
TransformationAddBitInstructionSynonym::GetFreshIds() const {
|
||||||
|
std::unordered_set<uint32_t> result;
|
||||||
|
for (auto id : message_.fresh_ids()) {
|
||||||
|
result.insert(id);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -120,6 +120,8 @@ class TransformationAddBitInstructionSynonym : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Returns the number of fresh ids required to apply the transformation.
|
// Returns the number of fresh ids required to apply the transformation.
|
||||||
|
|
|
@ -63,5 +63,10 @@ protobufs::Transformation TransformationAddConstantBoolean::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddConstantBoolean::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -44,6 +44,8 @@ class TransformationAddConstantBoolean : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -133,5 +133,10 @@ protobufs::Transformation TransformationAddConstantComposite::ToMessage()
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddConstantComposite::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -50,6 +50,8 @@ class TransformationAddConstantComposite : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -62,5 +62,10 @@ protobufs::Transformation TransformationAddConstantNull::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddConstantNull::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -42,6 +42,8 @@ class TransformationAddConstantNull : public Transformation {
|
||||||
void Apply(opt::IRContext* context,
|
void Apply(opt::IRContext* context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -90,5 +90,10 @@ protobufs::Transformation TransformationAddConstantScalar::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddConstantScalar::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -47,6 +47,8 @@ class TransformationAddConstantScalar : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -189,5 +189,9 @@ bool TransformationAddCopyMemory::CanUsePointeeWithCopyMemory(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddCopyMemory::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -54,6 +54,8 @@ class TransformationAddCopyMemory : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Returns true if we can copy memory from |instruction| using OpCopyMemory.
|
// Returns true if we can copy memory from |instruction| using OpCopyMemory.
|
||||||
|
|
|
@ -189,5 +189,9 @@ protobufs::Transformation TransformationAddDeadBlock::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddDeadBlock::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -53,6 +53,8 @@ class TransformationAddDeadBlock : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -211,5 +211,9 @@ void TransformationAddDeadBreak::ApplyImpl(
|
||||||
message_.phi_id());
|
message_.phi_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddDeadBreak::GetFreshIds() const {
|
||||||
|
return std::unordered_set<uint32_t>();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -61,6 +61,8 @@ class TransformationAddDeadBreak : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -158,5 +158,10 @@ void TransformationAddDeadContinue::ApplyImpl(
|
||||||
message_.phi_id());
|
message_.phi_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddDeadContinue::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return std::unordered_set<uint32_t>();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -63,6 +63,8 @@ class TransformationAddDeadContinue : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -927,5 +927,29 @@ opt::Instruction* TransformationAddFunction::FollowCompositeIndex(
|
||||||
return ir_context->get_def_use_mgr()->GetDef(sub_object_type_id);
|
return ir_context->get_def_use_mgr()->GetDef(sub_object_type_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddFunction::GetFreshIds() const {
|
||||||
|
std::unordered_set<uint32_t> result;
|
||||||
|
for (auto& instruction : message_.instruction()) {
|
||||||
|
result.insert(instruction.result_id());
|
||||||
|
}
|
||||||
|
if (message_.is_livesafe()) {
|
||||||
|
result.insert(message_.loop_limiter_variable_id());
|
||||||
|
for (auto& loop_limiter_info : message_.loop_limiter_info()) {
|
||||||
|
result.insert(loop_limiter_info.load_id());
|
||||||
|
result.insert(loop_limiter_info.increment_id());
|
||||||
|
result.insert(loop_limiter_info.compare_id());
|
||||||
|
result.insert(loop_limiter_info.logical_op_id());
|
||||||
|
}
|
||||||
|
for (auto& access_chain_clamping_info :
|
||||||
|
message_.access_chain_clamping_info()) {
|
||||||
|
for (auto& pair : access_chain_clamping_info.compare_and_select_ids()) {
|
||||||
|
result.insert(pair.first());
|
||||||
|
result.insert(pair.second());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -56,6 +56,8 @@ class TransformationAddFunction : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Helper method that, given composite type |composite_type_inst|, returns the
|
// Helper method that, given composite type |composite_type_inst|, returns the
|
||||||
|
|
|
@ -58,5 +58,9 @@ protobufs::Transformation TransformationAddGlobalUndef::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddGlobalUndef::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -41,6 +41,8 @@ class TransformationAddGlobalUndef : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -115,5 +115,10 @@ protobufs::Transformation TransformationAddGlobalVariable::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddGlobalVariable::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -55,6 +55,8 @@ class TransformationAddGlobalVariable : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -113,5 +113,10 @@ TransformationAddImageSampleUnusedComponents::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t>
|
||||||
|
TransformationAddImageSampleUnusedComponents::GetFreshIds() const {
|
||||||
|
return std::unordered_set<uint32_t>();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -45,6 +45,8 @@ class TransformationAddImageSampleUnusedComponents : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -88,5 +88,10 @@ protobufs::Transformation TransformationAddLocalVariable::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddLocalVariable::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -50,6 +50,8 @@ class TransformationAddLocalVariable : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -221,5 +221,14 @@ protobufs::Transformation TransformationAddLoopPreheader::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddLoopPreheader::GetFreshIds()
|
||||||
|
const {
|
||||||
|
std::unordered_set<uint32_t> result = {message_.fresh_id()};
|
||||||
|
for (auto id : message_.phi_id()) {
|
||||||
|
result.insert(id);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -45,6 +45,8 @@ class TransformationAddLoopPreheader : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -423,5 +423,13 @@ TransformationAddLoopToCreateIntConstantSynonym::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t>
|
||||||
|
TransformationAddLoopToCreateIntConstantSynonym::GetFreshIds() const {
|
||||||
|
return {message_.syn_id(), message_.loop_id(),
|
||||||
|
message_.ctr_id(), message_.temp_id(),
|
||||||
|
message_.eventual_syn_id(), message_.incremented_ctr_id(),
|
||||||
|
message_.cond_id(), message_.additional_block_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -57,6 +57,8 @@ class TransformationAddLoopToCreateIntConstantSynonym : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -105,5 +105,10 @@ bool TransformationAddNoContractionDecoration::IsArithmetic(uint32_t opcode) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t>
|
||||||
|
TransformationAddNoContractionDecoration::GetFreshIds() const {
|
||||||
|
return std::unordered_set<uint32_t>();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -44,6 +44,8 @@ class TransformationAddNoContractionDecoration : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Returns true if and only if |opcode| is the opcode of an arithmetic
|
// Returns true if and only if |opcode| is the opcode of an arithmetic
|
||||||
|
|
|
@ -193,5 +193,10 @@ bool TransformationAddOpPhiSynonym::CheckTypeIsAllowed(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddOpPhiSynonym::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -61,6 +61,8 @@ class TransformationAddOpPhiSynonym : public Transformation {
|
||||||
// enabled and the storage class is Workgroup or StorageBuffer.
|
// enabled and the storage class is Workgroup or StorageBuffer.
|
||||||
static bool CheckTypeIsAllowed(opt::IRContext* ir_context, uint32_t type_id);
|
static bool CheckTypeIsAllowed(opt::IRContext* ir_context, uint32_t type_id);
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -211,5 +211,9 @@ bool TransformationAddParameter::IsParameterTypeSupported(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddParameter::GetFreshIds() const {
|
||||||
|
return {message_.parameter_fresh_id(), message_.function_type_fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -56,6 +56,8 @@ class TransformationAddParameter : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Returns true if the type of the parameter is supported by this
|
// Returns true if the type of the parameter is supported by this
|
||||||
|
|
|
@ -142,5 +142,10 @@ bool TransformationAddRelaxedDecoration::IsNumeric(uint32_t opcode) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddRelaxedDecoration::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return std::unordered_set<uint32_t>();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
|
@ -45,6 +45,8 @@ class TransformationAddRelaxedDecoration : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Returns true if and only if |opcode| is the opcode of an instruction
|
// Returns true if and only if |opcode| is the opcode of an instruction
|
||||||
|
|
|
@ -81,5 +81,10 @@ protobufs::Transformation TransformationAddSpecConstantOp::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddSpecConstantOp::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -46,6 +46,8 @@ class TransformationAddSpecConstantOp : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -320,5 +320,9 @@ bool TransformationAddSynonym::IsAdditionalConstantRequired(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddSynonym::GetFreshIds() const {
|
||||||
|
return {message_.synonym_fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -53,6 +53,8 @@ class TransformationAddSynonym : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Returns true if we can create a synonym of |inst| according to the
|
// Returns true if we can create a synonym of |inst| according to the
|
||||||
|
|
|
@ -84,5 +84,9 @@ protobufs::Transformation TransformationAddTypeArray::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddTypeArray::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -45,6 +45,8 @@ class TransformationAddTypeArray : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -57,5 +57,9 @@ protobufs::Transformation TransformationAddTypeBoolean::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddTypeBoolean::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -39,6 +39,8 @@ class TransformationAddTypeBoolean : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -78,5 +78,9 @@ protobufs::Transformation TransformationAddTypeFloat::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddTypeFloat::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -41,6 +41,8 @@ class TransformationAddTypeFloat : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -80,5 +80,10 @@ protobufs::Transformation TransformationAddTypeFunction::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddTypeFunction::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -49,6 +49,8 @@ class TransformationAddTypeFunction : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -88,5 +88,9 @@ protobufs::Transformation TransformationAddTypeInt::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddTypeInt::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -42,6 +42,8 @@ class TransformationAddTypeInt : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -67,5 +67,9 @@ protobufs::Transformation TransformationAddTypeMatrix::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddTypeMatrix::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -43,6 +43,8 @@ class TransformationAddTypeMatrix : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -62,5 +62,9 @@ protobufs::Transformation TransformationAddTypePointer::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddTypePointer::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -43,6 +43,8 @@ class TransformationAddTypePointer : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -74,5 +74,9 @@ protobufs::Transformation TransformationAddTypeStruct::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddTypeStruct::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -47,6 +47,8 @@ class TransformationAddTypeStruct : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -61,5 +61,9 @@ protobufs::Transformation TransformationAddTypeVector::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAddTypeVector::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -43,6 +43,8 @@ class TransformationAddTypeVector : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -93,5 +93,10 @@ protobufs::Transformation TransformationAdjustBranchWeights::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationAdjustBranchWeights::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return std::unordered_set<uint32_t>();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -45,6 +45,8 @@ class TransformationAdjustBranchWeights : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -310,5 +310,10 @@ protobufs::Transformation TransformationCompositeConstruct::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationCompositeConstruct::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -61,6 +61,8 @@ class TransformationCompositeConstruct : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -135,5 +135,10 @@ protobufs::Transformation TransformationCompositeExtract::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationCompositeExtract::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -54,6 +54,8 @@ class TransformationCompositeExtract : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -220,5 +220,10 @@ bool TransformationCompositeInsert::IsCompositeInstructionSupported(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationCompositeInsert::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -55,6 +55,8 @@ class TransformationCompositeInsert : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Checks if |instruction| is a instruction of a composite type supported by
|
// Checks if |instruction| is a instruction of a composite type supported by
|
||||||
|
|
|
@ -48,5 +48,10 @@ TransformationComputeDataSynonymFactClosure::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t>
|
||||||
|
TransformationComputeDataSynonymFactClosure::GetFreshIds() const {
|
||||||
|
return std::unordered_set<uint32_t>();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -41,6 +41,8 @@ class TransformationComputeDataSynonymFactClosure : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -35,6 +35,14 @@ class NullOverflowIdSource : public OverflowIdSource {
|
||||||
assert(false && "Bad attempt to request an overflow id.");
|
assert(false && "Bad attempt to request an overflow id.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::unordered_set<uint32_t>& GetIssuedOverflowIds() const override {
|
||||||
|
assert(false && "Operation not supported.");
|
||||||
|
return placeholder_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unordered_set<uint32_t> placeholder_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -600,5 +600,21 @@ TransformationDuplicateRegionWithSelection::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t>
|
||||||
|
TransformationDuplicateRegionWithSelection::GetFreshIds() const {
|
||||||
|
std::unordered_set<uint32_t> result = {message_.new_entry_fresh_id(),
|
||||||
|
message_.merge_label_fresh_id()};
|
||||||
|
for (auto& pair : message_.original_label_to_duplicate_label()) {
|
||||||
|
result.insert(pair.second());
|
||||||
|
}
|
||||||
|
for (auto& pair : message_.original_id_to_duplicate_id()) {
|
||||||
|
result.insert(pair.second());
|
||||||
|
}
|
||||||
|
for (auto& pair : message_.original_id_to_phi_id()) {
|
||||||
|
result.insert(pair.second());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -66,6 +66,8 @@ class TransformationDuplicateRegionWithSelection : public Transformation {
|
||||||
opt::IRContext* ir_context, opt::BasicBlock* entry_block,
|
opt::IRContext* ir_context, opt::BasicBlock* entry_block,
|
||||||
opt::BasicBlock* exit_block);
|
opt::BasicBlock* exit_block);
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -282,5 +282,10 @@ uint32_t TransformationEquationInstruction::MaybeGetResultTypeId(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationEquationInstruction::GetFreshIds()
|
||||||
|
const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -60,6 +60,8 @@ class TransformationEquationInstruction : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -699,5 +699,18 @@ bool TransformationFlattenConditionalBranch::InstructionCanBeHandled(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t>
|
||||||
|
TransformationFlattenConditionalBranch::GetFreshIds() const {
|
||||||
|
std::unordered_set<uint32_t> result;
|
||||||
|
for (auto& side_effect_wrapper_info : message_.side_effect_wrapper_info()) {
|
||||||
|
result.insert(side_effect_wrapper_info.merge_block_id());
|
||||||
|
result.insert(side_effect_wrapper_info.execute_block_id());
|
||||||
|
result.insert(side_effect_wrapper_info.actual_result_id());
|
||||||
|
result.insert(side_effect_wrapper_info.alternative_block_id());
|
||||||
|
result.insert(side_effect_wrapper_info.placeholder_result_id());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -53,6 +53,8 @@ class TransformationFlattenConditionalBranch : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Returns true if the conditional headed by |header| can be flattened,
|
// Returns true if the conditional headed by |header| can be flattened,
|
||||||
|
|
|
@ -185,5 +185,9 @@ protobufs::Transformation TransformationFunctionCall::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationFunctionCall::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -55,6 +55,8 @@ class TransformationFunctionCall : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -292,5 +292,13 @@ void TransformationInlineFunction::AdaptInlinedInstruction(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationInlineFunction::GetFreshIds() const {
|
||||||
|
std::unordered_set<uint32_t> result;
|
||||||
|
for (auto& pair : message_.result_id_map()) {
|
||||||
|
result.insert(pair.second());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -52,6 +52,8 @@ class TransformationInlineFunction : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Returns true if |function_call_instruction| is defined, is an
|
// Returns true if |function_call_instruction| is defined, is an
|
||||||
|
|
|
@ -174,5 +174,10 @@ protobufs::Transformation TransformationInvertComparisonOperator::ToMessage()
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t>
|
||||||
|
TransformationInvertComparisonOperator::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -45,6 +45,8 @@ class TransformationInvertComparisonOperator : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Returns true if |opcode| is supported by this transformation.
|
// Returns true if |opcode| is supported by this transformation.
|
||||||
|
|
|
@ -98,5 +98,9 @@ protobufs::Transformation TransformationLoad::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationLoad::GetFreshIds() const {
|
||||||
|
return {message_.fresh_id()};
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -49,6 +49,8 @@ class TransformationLoad : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -107,5 +107,10 @@ bool TransformationMakeVectorOperationDynamic::IsVectorOperation(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t>
|
||||||
|
TransformationMakeVectorOperationDynamic::GetFreshIds() const {
|
||||||
|
return std::unordered_set<uint32_t>();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
|
@ -46,6 +46,8 @@ class TransformationMakeVectorOperationDynamic : public Transformation {
|
||||||
void Apply(opt::IRContext* ir_context,
|
void Apply(opt::IRContext* ir_context,
|
||||||
TransformationContext* transformation_context) const override;
|
TransformationContext* transformation_context) const override;
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> GetFreshIds() const override;
|
||||||
|
|
||||||
protobufs::Transformation ToMessage() const override;
|
protobufs::Transformation ToMessage() const override;
|
||||||
|
|
||||||
// Checks |instruction| is defined, is an OpCompositeExtract/Insert
|
// Checks |instruction| is defined, is an OpCompositeExtract/Insert
|
||||||
|
|
|
@ -78,5 +78,9 @@ protobufs::Transformation TransformationMergeBlocks::ToMessage() const {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_set<uint32_t> TransformationMergeBlocks::GetFreshIds() const {
|
||||||
|
return std::unordered_set<uint32_t>();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace fuzz
|
} // namespace fuzz
|
||||||
} // namespace spvtools
|
} // namespace spvtools
|
||||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче