Address feedback in https://reviews.llvm.org/D133637
authorYongKang Zhu <yongzhu@fb.com>
Tue, 13 Sep 2022 23:08:17 +0000 (16:08 -0700)
committerHongtao Yu <hoy@fb.com>
Tue, 13 Sep 2022 23:12:41 +0000 (16:12 -0700)
commit5fa6b2435477c8d44fc827cda2f998591b1cf837
tree450ec823ba9d6b8a9b95b577f28957f76c57a0d0
parentb6965f7246bba1b399755f56d8ae34893e815198
Address feedback in https://reviews.llvm.org/D133637

https://reviews.llvm.org/D133637 fixes the problem where we should hash raw content of
register mask instead of the pointer to it.

Fix the same issue in `llvm::hash_value()`.

Remove the added API `MachineOperand::getRegMaskSize()` to avoid potential confusion.

Add an assert to emphasize that we probably should hash a machine operand iff it has
associated machine function, but keep the fallback logic in the original change.

Reviewed By: MatzeB

Differential Revision: https://reviews.llvm.org/D133747
llvm/include/llvm/CodeGen/MachineOperand.h
llvm/lib/CodeGen/MachineOperand.cpp
llvm/lib/CodeGen/MachineStableHash.cpp