This allows stableHashValue to be used on Machine IR that is
not in SSA form.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/MachineStableHash.cpp | ||
---|---|---|
69 | If this only uses the opcode, won't it collide if you have multiple defs of the same register by the same opcode? |
llvm/lib/CodeGen/MachineStableHash.cpp | ||
---|---|---|
69 | You'd get collisions anyway if different instructions with the same opcode define the register, but that was presumably by design, to make the hashing more stable somehow. I don't see how having multiple defs with the same opcode makes it any worse. |
Stable hash was designed to infer the machine instructions that are likely to be identical so that we can optimistically outline them.
I don't have a strong suggestion on how to interpret this in the presence of virtual registers (before RA).
But by taking all their defs into account, it appears the hash is likely to be more unique than before.
Is there any specific use case or reason to enhance this collision?
See D120124: I want to use this as a quick hash for MachineFunctions (either before or after SSA, before or after regalloc) to detect which FunctionPasses modify them.
If this only uses the opcode, won't it collide if you have multiple defs of the same register by the same opcode?