[PATCH] D16268: Add a new insert_as() method to DenseMap and use it for ConstantUniqueMap

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 16 23:07:10 PST 2016


joker.eph created this revision.
joker.eph added reviewers: dexonsmith, chandlerc.
joker.eph added a subscriber: llvm-commits.

Just like the existing find_as() method, the new insert_as() accepts
an extra parameter which is used as a key to find the bucket in the
map.
When creating a Constant, we want to check the map before actually
creating the object. In this case we have to perform two queries to
the map, and this extra parameter can save recomputing the hash value
for the second query.

http://reviews.llvm.org/D16268

Files:
  include/llvm/ADT/DenseMap.h
  lib/IR/ConstantsContext.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16268.45089.patch
Type: text/x-patch
Size: 7076 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160117/5e754096/attachment.bin>


More information about the llvm-commits mailing list