Commit Graph

52 Commits

Author SHA1 Message Date
Nick Kledzik 5fce8c4ffe Initial commit of new FileOutputBuffer support class.
Since the llvm::sys::fs::map_file_pages() support function it relies on
is not yet implemented on Windows, the unit tests for FileOutputBuffer 
are currently conditionalized to run only on unix.

llvm-svn: 161099
2012-08-01 02:29:50 +00:00
Seth Cantrell 75dbcb8bdd platform support for counting column widths and checking isprint
llvm-svn: 154944
2012-04-17 20:03:03 +00:00
Manuel Klimek 1f8918f69d Goodbye, JSONParser...
llvm-svn: 154930
2012-04-17 17:21:17 +00:00
Michael J. Spencer 22120c47a7 Add YAML parser to Support.
llvm-svn: 153977
2012-04-03 23:09:22 +00:00
Chandler Carruth 1d03a3b6b1 Rewrite LLVM's generalized support library for hashing to follow the API
of the proposed standard hashing interfaces (N3333), and to use
a modified and tuned version of the CityHash algorithm.

Some of the highlights of this change:
 -- Significantly higher quality hashing algorithm with very well
    distributed results, and extremely few collisions. Should be close to
    a checksum for up to 64-bit keys. Very little clustering or clumping of
    hash codes, to better distribute load on probed hash tables.
 -- Built-in support for reserved values.
 -- Simplified API that composes cleanly with other C++ idioms and APIs.
 -- Better scaling performance as keys grow. This is the fastest
    algorithm I've found and measured for moderately sized keys (such as
    show up in some of the uniquing and folding use cases)
 -- Support for enabling per-execution seeds to prevent table ordering
    or other artifacts of hashing algorithms to impact the output of
    LLVM. The seeding would make each run different and highlight these
    problems during bootstrap.

This implementation was tested extensively using the SMHasher test
suite, and pased with flying colors, doing better than the original
CityHash algorithm even.

I've included a unittest, although it is somewhat minimal at the moment.
I've also added (or refactored into the proper location) type traits
necessary to implement this, and converted users of GeneralHash over.

My only immediate concerns with this implementation is the performance
of hashing small keys. I've already started working to improve this, and
will continue to do so. Currently, the only algorithms faster produce
lower quality results, but it is likely there is a better compromise
than the current one.

Many thanks to Jeffrey Yasskin who did most of the work on the N3333
paper, pair-programmed some of this code, and reviewed much of it. Many
thanks also go to Geoff Pike Pike and Jyrki Alakuijala, the original
authors of CityHash on which this is heavily based, and Austin Appleby
who created MurmurHash and the SMHasher test suite.

Also thanks to Nadav, Tobias, Howard, Jay, Nick, Ahmed, and Duncan for
all of the review comments! If there are further comments or concerns,
please let me know and I'll jump on 'em.

llvm-svn: 151822
2012-03-01 18:55:25 +00:00
Jay Foad 585dda99f6 Update for the removal of Hashing.cpp.
llvm-svn: 151249
2012-02-23 09:33:44 +00:00
Talin f2291c908b Hashing.h - utilities for hashing various data types.
llvm-svn: 150890
2012-02-18 21:00:49 +00:00
Derek Schuff 8b2dcad4b5 Enable streaming of bitcode
This CL delays reading of function bodies from initial parse until
materialization, allowing overlap of compilation with bitcode download.

llvm-svn: 149918
2012-02-06 22:30:29 +00:00
Douglas Gregor 7039e358fc Move Clang's file-level locking facility over to LLVM's support
library, since it doesn't really have anything to do with Clang.

llvm-svn: 149203
2012-01-29 20:15:10 +00:00
Chandler Carruth e805b16e3d Fix up the CMake build for the new files added in r146960, they're
likely to stay either way that discussion ends up resolving itself.

llvm-svn: 146966
2011-12-20 08:42:11 +00:00
Manuel Klimek 2c899a181c Adds a JSON parser and a benchmark (json-bench) to catch performance regressions.
llvm-svn: 146735
2011-12-16 13:09:10 +00:00
Benjamin Kramer 88a1d9fc00 Add the DataExtractor utility class.
It is an endian-aware helper that can read data from a StringRef. It will
come in handy for DWARF parsing. This class is inspired by LLDB's
DataExtractor, but is stripped down to the bare minimum needed for DWARF.

Comes with unit tests!

llvm-svn: 139626
2011-09-13 19:42:16 +00:00
Evan Cheng 2bb4035707 Move TargetRegistry and TargetSelect from Target to Support where they belong.
These are strictly utilities for registering targets and components.

llvm-svn: 138450
2011-08-24 18:08:43 +00:00
Jakub Staszak 49993f26bf Add BlockFrequency class.
llvm-svn: 135992
2011-07-25 22:24:51 +00:00
Chandler Carruth 43025a0869 Move TargetRegistry.cpp from lib/Support to lib/Target where it belongs.
The header file was already properly located. The previous need for it
in Support had to do with the version string printing which was fixed in
r135757.

Also update build dependencies where libraries that needed the
functionality of the Target library (in the form of the TargetRegistry)
were picking it up via Support. This is pretty pervasive, essentially
every TargetInfo library (ARMInfo, etc) uses TargetRegistry, making it
depend on Target. All of these were previously just sneaking by.

llvm-svn: 135760
2011-07-22 08:16:53 +00:00
Andrew Trick 3d4e64b082 Branch profiling: floating-point avoidance.
Patch by: Jakub Staszak!

Introduces BranchProbability. Changes unsigned to uint32_t all over and
uint64_t only when overflow is expected.

llvm-svn: 132867
2011-06-11 01:05:22 +00:00
Rafael Espindola f1bda7c90c Revert my previous patch. The cmake build had already been fixed.
llvm-svn: 131606
2011-05-19 00:02:45 +00:00
Rafael Espindola efbdd80d77 Fix the cmake build.
llvm-svn: 131602
2011-05-18 23:56:40 +00:00
Jakob Stoklund Olesen baee655c5e Add ADT/IntEqClasses.h as a light-weight implementation of EquivalenceClasses.h.
This implementation already exists as ConnectedVNInfoEqClasses in
LiveInterval.cpp, and it seems to be generally useful to have a light-weight way
of forming equivalence classes of small integers.

IntEqClasses doesn't allow enumeration of the elements in a class.

llvm-svn: 122293
2010-12-21 00:04:46 +00:00
Michael J. Spencer 8b5defbd5d Support: Remove Alarm. It is unused (via local grep and google code search).
llvm-svn: 121160
2010-12-07 18:41:59 +00:00
Michael J. Spencer ebad2f9d36 Support: Add PathV2 implementation.
llvm-svn: 120329
2010-11-29 22:28:51 +00:00
Michael J. Spencer 447762da85 Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Jakob Stoklund Olesen 345945e355 Add ADT/IntervalMap.
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.

Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.

The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.

The IntervalMap is initially intended to be used with SlotIndex intervals for:

- Backing store for LiveIntervalUnion that is smaller and faster than std::set.

- Backing store for LiveInterval with less overhead than std::vector for typical
  intervals and O(N log N) merging of large intervals. 99% of virtual registers
  need 4 entries or less and would benefit from the small object optimization.

- Backing store for LiveDebugVariable which doesn't exist yet, but will track
  debug variables during register allocation.

This is a work in progress. Missing items are:

- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.

llvm-svn: 119787
2010-11-19 04:47:19 +00:00
Jakob Stoklund Olesen 09770251f6 Revert "Add ADT/IntervalMap.", GCC doesn't like it.
This reverts r119772.

llvm-svn: 119773
2010-11-19 01:21:03 +00:00
Jakob Stoklund Olesen 6d89171dcc Add ADT/IntervalMap.
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.

Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.

The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.

The IntervalMap is initially intended to be used with SlotIndex intervals for:

- Backing store for LiveIntervalUnion that is smaller and faster than std::set.

- Backing store for LiveInterval with less overhead than std::vector for typical
  intervals and O(N log N) merging of large intervals. 99% of virtual registers
  need 4 entries or less and would benefit from the small object optimization.

- Backing store for LiveDebugVariable which doesn't exist yet, but will track
  debug variables during register allocation.

This is a work in progress. Missing items are:

- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.

llvm-svn: 119772
2010-11-19 01:14:40 +00:00
Oscar Fuentes 889c1e7d80 Build with RTTI and exceptions disabled. Only in GCC for now.
llvm-svn: 116682
2010-10-17 02:26:16 +00:00
John Thompson f41f11c37e Unbreak cmake build.
llvm-svn: 116003
2010-10-07 23:12:15 +00:00
Oscar Fuentes b4b12535e8 Removed a bunch of unnecessary target_link_libraries.
llvm-svn: 114999
2010-09-28 22:39:14 +00:00
Benjamin Kramer d3eb989f37 Update CMake build.
llvm-svn: 111669
2010-08-20 18:56:46 +00:00
Douglas Gregor b7b5a7dff0 Unbreak my CMake build, say you'll compile for me again...
llvm-svn: 109598
2010-07-28 17:17:46 +00:00
Daniel Dunbar 579ba2ac42 ADT: Add DAGDeltaAlgorithm, which is a DAG minimization algorithm built on top of the standard 'delta debugging' algorithm.
- This can give substantial speedups in the delta process for inputs we can construct dependency information for.

llvm-svn: 105612
2010-06-08 16:21:22 +00:00
Douglas Gregor 3ab9e5077f De-bork CMake build
llvm-svn: 92003
2009-12-23 17:03:46 +00:00
Chris Lattner 4ea86c460a now that libsystem no longer uses SmallVector, we can move
SmallVectorBase::grow_pod out of line, finally satisfying PR3758.

llvm-svn: 91529
2009-12-16 08:44:24 +00:00
Daniel Dunbar ff53d4694c Add an implementation of the delta debugging algorithm.
- This is a pretty slow / memory intensive implementation, and I will likely
   change it to an iterative model, but it works.

llvm-svn: 90447
2009-12-03 11:12:42 +00:00
Daniel Dunbar 4498168753 Add StringRef::{rfind, rsplit}
llvm-svn: 82087
2009-09-16 22:38:48 +00:00
Ted Kremenek c74e09f654 Update CMake files.
llvm-svn: 81577
2009-09-11 21:49:45 +00:00
Ted Kremenek 1543d133db Update CMake files.
llvm-svn: 80680
2009-09-01 17:01:02 +00:00
Torok Edwin e14d4cdb5f Add regular expression matching support, based on OpenBSD regexec()/regcomp()
implementation.

llvm-svn: 80493
2009-08-30 08:24:09 +00:00
Oscar Fuentes a5ff9e354a CMake: updated list of source files.
llvm-svn: 79959
2009-08-25 00:02:29 +00:00
Oscar Fuentes 94e470504f CMake: Updated library dependencies and list of source files.
llvm-svn: 79876
2009-08-23 23:59:15 +00:00
Ted Kremenek defdbdc5ca Update CMake files.
llvm-svn: 77709
2009-07-31 18:50:22 +00:00
Daniel Dunbar 0cf4e697fd Update CMake
llvm-svn: 76957
2009-07-24 07:04:49 +00:00
Ted Kremenek 1492e1781a Update CMake file.
llvm-svn: 75746
2009-07-15 05:39:55 +00:00
Ted Kremenek 57da3ed4ce Update CMake file.
llvm-svn: 75677
2009-07-14 20:44:17 +00:00
Mike Stump 54731d5cde Fix build.
llvm-svn: 74936
2009-07-07 18:52:14 +00:00
Douglas Gregor 6d94e6a5f3 Fix linking of llvm-ld and lli with CMake, from Xerxes Rånby
llvm-svn: 74285
2009-06-26 15:37:00 +00:00
Chris Lattner fd255754af Rename TGSourceMgr -> SourceMgr.
llvm-svn: 73844
2009-06-21 03:41:50 +00:00
Ted Kremenek 81ef65d491 Update CMake files to account for new location of Threading.cpp.
llvm-svn: 73708
2009-06-18 17:47:09 +00:00
Douglas Gregor c791c37633 Add Threading.cpp to the CMake project files
llvm-svn: 73516
2009-06-16 17:45:38 +00:00
Douglas Gregor bbcf90f936 Minor fix for CMake build system
llvm-svn: 72480
2009-05-27 16:52:17 +00:00