spirv-diff: Refactor instruction grouping and matching (#4760)
spirv-diff: Refactor instruction grouping and matching (#4760)

In preparation for supporting OpTypeForwardPointer, which adds more
usages like this.  This change refactors common code used to group
instructions and match the groups.
KhronosGroup/SPIRV-Tools,KhronosGroup/SPIRV-Tools,KhronosGroup/SPIRV-Tools,KhronosGroup/SPIRV-Tools,KhronosGroup/SPIRV-Tools,KhronosGroup/SPIRV-Tools,KhronosGroup/SPIRV-Tools,KhronosGroup/SPIRV-Tools