Replace FoldingSet with DenseMap for instruction canonicalization. (#3979)

Switch from recursing into non-canonical instruction fields to
separately canonicalizing those fields. This means we now form canonical
`InstBlockId`s, `TypeBlockId`s, `IntId`s, `FloatId`s, and `BindNameId`s
at least in the cases when they're referenced by a constant instruction.

This reduces the overall runtime for @chandlerc's 10MLoC example by
27.5% on my machine.
This commit is contained in:
Richard Smith
2024-05-23 00:48:49 +00:00
committed by GitHub
parent 7b4b7abc6e
commit 5c8fa6ad5c
35 changed files with 479 additions and 505 deletions
+1
View File
@@ -283,6 +283,7 @@ struct HashableType {
int ignored = 0;
// See common/hashing.h.
friend auto CarbonHashValue(const HashableType& value, uint64_t seed)
-> HashCode {
Hasher hasher(seed);