Finish fixing the MachineOperand hashing, providing a nice modern
authorChandler Carruth <chandlerc@gmail.com>
Thu, 5 Jul 2012 11:06:22 +0000 (11:06 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 5 Jul 2012 11:06:22 +0000 (11:06 +0000)
commitd862d697d2d6f7d4e8fdd0b70686a6695e04d362
treede32fc1cfc07c1c41b6557df3a51520915e16ef8
parent483c54b811badbfcaa040cdb6d84cf564afe75cf
Finish fixing the MachineOperand hashing, providing a nice modern
hash_value overload for MachineOperands. This addresses a FIXME
sufficient for me to remove it, and cleans up the code nicely too.

The important changes to the hashing logic:
- TargetFlags are now included in all of the hashes. These were complete
  missed.
- Register operands have their subregisters and whether they are a def
  included in the hash.
- We now actually hash all of the operand types. Previously, many
  operand types were simply *dropped on the floor*. For example:
  - Floating point immediates
  - Large integer immediates (>64-bit)
  - External globals!
  - Register masks
  - Metadata operands
- It removes the offset from the block-address hash; I'm a bit
  suspicious of this, but isIdenticalTo doesn't consider the offset for
  black addresses.

Any patterns involving these entities could have triggered extreme
slowdowns in MachineCSE or PHIElimination. Let me know if there are PRs
you think might be closed now... I'm looking myself, but I may miss
them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159743 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineOperand.h
lib/CodeGen/MachineInstr.cpp