Commit Graph

172735 Commits

Author SHA1 Message Date
Evgeniy Stepanov b6c47a5bd2 [asan] Fix instrumentation of x86 intel syntax inline assembly.
Patch by Yuri Gorshenin.

llvm-svn: 207092
2014-04-24 09:56:15 +00:00
Chandler Carruth 493e0a6ad0 [LCG] Switch the parent SCC tracking from a SmallSetVector to
a SmallPtrSet. Currently, there is no need for stable iteration in this
dimension, and I now thing there won't need to be going forward.

If this is ever re-introduced in any form, it needs to not be
a SetVector based solution because removal cannot be linear. There will
be many SCCs with large numbers of parents. When encountering these, the
incremental SCC update for intra-SCC edge removal was quadratic due to
linear removal (kind of).

I'm really hoping we can avoid having an ordering property here at all
though...

llvm-svn: 207091
2014-04-24 09:22:31 +00:00
Chandler Carruth d52f8e0e4d [LCG] We don't actually need a set in each SCC to track the nodes. We
can use the node -> SCC mapping in the top-level graph to test this on
the rare occasions we need it.

llvm-svn: 207090
2014-04-24 08:55:36 +00:00
Zinovy Nis 27c486ffe1 [CLNUP] Test commit. Remove newline.
llvm-svn: 207089
2014-04-24 08:42:58 +00:00
Benjamin Kramer f4575db2fd X86: Emit test instead of constant shift + compare if the shift result is unused.
This allows us to compile
  return (mask & 0x8 ? a : b);
into
  testb $8, %dil
  cmovnel %edx, %esi
instead of
  andl  $8, %edi
  shrl  $3, %edi
  cmovnel %edx, %esi

which we formed previously because dag combiner canonicalizes setcc of and into shift.

llvm-svn: 207088
2014-04-24 08:15:31 +00:00
Dmitri Gribenko 4f4dd17d05 Comment to XML conversion: use unique_ptr for SimpleFormatContext
llvm-svn: 207087
2014-04-24 07:52:31 +00:00
Chandler Carruth 944b9acddd [LCG] Switch the SCC's parent iterators to be value iterators rather
than pointer iterators.

llvm-svn: 207086
2014-04-24 07:48:18 +00:00
Karthik Bhat 81e6bf0a41 Allow vectorization of few missed llvm intrinsic calls in BBVectorizor by handling them in isVectorizableIntrinsic function.
llvm-svn: 207085
2014-04-24 07:29:55 +00:00
Chandler Carruth 3478d4b164 [ADT] Attempt to appease another MSVC oddity by moving the injected
class name usage into a context we can put typename on it.

llvm-svn: 207084
2014-04-24 06:59:50 +00:00
Craig Topper 353eda484c [C++] Use 'nullptr'.
llvm-svn: 207083
2014-04-24 06:44:33 +00:00
Chandler Carruth 150a5f1dd3 [ADT] Try to appease MSVC by sinking the enable_if from a default
template argument to a default argument to the constructor.

llvm-svn: 207082
2014-04-24 06:16:12 +00:00
Argyrios Kyrtzidis edfe07fca0 Simplify leak fix of r207076, by just disposing the previous CXString.
llvm-svn: 207081
2014-04-24 06:05:40 +00:00
Stepan Dyatkovskiy 00dcc0f53c Fix for PR18921, "vmov" part.
Added support for bytes replication feature, so it could be GAS compatible.

E.g. instructions below:
"vmov.i32 d0, 0xffffffff"
"vmvn.i32 d0, 0xabababab"
"vmov.i32 d0, 0xabababab"
"vmov.i16 d0, 0xabab"
are incorrect, but we could deal with such cases.

For first one we should emit:
"vmov.i8 d0, 0xff"
For second one ("vmvn"):
"vmov.i8 d0, 0x54"
For last two instructions it should emit:
"vmov.i8 d0, 0xab"

P.S.: In ARMAsmParser.cpp I have also fixed few nearby style issues in old code.
Just for keeping method bodies in harmony with themselves.

llvm-svn: 207080
2014-04-24 06:03:01 +00:00
Nico Weber dc493cf13b Don't leak _all_ directives in -verify mode. Found by LSan, PR19520.
llvm-svn: 207079
2014-04-24 05:39:55 +00:00
Chandler Carruth a3211b5dca Use the shiny new iterator adaptor tool to implement the
value_op_iterator.

llvm-svn: 207078
2014-04-24 05:33:53 +00:00
Nico Weber 568dacc4aa Don't leak invalid RegexDirectives. Probably a small part of PR19520.
llvm-svn: 207077
2014-04-24 05:32:03 +00:00
Nico Weber aacf0313a5 Fix two leaks found by LSan.
A CursorPlatformAvailability can have several "unavailable" attributes, don't
leak all but the first.  I'm not sure if there can be several "deprecate"ds too,
but add the same logic there to keep the two code paths looking the same.

llvm-svn: 207076
2014-04-24 05:16:45 +00:00
Nico Weber dbd07fadae Fix two leaks found by LSan (one is test-only).
The result of llvm::MemoryBuffer::getMemBuffer() needs to be freed. Don't
pass "don't free" flag to overrideFileContents() to fix.

llvm-svn: 207075
2014-04-24 04:58:41 +00:00
Nico Weber 4fcf0c7b29 Fix two test-only leaks found by LSan.
The result of getBufferForFile() must be freed.
(Should we change functions that expect the caller to assume ownership so
that they return unique_ptrs instead? Then the type system makes sure we get
this right.)

llvm-svn: 207074
2014-04-24 04:26:18 +00:00
Nico Weber 82098cb6df Fix two leaks in c-index-test found by LSan.
The result of clang_getCursorSpelling() needs to be clang_getCursorSpelling()ed.

llvm-svn: 207073
2014-04-24 04:14:12 +00:00
Chandler Carruth 2803df5ae6 [ADT] Factor out the facade aspect of the iterator_adaptor_base into its
own CRTP base class for more general purpose use. Add some clarifying
comments for the exact way in which the adaptor uses it. Hopefully this
will help us write increasingly full featured iterators. This is
becoming important as they start to be used heavily inside of ranges.

llvm-svn: 207072
2014-04-24 04:07:06 +00:00
Nico Weber 52fbbb16a1 Fix four more test-only leaks found by LSan.
Tool::run() doesn't take ownership of the passed action.

llvm-svn: 207071
2014-04-24 03:48:09 +00:00
Nico Weber 1f29ccf3fb Revert the "don't leak" part of r207065, looks like the bots don't like it :-/
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/22506

llvm-svn: 207070
2014-04-24 03:31:27 +00:00
Chandler Carruth 9a6be8b3b1 [ADT] Add a generic iterator utility for adapting iterators much like
Boost's iterator_adaptor, and a specific adaptor which iterates over
pointees when wrapped around an iterator over pointers.

This is the result of a long discussion on IRC with Duncan Smith, Dave
Blaikie, Richard Smith, and myself. Essentially, I could use some subset
of the iterator facade facilities often used from Boost, and everyone
seemed interested in having the functionality in a reasonably generic
form. I've tried to strike a balance between the pragmatism and the
established Boost design. The primary differences are:

1) Delegating to the standard iterator interface names rather than
   special names that then make up a second iterator-like API.
2) Using the name 'pointee_iterator' which seems more clear than
   'indirect_iterator'. The whole business of calling the '*p' operation
   'pointer indirection' in the standard is ... quite confusing. And
   'dereference' is no better of a term for moving from a pointer to
   a reference.

Hoping Duncan, and others continue to provide comments on this until
we've got a nice, minimal abstraction.

llvm-svn: 207069
2014-04-24 03:31:23 +00:00
Nico Weber 7c3ccb032e Fix 3 test-only leaks found by LSan.
llvm-svn: 207068
2014-04-24 03:30:22 +00:00
Nico Weber 7deebef657 More spellchecking for Index.h
llvm-svn: 207067
2014-04-24 03:17:47 +00:00
Nico Weber dd9c19fe94 compeltions are never appropriate.
llvm-svn: 207066
2014-04-24 03:06:18 +00:00
Nico Weber 7de358e936 Don't leak objects in load-from-ast path unless DisableFree is set.
Also update a comment to match a code change that was done in r110978.

llvm-svn: 207065
2014-04-24 02:42:04 +00:00
Nick Kledzik 49fdc41b21 Remove unused/obsolete ARM64 constants
llvm-svn: 207064
2014-04-24 02:33:46 +00:00
Richard Smith f17fdbd791 When two templates get merged together, also merge their pattern declarations
together. This is extremely hairy, because in general we need to have loaded
both the template and the pattern before we can determine whether either should
be merged, so we temporarily violate the rule that all merging happens before
reading a decl ends, but *only* in the case where a template's pattern is being
loaded while loading the template itself.

In order to accomodate this for class templates, delay loading the injected
class name type for the pattern of the template until after we've loaded the
template itself, if we happen to load the template first.

llvm-svn: 207063
2014-04-24 02:25:27 +00:00
Michael J. Spencer 807cf41e2f Fix test to not depend on llvm optimizations.
llvm-svn: 207062
2014-04-24 02:16:29 +00:00
David Blaikie 31f2900ae6 Remove unused parameter
llvm-svn: 207061
2014-04-24 01:25:10 +00:00
David Blaikie 18d337508c Remove the intermediate AccelTypes maps in DWARF units.
llvm-svn: 207060
2014-04-24 01:23:49 +00:00
David Blaikie ecf0415245 Remove the intermediate AccelNamespace maps in DWARF units.
llvm-svn: 207059
2014-04-24 01:02:42 +00:00
Michael J. Spencer dee4b2c379 [InstCombine][x86] Constant fold psll intrinsics.
This excludes avx512 as I don't have hardware to verify. It excludes _dq
variants because they are represented in the IR as <{2,4} x i64> when it's
actually a byte shift of the entire i{128,265}.

This also excludes _dq_bs as they aren't at all supported by the backend.
There are also no corresponding instructions in the ISA. I have no idea why
they exist...

llvm-svn: 207058
2014-04-24 00:58:18 +00:00
David Blaikie 0ee82b95cb Remove the intermediate AccelObjC maps in DWARF units
llvm-svn: 207057
2014-04-24 00:53:32 +00:00
Nico Weber 1ada62654f Bury leaked sema pointer when reading from AST files.
Should suppress several LSan reports.

llvm-svn: 207056
2014-04-24 00:51:03 +00:00
Filipe Cabecinhas 1a80595a2b Optimize some special cases for SSE4a insertqi
Summary:
Since the upper 64 bits of the destination register are undefined when
performing this operation, we can substitute it and let the optimizer
figure out that only a copy is needed.

Also added range merging, if an instruction copies a range that can be
merged with a previous copied range.

Added test cases for both optimizations.

Reviewers: grosbach, nadav

CC: llvm-commits

Differential Revision: http://reviews.llvm.org/D3357

llvm-svn: 207055
2014-04-24 00:38:14 +00:00
Matt Arsenault 60728177fb Handle addrspacecast when looking at memcpys from globals
llvm-svn: 207054
2014-04-24 00:01:09 +00:00
Chandler Carruth 6a4fee87bc [LCG] Normalize the post-order SCC iterator to just iterate over the SCC
values rather than having pointers in weird places.

llvm-svn: 207053
2014-04-23 23:51:07 +00:00
Chandler Carruth a800e28818 [LCG] Remove two unused typedefs from the iterators.
llvm-svn: 207052
2014-04-23 23:51:02 +00:00
David Blaikie 27931a41e4 And actually use the DwarfDebug::AccelNames to emit the names.
Fix for r207049 which would've emitted no accelerated names at all...

llvm-svn: 207051
2014-04-23 23:46:25 +00:00
David Blaikie f2505d6995 More formatting...
llvm-svn: 207050
2014-04-23 23:38:39 +00:00
David Blaikie 2406a0627c Remove intermediate accelerator table for names.
(similar changes coming for the other accelerator tables)

llvm-svn: 207049
2014-04-23 23:37:35 +00:00
Chandler Carruth bd5d3082c4 [LCG] Switch the primary node iterator to be a *much* more normal C++
iterator, returning a Node by reference on dereference.

llvm-svn: 207048
2014-04-23 23:34:48 +00:00
Chandler Carruth 2a898e0df6 [LCG] Make the insertion and query paths into the LCG which cannot fail
return references to better model this property.

No functionality changed.

llvm-svn: 207047
2014-04-23 23:20:36 +00:00
Enrico Granata 8a068e6c43 Allow summary formatters to take ValueObjects into account when deciding whether values/children should be printed and if child names should be shown
This decision has always been statically-bound to the individual formatter. With this patch, the idea is that this decision could potentially be dynamic depending on the ValueObject itself

llvm-svn: 207046
2014-04-23 23:16:25 +00:00
Chandler Carruth a10e240377 [LCG] Switch the SCC lookup to be in terms of call graph nodes rather
than functions. So far, this access pattern is *much* more common. It
seems likely that any user of this interface is going to have nodes at
the point that they are querying the SCCs.

No functionality changed.

llvm-svn: 207045
2014-04-23 23:12:06 +00:00
David Blaikie 2c0f4ef241 DwarfAccelTable: Remove trivial dtor and simplify construction with an array.
llvm-svn: 207044
2014-04-23 23:03:45 +00:00
Jordan Rose 001080b375 Use std::less instead of < in array_pod_sort's default comparator.
This makes array_pod_sort portably safe to use with pointers.

llvm-svn: 207043
2014-04-23 22:44:11 +00:00