mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 17:31:07 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user