MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / GroupIds

Method GroupIds

source/diff/diff.cpp:944–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

942// `uint32_t`.
943template <typename T>
944void Differ::GroupIds(const IdGroup& ids, bool is_src,
945 std::map<T, IdGroup>* groups,
946 T (Differ::*get_group)(const IdInstructions&, uint32_t)) {
947 assert(groups->empty());
948
949 const IdInstructions& id_to = is_src ? src_id_to_ : dst_id_to_;
950
951 for (const uint32_t id : ids) {
952 // Don't include ids that are already matched, for example through
953 // OpEntryPoint.
954 const bool is_matched =
955 is_src ? id_map_.IsSrcMapped(id) : id_map_.IsDstMapped(id);
956 if (is_matched) {
957 continue;
958 }
959
960 T group = (this->*get_group)(id_to, id);
961 (*groups)[group].push_back(id);
962 }
963}
964
965// Group `src_ids` and `dst_ids` according to `get_group`, and then use
966// `match_group` to pair up ids in corresponding groups.

Callers

nothing calls this directly

Calls 4

IsSrcMappedMethod · 0.80
IsDstMappedMethod · 0.80
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected