Go to file
Craig Topper f19eacfe0b [TableGen] Use SmallMapVector to simplify some code that was trying to keep a vector unique
Summary:
This code previously had a SmallVector of std::pairs containing an unsigned and another SmallVector. The outer vector was using the unsigned effectively as a key to decide which SmallVector to add into. So each time something new needed to be added the out vector needed to be scanned. If it wasn't found a new entry needed to be added to be added. This sounds very much like a map, but the next loop iterates over the outer vector to get a deterministic order.

We can simplify this code greatly if use SmallMapVector instead. This uses more stack space since we now have a vector and a map, but the searching and creating new entries all happens behind the scenes. It should also make the search more efficient though usually there are only a few entries so that doesn't matter much.

We could probably get determinism by just using std::map which would iterate over the unsigned key, but that would generate different output from what we get with the current implementation.

Reviewers: RKSimon, dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D44711

llvm-svn: 328070
2018-03-21 02:48:34 +00:00
clang Set dso_local on runtime variables. 2018-03-21 01:30:16 +00:00
clang-tools-extra Revert "[lit] Adding config initialization to lit tests in clang-tools-extra" 2018-03-21 02:28:22 +00:00
compiler-rt Revert "[compiler-rt] Change std::sort to llvm::sort in response to r327219" 2018-03-20 01:17:18 +00:00
debuginfo-tests [Darwin] Specify DWARF 2/4 when running apple accelerator tests. 2018-02-26 20:56:45 +00:00
libclc remainder: Port from amd builtins 2018-03-19 01:01:10 +00:00
libcxx Implement LWG3034: P0767R1 breaks previously-standard-layout types 2018-03-21 00:36:05 +00:00
libcxxabi [demangler] Support for <template-param>s in generic lambdas. 2018-03-16 03:06:30 +00:00
libunwind [libunwind][MIPS]: Add support for unwinding in N32 processes. 2018-02-27 21:24:02 +00:00
lld Revert "Resubmit "Support embedding natvis files in PDBs."" 2018-03-20 18:37:03 +00:00
lldb [Testsuite] Modernize this test to be run out-of-tree. 2018-03-20 23:47:47 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [TableGen] Use SmallMapVector to simplify some code that was trying to keep a vector unique 2018-03-21 02:48:34 +00:00
openmp Read OMP_TARGET_OFFLOAD and provide API to access ICV 2018-03-20 21:18:17 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly Adjust to clang-format changes 2018-03-20 17:16:32 +00:00
README.md Add an svn project to contain the files that appear at the root of the 2017-10-19 21:09:49 +00:00

README.md

Low Level Virtual Machine (LLVM)

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