Commit Graph

132267 Commits

Author SHA1 Message Date
Sebastian Pop 1a0bef6d4b fix HexagonSubtarget parsing of -mv flag
llvm-svn: 162217
2012-08-20 19:56:47 +00:00
Jordan Rose 2b10f3f8a9 [analyzer] Add comments to ExplodedNode::NodeGroup.
No functionality change.

llvm-svn: 162216
2012-08-20 18:59:46 +00:00
Jordan Rose 4b4613cbec [analyzer] Replace boolean IsSink parameters with 'generateSink' methods.
Generating a sink is significantly different behavior from generating a
normal node, and a simple boolean parameter can be rather opaque. Per
offline discussion with Anna, adding new generation methods is the
clearest way to communicate intent.

No functionality change.

llvm-svn: 162215
2012-08-20 18:43:42 +00:00
Michael Liao 10ff96ce8c fix a case where all operands of BUILD_VECTOR are undefined
llvm-svn: 162214
2012-08-20 17:59:18 +00:00
Akira Hatanaka 11dfbe196f Fix coding style violations in 162135 and 162136.
Patch by Petar Jovanovic.

llvm-svn: 162213
2012-08-20 17:53:24 +00:00
Richard Smith 62e6630af9 PR13619: Make sure we're not at EOF before looking at NextToken().
llvm-svn: 162212
2012-08-20 17:37:52 +00:00
Chad Rosier d4e55b8e35 [ms-inline asm] Remove old cruft now that MS-style asms their own code path.
llvm-svn: 162210
2012-08-20 17:11:53 +00:00
Jordan Rose 0a9ea7c70d [analyzer] The result of && or || is always a 1 or 0.
Forgetting to at least cast the result was giving us Loc/NonLoc problems
in SValBuilder (hitting an assertion). But the standard (both C and C++)
does actually guarantee that && and || will result in the actual values
1 and 0, typed as 'int' in C and 'bool' in C++, and we can easily model that.

PR13461

llvm-svn: 162209
2012-08-20 17:04:45 +00:00
Greg Clayton 486290078c Added qVAttachOrWaitSupported packet support.
llvm-svn: 162207
2012-08-20 16:50:43 +00:00
Dmitri Gribenko b1cfa19b5a Use correct matcher name in the comment.
llvm-svn: 162206
2012-08-20 16:48:14 +00:00
Manuel Klimek 4f3ecf1ce0 Fix comments and variable naming:
- use InnerMatcher consistently, fix style violations on the way
- doxygenify code snippets across all comments
- start doxygenifying code references in text
- addeed missing Usable as: sections

llvm-svn: 162205
2012-08-20 16:37:20 +00:00
Filipe Cabecinhas c30199917a A baton isn't needed to dispatch input.
I also added a typemap to make DispatchInput usable in Python.

llvm-svn: 162204
2012-08-20 16:21:04 +00:00
Filipe Cabecinhas 4c1f3a1cc5 Add FILE* typemaps for SBDebugger.GetInputFileHandle() and friends.
llvm-svn: 162203
2012-08-20 16:10:44 +00:00
Alexander Potapenko 02e6f03236 Dynamic interceptors for dispatch_async and dispatch_after.
llvm-svn: 162202
2012-08-20 11:59:26 +00:00
Benjamin Kramer 1b07ab51e4 DataExtractor: Fix integer truncation issues in LEB128 extraction.
llvm-svn: 162201
2012-08-20 10:52:11 +00:00
Tobias Grosser 6e98cdebf4 [cindex.py] Cache the number of chunks in CompletionString
Without this patch, lib.clang_getNumCompletionChunks is called at
each _iteration_ of a 'for chunk in CompletionString' loop. Now we
call it just once.

llvm-svn: 162200
2012-08-20 10:38:16 +00:00
Alexander Potapenko 1233d558dc Minor refactoring: reduce code duplication by introducing a macro for dispatch_sync_f, dispatch_async_f, dispatch_barrier_async_f bodies.
llvm-svn: 162199
2012-08-20 09:25:10 +00:00
Hans Wennborg d799a2b3b9 Better wording for reference self-initialization warning.
llvm-svn: 162198
2012-08-20 08:52:22 +00:00
Alexander Potapenko 4a156c1b80 Fix a leftover #if defined(DYNAMIC_MAC_WRAPPERS).
llvm-svn: 162197
2012-08-20 08:49:49 +00:00
Stepan Dyatkovskiy 6ee89aafc8 Forget to add testcase for r162195. Sorry.
llvm-svn: 162196
2012-08-20 08:03:18 +00:00
Stepan Dyatkovskiy 6a638ec521 Fixed DAGCombiner bug (found and localized by James Malloy):
The DAGCombiner tries to optimise a BUILD_VECTOR by checking if it
consists purely of get_vector_elts from one or two source vectors. If
so, it either makes a concat_vectors node or a shufflevector node.

However, it doesn't check the element type width of the underlying
vector, so if you have this sequence:

Node0: v4i16 = ...
Node1: i32 = extract_vector_elt Node0
Node2: i32 = extract_vector_elt Node0
Node3: v16i8 = BUILD_VECTOR Node1, Node2, ...

It will attempt to:

Node0:    v4i16 = ...
NewNode1: v16i8 = concat_vectors Node0, ...

Where this is actually invalid because the element width is completely
different. This causes an assertion failure on DAG legalization stage.

Fix:
If output item type of BUILD_VECTOR differs from input item type.
Make concat_vectors based on input element type and then bitcast it to the output vector type. So the case described above will transformed to:
Node0:    v4i16 = ...
NewNode1: v8i16 = concat_vectors Node0, ...
NewNode2: v16i8 = bitcast NewNode1

llvm-svn: 162195
2012-08-20 07:57:06 +00:00
Craig Topper b58eec4eaf Remove FMA3 intrinsic instructions in favor of patterns.
llvm-svn: 162194
2012-08-20 06:21:25 +00:00
Craig Topper 37eca54912 Use correct intrinsic for 256-bit VFMSUBADDPS.
llvm-svn: 162193
2012-08-20 06:03:04 +00:00
Craig Topper 5122e9f194 Remove trailing white space and tab characters. No functional change.
llvm-svn: 162192
2012-08-19 23:37:46 +00:00
Tobias Grosser e9633f16bd [cindex.py] Add CachedProperty to CompletionChunk
Suggested by:  Francisco Lopes  <oblita@gmail.com>

llvm-svn: 162191
2012-08-19 22:26:15 +00:00
Gregory Szorc fbd4f4768c [clang.py] Add CachedProperty decorator
It isn't used anywhere yet.

llvm-svn: 162190
2012-08-19 21:17:46 +00:00
Howard Hinnant a3b7a802cc In C++03 mode add an explicit conversion from int to the emulated class enum. Fixes a problem reported by C. Bergström.
llvm-svn: 162189
2012-08-19 17:14:47 +00:00
Howard Hinnant e4b2a743b8 Patch contributed by Dev Dude for mingw64 port.
llvm-svn: 162188
2012-08-19 15:13:16 +00:00
Nadav Rotem 178250ad87 When unsafe math is used, we can use commutative FMAX and FMIN. In some cases
this allows for better code generation.

Added a new DAGCombine transformation to convert FMAX and FMIN to FMANC and
FMINC, which are commutative.

For example:

  movaps  %xmm0, %xmm1
  movsd LC(%rip), %xmm0
  minsd %xmm1, %xmm0

becomes:

  minsd LC(%rip), %xmm0

llvm-svn: 162187
2012-08-19 13:06:16 +00:00
Benjamin Kramer fd4fe7061c Fabs folding is implemented.
llvm-svn: 162186
2012-08-19 09:51:44 +00:00
Tobias Grosser 83bc743bf4 [cindex.py] Use spaces, not tabs for indentation
Reported by: Francisco Lopes  <oblita@gmail.com>

llvm-svn: 162182
2012-08-18 23:52:41 +00:00
Tobias Grosser 2fb29363f9 [cindex.py] Dispose code completion results properly
llvm-svn: 162181
2012-08-18 23:04:08 +00:00
Benjamin Kramer 9d03242fcf InstCombine: Fix a crasher when encountering a function pointer.
llvm-svn: 162180
2012-08-18 22:04:34 +00:00
Jakob Stoklund Olesen e1014e7b98 Remove the CAND/COR/CXOR custom ISD nodes and their select code.
These nodes are no longer needed because the peephole pass can fold
CMOV+AND into ANDCC etc.

llvm-svn: 162179
2012-08-18 21:49:50 +00:00
Craig Topper fd1c925946 Remove virtual from many methods. These methods replace methods in the base class, but the base class methods aren't virtual so it just increased call overhead.
llvm-svn: 162178
2012-08-18 21:38:45 +00:00
Jakob Stoklund Olesen dded061f85 Also combine zext/sext into selects for ARM.
This turns common i1 patterns into predicated instructions:

  (add (zext cc), x) -> (select cc (add x, 1), x)
  (add (sext cc), x) -> (select cc (add x, -1), x)

For a function like:

  unsigned f(unsigned s, int x) {
    return s + (x>0);
  }

We now produce:

  cmp r1, #0
  it  gt
  addgt.w r0, r0, #1

Instead of:

  movs  r2, #0
  cmp r1, #0
  it  gt
  movgt r2, #1
  add r0, r2

llvm-svn: 162177
2012-08-18 21:25:22 +00:00
Jakob Stoklund Olesen aab43dbfbb Also pass logical ops to combineSelectAndUse.
Add these transformations to the existing add/sub ones:

  (and (select cc, -1, c), x) -> (select cc, x, (and, x, c))
  (or  (select cc, 0, c), x)  -> (select cc, x, (or, x, c))
  (xor (select cc, 0, c), x)  -> (select cc, x, (xor, x, c))

The selects can then be transformed to a single predicated instruction
by peephole.

This transformation will make it possible to eliminate the ISD::CAND,
COR, and CXOR custom DAG nodes.

llvm-svn: 162176
2012-08-18 21:25:16 +00:00
Benjamin Kramer 9282aef86d Remove overly conservative hasOneUse check, this always expands into a single IR instruction.
llvm-svn: 162175
2012-08-18 20:24:19 +00:00
Benjamin Kramer 8c2a733c55 InstCombine: Add a couple of fabs identities for comparing with 0.0.
llvm-svn: 162174
2012-08-18 20:06:47 +00:00
Benjamin Kramer 000132454c SimplifyLibcalls: Add fabs and trunc to the list of libcalls that are safe to shrink from double to float.
llvm-svn: 162173
2012-08-18 19:27:32 +00:00
Nadav Rotem a136939fa9 Reapply r162160 with a fix: Optimize Arith->Trunc->SETCC sequence to allow better compare/branch code.
llvm-svn: 162172
2012-08-18 17:53:03 +00:00
Jordan Rose 8c1ac0c376 Allow -verify to be used with files that don't have an associated FileEntry.
In Debug builds, VerifyDiagnosticConsumer checks any files with diagnostics
to make sure we got the chance to parse them for directives (expected-warning
and friends). This check previously relied on every parsed file having a
FileEntry, which broke the cling interpreter's test suite.

This commit changes the extra debug checking to mark a file as unparsed
as soon as we see a diagnostic from that file. At the very end, any files
that are still marked as unparsed are checked for directives, and a fatal
error is emitted (as before) if we find out that there were directives we
missed. -verify directives should always live in actual parsed files, not
in PCH or AST files.

Patch by Andy Gibbs, with slight modifications by me.

llvm-svn: 162171
2012-08-18 16:58:52 +00:00
Anton Korobeynikov 1e28826abe fp16-to-fp32 conversion instructions are available in Thumb mode as well.
Make sure the generic pattern is used.

llvm-svn: 162170
2012-08-18 13:08:43 +00:00
Dmitry Vyukov e59bed4e8a tsan: proper handling of linker initialized mutexes
llvm-svn: 162169
2012-08-18 11:49:00 +00:00
Benjamin Kramer a95b3ffe8f Silence a sign compare warning that only occurs on 32 bit platforms.
llvm-svn: 162168
2012-08-18 10:33:09 +00:00
Jason Molenda 8eba46c68a Some eh_frame unwind instructions will define a return address register;
when you want to find the caller's saved pc, you look up the return address
register and use that.  On arm, for instance, this would be the contents of
the link register (lr).

If the eh_frame CIE defines an RA, record that fact in the UnwindPlan.

When we're finding a saved register, if it's the pc, lok for the location
of the return address register instead.

<rdar://problem/12062310> 

llvm-svn: 162167
2012-08-18 06:53:34 +00:00
Craig Topper 0128f9bad7 Refactor code a bit to reduce number of calls in the final compiled code. No functional change intended.
llvm-svn: 162166
2012-08-18 06:39:34 +00:00
Craig Topper 2bd9c7bd2d Reorder initialization list to silence -Wreorder
llvm-svn: 162165
2012-08-18 06:20:54 +00:00
Nadav Rotem c324af609e Revert r162160 because it made a few buildbots fail.
llvm-svn: 162164
2012-08-18 05:02:36 +00:00
John McCall dd61f2eb6d When mangling a negative number, remember that negating it does not
always yield a positive number.  Just print the negated result as an
unsigned number.

llvm-svn: 162163
2012-08-18 04:51:52 +00:00