================
@@ -100,8 +233,20 @@ class StructuralHashImpl {
     if (const auto *ComparisonInstruction = dyn_cast<CmpInst>(&Inst))
       Hashes.emplace_back(ComparisonInstruction->getPredicate());
 
-    for (const auto &Op : Inst.operands())
-      Hashes.emplace_back(hashOperand(Op));
+    unsigned InstIdx = 0;
+    if (IndexInstruction) {
+      InstIdx = IndexInstruction->size();
+      IndexInstruction->insert({InstIdx, const_cast<Instruction *>(&Inst)});
----------------
kyulee-com wrote:

Instruction is inserted once by design in this pass. In fact, this map 
`IndexInstruction` itself can't catch the duplication as the key is `index`, 
not `Instruction *`.  Anyhow, replaced `insert` by `trace_emplace` for 
efficiency.

https://github.com/llvm/llvm-project/pull/112638
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to