[all-commits] [llvm/llvm-project] cbaae6: [DebugInstrRef] Use DenseMap for ValueToLoc (NFC)

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Jan 18 08:02:28 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cbaae614224211d01b385227e7efb447c87fc3ce
      https://github.com/llvm/llvm-project/commit/cbaae614224211d01b385227e7efb447c87fc3ce
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h

  Log Message:
  -----------
  [DebugInstrRef] Use DenseMap for ValueToLoc (NFC)

Just replacing std::map with DenseMap here is a major regression
-- because this code used an identity hash for ValueIDNum.
Because ValueIDNum is composed of multiple components, it is
important that we use a reasonably good hash function here, so
switch it to hash_value. DenseMapInfo::getHashValue<uint64_t>
would not be sufficient.

This gives a -0.8% geomean improvement on CTMark ReleaseLTO-g.




More information about the All-commits mailing list