IR: Add Value::sortUseList()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 24 Jul 2014 00:53:19 +0000 (00:53 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 24 Jul 2014 00:53:19 +0000 (00:53 +0000)
commit5092384bd31ea8649094021ffd169af849e7f324
treea55f790cde7e46ef6d90b1402eb5d38549c73651
parentec6e53516802f11edfbdfabefadc07478f238376
IR: Add Value::sortUseList()

Add `Value::sortUseList()`, templated on the comparison function to use.

The sort is an iterative merge sort that uses a binomial vector of
already-merged lists to limit the size overhead to `O(1)`.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213824 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Value.h
unittests/IR/CMakeLists.txt
unittests/IR/UseTest.cpp [new file with mode: 0644]