[ADT] Add a much simpler loop to DenseMap::clear when the types are
authorChandler Carruth <chandlerc@gmail.com>
Sat, 5 Aug 2017 22:48:37 +0000 (22:48 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 5 Aug 2017 22:48:37 +0000 (22:48 +0000)
commit6b78bac9fb547a215caf787d86564004e89b9bba
treea128f9f241c5fe096aff964f21beb90c80210f81
parent7e84697e5978cf3a18cff4b5475108a25ae76bf1
[ADT] Add a much simpler loop to DenseMap::clear when the types are
POD-like and we can just splat the empty key across memory.

Sadly we can't optimize the normal loop well enough because we can't
turn the conditional store into an unconditional store according to the
memory model.

This loop actually showed up in a profile of code that was calling clear
as a serious source of time. =[

llvm-svn: 310189
llvm/include/llvm/ADT/DenseMap.h