1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

1391 Commits

Author SHA1 Message Date
Chris Lattner
a830fc6a45 Revert functionality doug added in r98575 that was never
documented and only used by some clang stuff I just removed.

llvm-svn: 120002
2010-11-23 06:09:51 +00:00
Rafael Espindola
68135a728b Fix a use after free. Patch by Frits van Bommel.
llvm-svn: 119842
2010-11-19 21:14:29 +00:00
Jakob Stoklund Olesen
52d6dd3079 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
254cd4bc4d 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
7d82c5c710 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
Dale Johannesen
7bfcfd0bfa Aligned and unaligned copies of the same string
were not hashing to the same value.  Analysis
and patch by Frits van Bommel!

llvm-svn: 119770
2010-11-19 00:48:58 +00:00
Dan Gohman
3f08bf5bea Bounds-check APInt's operator[].
llvm-svn: 119708
2010-11-18 17:14:56 +00:00
Chris Lattner
99b8654169 now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the
cookie argument to the SourceMgr diagnostic stuff.  This cleanly separates
LLVMContext's inlineasm handler from the sourcemgr error handling 
definition, increasing type safety and cleaning things up.

llvm-svn: 119486
2010-11-17 08:13:01 +00:00
Daniel Dunbar
1f695efa5e report_fatal_error: Simplify a possible ambiguity.
llvm-svn: 118972
2010-11-13 02:48:51 +00:00
Ted Kremenek
3bb32def7e Fix memory leak in StringRef::edit_distance(). 'Allocated' could be leaked on an early return.
llvm-svn: 118370
2010-11-07 06:09:02 +00:00
Daniel Dunbar
8f3d8495f5 CrashRecoveryContext: Add RunSafelyOnThread helper function.
llvm-svn: 118272
2010-11-05 07:19:09 +00:00
Mikhail Glushenkov
991857f132 Rename FindExecutable to PrependMainExecutablePath.
Makes it more clear that it is just a path manipulation function.

llvm-svn: 118174
2010-11-03 16:14:16 +00:00
Dan Gohman
69a6379472 Print an error as one big string instead of breaking it up.
llvm-svn: 118130
2010-11-03 00:24:33 +00:00
Mikhail Glushenkov
97788c1061 Revert r118057, this is better fixed in appendSuffix itself.
llvm-svn: 118088
2010-11-02 22:18:28 +00:00
Dan Gohman
172e1824d0 Don't append a dot on platforms which don't use exe suffixes.
llvm-svn: 118057
2010-11-02 20:49:48 +00:00
Mikhail Glushenkov
4077e2da6f FindExecutable: remove the executability check.
This makes the behaviour of FindExecutable more consistent across platforms, but
I'm not very happy with the name...

llvm-svn: 118049
2010-11-02 20:32:46 +00:00
Dan Gohman
6a889e86df Fix these error messages to be less confusing. These error
messages primarily indicate errors running the viewer, not
errors with the graph file itself.

llvm-svn: 117665
2010-10-29 17:03:40 +00:00
Mikhail Glushenkov
7ee0f678cb Remove an unnecessary check and an unnecessary temporary.
llvm-svn: 117583
2010-10-28 19:33:04 +00:00
Douglas Gregor
a598c0fbce Extend StringRef's edit-distance algorithm to permit an upper bound on the allowed edit distance
llvm-svn: 116867
2010-10-19 22:13:48 +00:00
NAKAMURA Takumi
8c67d3f400 lib/Support/raw_ostream.cpp: Fix Cygwin's build.
setmode is provided by io.h on Cygwin.

llvm-svn: 116784
2010-10-19 01:21:55 +00:00
Daniel Dunbar
f5c3546f2b CrashRecoveryContext: Add missing return, so that the signal fires after we our
routine is off the stack. Otherwise we show up rather confusingly in the stack
trace.

llvm-svn: 116755
2010-10-18 21:55:18 +00:00
Oscar Fuentes
a6ffccab95 Build with RTTI and exceptions disabled. Only in GCC for now.
llvm-svn: 116682
2010-10-17 02:26:16 +00:00
Francois Pichet
ad0548d742 Always use binary mode for output stream. This is important to prevent unwanted end of line conversion on Windows. Should not affect Unix where O_BINARY is not defined. This fix /clang/test/lexer/preamble.c XFAIL on WIN32.
llvm-svn: 116509
2010-10-14 20:30:58 +00:00
Chris Lattner
27d8b68afa fix a bug I introduced, no idea how this didn't repro right.
llvm-svn: 116462
2010-10-14 00:30:00 +00:00
Chris Lattner
451a0accb5 add uadd_ov/usub_ov to apint, consolidate constant folding
logic to use the new APInt methods.  Among other things this
implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold

which comes from "clang -ftrapv", originally brought to my attention from PR8221.

llvm-svn: 116457
2010-10-14 00:05:07 +00:00
Chris Lattner
093d5fe0a9 constify these methods.
llvm-svn: 116455
2010-10-13 23:54:10 +00:00
Chris Lattner
70a78ab2c5 add a few operations for signed operations that also
return an overflow flag.

llvm-svn: 116452
2010-10-13 23:46:33 +00:00
John Thompson
87f1278fd9 Unbreak cmake build.
llvm-svn: 116003
2010-10-07 23:12:15 +00:00
Dan Gohman
6645ce3f75 Move tool_output_file into its own file.
llvm-svn: 115973
2010-10-07 20:32:40 +00:00
Dan Gohman
e4c61a1443 After printing "Running 'Graphviz' program... " and running the
Graphviz program, print something with a newline, to avoid leaving
the line unfinished.

llvm-svn: 115620
2010-10-05 15:30:27 +00:00
Benjamin Kramer
3f7e313552 Grow BumpPtrAllocator's slab size dynamically if we allocated many slabs. This
reduces the amount of malloc calls and may reduce memory overhead.

Some numbers:
ASTContext stats, clang -cc1 -disable-free -fsyntax-only Cocoa_h.m
without dynamic growth                          |  with dynamic growth
Number of memory regions: 3158                  |  Number of memory regions: 432
Bytes used: 12333185                            |  Bytes used: 12333185
Bytes allocated: 12935168                       |  Bytes allocated: 12800000
Bytes wasted: 601983 (includes alignment, etc)  |  Bytes wasted: 466815 (includes alignment, etc)

ASTContext stats, clang -cc1 -disable-free -fsyntax-only on clang's ASTReader.cpp
without dynamic growth                          |  with dynamic growth
Number of memory regions: 10987                 |  Number of memory regions: 551
Bytes used: 42910356                            |  Bytes used: 42910356
Bytes allocated: 45002752                       |  Bytes allocated: 44711936
Bytes wasted: 2092396 (includes alignment, etc) |  Bytes wasted: 1801580 (includes alignment, etc)

llvm-svn: 115151
2010-09-30 16:18:28 +00:00
Oscar Fuentes
eb27a44982 Removed a bunch of unnecessary target_link_libraries.
llvm-svn: 114999
2010-09-28 22:39:14 +00:00
Nick Lewycky
69d1069a4b Make ConstantRange::makeICmpRegion handle all the edge cases properly. This
also fixes PR8250.

llvm-svn: 114972
2010-09-28 18:18:36 +00:00
Benjamin Kramer
cd6c025b08 Push twines deeper into SourceMgr's error handling methods.
llvm-svn: 114847
2010-09-27 17:42:11 +00:00
Dan Gohman
08f59bde05 Delete an unused declaration.
llvm-svn: 114839
2010-09-27 16:54:49 +00:00
Dan Gohman
773c8a1c76 Add support for viewing graphviz graphs with xdot.py.
llvm-svn: 114832
2010-09-27 16:28:34 +00:00
Duncan Sands
c128b42eb8 Add better support for environment portion of triple. Original patch by
Cameron Esfahani, tweaked to use array_lengthof.

llvm-svn: 114073
2010-09-16 08:25:48 +00:00
Duncan Sands
82768f4f13 Some versions of gcc still warn about "ignoring return value ... declared
with attribute warn_unused_result" here - suppress the warning harder.

llvm-svn: 114072
2010-09-16 08:20:49 +00:00
Nick Lewycky
cad1395824 Create PTX backend. Patch by Che-Liang Chiou!
llvm-svn: 113235
2010-09-07 18:14:24 +00:00
Nick Lewycky
9698dae1df Add completely hokey binary-and and binary-or operations to ConstantRange and
teach LazyValueInfo to use them.

llvm-svn: 113196
2010-09-07 05:39:02 +00:00
Nick Lewycky
ca54f909d8 Add a new isSignWrappedSet() method to ConstantRange.
Fix zeroExtend and signExtend to support empty sets, and to return the smallest
possible result set which contains the extension of each element in their
inputs. For example zext i8 [100, 10) to i16 is now [0, 256), not i16 [100, 10)
which contains 63446 members.

llvm-svn: 113187
2010-09-06 23:52:49 +00:00
Dan Gohman
603d00d632 Use the FindProgramByName fallback only with known absolute paths.
I wasn't able to convince myself that all GetMainExecutable
implementations always return absolute paths; this prevents
unexpected behavior in case they ever don't.

llvm-svn: 112888
2010-09-02 22:32:38 +00:00
John McCall
b91df6e799 After some discussion with djg, teach SmallVector to grow from a zero
capacity and remove the workaround in SmallVector<T,0>.  There are some
theoretical benefits to a N->2N+1 growth policy anyway.

llvm-svn: 112870
2010-09-02 21:55:03 +00:00
NAKAMURA Takumi
500a204a62 llvm::FindExecutable(): Retrieve the name with suffix.exe, if available.
bugpoint uses it.

llvm-svn: 112803
2010-09-02 03:46:04 +00:00
Dan Gohman
f9e09104f1 Make tool_output_file's raw_ostream instance a member variable instead
of a base class.

This makes it possible to unregister the file from FilesToRemove when
the file is done. Also, this eliminates the need for
formatted_tool_output_file.

llvm-svn: 112706
2010-09-01 14:20:41 +00:00
Duncan Sands
3e49fe09db Remove a hack that tries to understand incorrect triples from the
Triple class constructor.  Only valid triples should now be used
inside LLVM - front-ends are now responsable for rejecting or
correcting invalid target triples.  The Triple::normalize method
can be used to straighten out funky triples provided by users.
Give this a whirl through the buildbots to see if I caught all
places where triples enter LLVM.

llvm-svn: 112470
2010-08-30 10:57:54 +00:00
Benjamin Kramer
7dcd303d9c StringRef::compare_numeric also differed from StringRef::compare for characters > 127.
llvm-svn: 112189
2010-08-26 15:25:35 +00:00
Benjamin Kramer
25003daf90 Do unsigned char comparisons in StringRef::compare_lower to be more consistent with compare in corner cases.
llvm-svn: 112185
2010-08-26 14:21:08 +00:00
Dan Gohman
8d2ed57538 Use Bits.data() instead of &Bits[0].
llvm-svn: 111993
2010-08-24 23:16:53 +00:00
Benjamin Kramer
926ba6058b Avoid O(n*m) complexity in StringRef::find_first(_not)_of(StringRef).
- Cache used characters in a bitset to reduce memory overhead to just 32 bytes.
- On my core2 this code is faster except when the checked string was very short
  (smaller than the list of delimiters).

llvm-svn: 111817
2010-08-23 18:16:08 +00:00