mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	In hash_cell_inputs, avoid constructing an std::pair (which requires copying the port IdString)
This commit is contained in:
		
							parent
							
								
									41b6c0cb9f
								
							
						
					
					
						commit
						54a258f854
					
				
					 2 changed files with 7 additions and 1 deletions
				
			
		|  | @ -188,6 +188,12 @@ template<typename P, typename Q> struct hash_ops<std::pair<P, Q>> { | ||||||
| 		return h; | 		return h; | ||||||
| 	} | 	} | ||||||
| 	HASH_TOP_LOOP_FST (const std::pair<P, Q> &a) HASH_TOP_LOOP_SND | 	HASH_TOP_LOOP_FST (const std::pair<P, Q> &a) HASH_TOP_LOOP_SND | ||||||
|  | 	[[nodiscard]] static inline Hasher hash(const P &p, const Q &q) { | ||||||
|  | 		Hasher h; | ||||||
|  | 		h = hash_ops<P>::hash_into(p, h); | ||||||
|  | 		h = hash_ops<Q>::hash_into(q, h); | ||||||
|  | 		return h; | ||||||
|  | 	} | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| template<typename... T> struct hash_ops<std::tuple<T...>> { | template<typename... T> struct hash_ops<std::tuple<T...>> { | ||||||
|  |  | ||||||
|  | @ -107,7 +107,7 @@ struct OptMergeWorker | ||||||
| 			for (const auto& [port, sig] : cell->connections()) { | 			for (const auto& [port, sig] : cell->connections()) { | ||||||
| 				if (cell->output(port)) | 				if (cell->output(port)) | ||||||
| 					continue; | 					continue; | ||||||
| 				comm.eat(hash_ops<std::pair<IdString, SigSpec>>::hash({port, assign_map(sig)})); | 				comm.eat(hash_ops<std::pair<IdString, SigSpec>>::hash(port, assign_map(sig))); | ||||||
| 			} | 			} | ||||||
| 			h = comm.hash_into(h); | 			h = comm.hash_into(h); | ||||||
| 			if (RTLIL::builtin_ff_cell_types().count(cell->type)) | 			if (RTLIL::builtin_ff_cell_types().count(cell->type)) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue