[PATCH] D86952: [MIRVRegNamer] MachineInstr StableHashing.
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 3 10:03:53 PDT 2020
paquette added a comment.
Is there any way to test the hash itself on certain instructions?
e.g. verify that two instructions with different address spaces get a different hash?
================
Comment at: llvm/lib/CodeGen/MIRVRegNamerUtils.cpp:64
+ if (UseStableNamerHash)
+ return std::to_string(stableHashValue(MI, true /* HashVRegs */,
+ true /* HashConstantPoolIndices */,
----------------
Style nit: usually I've seen things like this formatted like below in the LLVM codebase:
```
/* HashVRegs = */ true, ...
```
================
Comment at: llvm/lib/CodeGen/MachineStableHash.cpp:66
+ const MachineRegisterInfo &MRI =
+ MO.getParent()->getParent()->getParent()->getRegInfo();
+ return MRI.getVRegDef(MO.getReg())->getOpcode();
----------------
nit: somewhat shorter
================
Comment at: llvm/lib/CodeGen/MachineStableHash.cpp:182
+ break;
+ HashComponents.push_back((unsigned)Op->getSize());
+ HashComponents.push_back((unsigned)Op->getFlags());
----------------
`static_cast` for greppability?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86952/new/
https://reviews.llvm.org/D86952
More information about the llvm-commits
mailing list