Go to file
Fangrui Song cd93d7ef43 [llvm-exegesis] Clustering: don't enqueue a point multiple times
Summary:
SetVector uses both DenseSet and vector, which is time/memory inefficient. The points are represented as natural numbers so we can replace the DenseSet part by indexing into a vector<char> instead.

Don't cargo cult the pseudocode on the wikipedia DBSCAN page. This is a standard BFS style algorithm (the similar loops have been used several times in other LLVM components): every point is processed at most once, thus the queue has at most NumPoints elements. We represent it with a vector and allocate it outside of the loop to avoid allocation in the loop body.

We check `Processed[P]` to avoid enqueueing a point more than once, which also nicely saves us a `ClusterIdForPoint_[Q].isUndef()` check.

Many people hate the oneshot abstraction but some favor it, therefore we make a compromise, use a lambda to abstract away the neighbor adding process.

Delete the comment `assert(Neighbors.capacity() == (Points_.size() - 1));` as it is wrong.

llvm-svn: 350035
2018-12-23 20:48:52 +00:00
clang [Driver] Disable -faddrsig on Gentoo by default 2018-12-23 15:07:26 +00:00
clang-tools-extra [clang-tidy] Be more liberal about literal zeroes in abseil checks 2018-12-21 21:07:11 +00:00
compiler-rt [xray] Detect MPROTECT and error out when it's enabled (on NetBSD) 2018-12-23 15:09:28 +00:00
debuginfo-tests Set config.lit_tools_dir, which is needed by lit.llvm.initialize. 2018-11-06 21:54:27 +00:00
libclc travis: Add cmake build 2018-11-27 16:07:21 +00:00
libcxx [libcxx] Remove unused macro _LIBCPP_HAS_UNIQUE_TYPEINFO 2018-12-21 20:14:43 +00:00
libcxxabi [libcxx] Remove bad_array_length 2018-11-29 19:44:57 +00:00
libunwind [SEH] Add initial support for AArch64 2018-12-18 20:05:59 +00:00
lld Test DWARFv5 with gdb-index and low_pc/high_pc on the CU (rather than ranges) 2018-12-22 22:20:47 +00:00
lldb [cmake] Suppress 'warning C4201: nonstandard extension used: nameless struct/union' on Windows 2018-12-21 23:59:24 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm [llvm-exegesis] Clustering: don't enqueue a point multiple times 2018-12-23 20:48:52 +00:00
openmp [runtime] [test] Fix using %python path 2018-12-22 10:51:53 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly [CMake] Fix generation of exported targets in build directory 2018-11-06 15:18:17 +00:00
pstl [pstl] Initial integration with LLVM's CMake 2018-12-21 15:59:04 +00:00
README.md Update the project name in README.md 2018-10-19 00:03:01 +00:00

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.