Commit Graph

159889 Commits

Author SHA1 Message Date
Hans Wennborg 2c21f74f02 clang-cl: Add support for asm listings (/FA and /Fa)
This adds support for outputing the assembly to a file during compilation.
It does this by changing the compilation pipeling to not use the integrated
assembler, and keep the intermediate assembler file.

Differential Revision: http://llvm-reviews.chandlerc.com/D1946

llvm-svn: 192902
2013-10-17 16:16:23 +00:00
Alexander Potapenko 1f5573cca2 [ASan] fix assign_large_valloc_to_global.cc to use the correct header for valloc() on OSX.
llvm-svn: 192901
2013-10-17 15:48:24 +00:00
Rafael Espindola 8db352d532 Rename some functions for consistency.
Every other function in Redeclarable.h was using Decl instead of Declaration.

llvm-svn: 192900
2013-10-17 15:37:26 +00:00
Daniel Sanders 9469417064 [mips] Added -mfp64 and -mfp32 options.
These options specify 64-bit FP registers and 32-bit FP registers respectively.

When using -mfp32, the FPU has 16x double-precision registers overlapping with
the 32x single-precision registers (each double-precision register overlaps
two single-precision registers).

When using -mfp64, the FPU has 32x double-precision registers overlapping with
the 32x single-precision registers (each double-precision register overlaps
with one single-precision register and has an additional 32-bits).

MSA requires -mfp64.

llvm-svn: 192899
2013-10-17 14:55:58 +00:00
Daniel Sanders 206bf6243c [mips][msa] Update -mmsa help text and removed the hidden flag to better match conventions used by other targets
llvm-svn: 192898
2013-10-17 14:35:42 +00:00
Ed Maste 4a1c279795 Correct log message typo: ended ad -> ended at
llvm-svn: 192897
2013-10-17 14:03:07 +00:00
Daniel Sanders c835a9fe80 [mips][msa] Added most of the remaining builtins
Includes:
and.v, bmnz.v, bmz.v, bnz.[bhwdv], bz.[bhwdv], cfcmsa, ctcmsa, fcaf,
fcor, fcueq, fcul[et], fcun, fcune, fsaf, fsueq, fsul[et], fsun, fsune, ftrunc
hadd_[su].[hwd], hsub_[su].[hwd], insert.[bhw], insve.[bhw], ld.[bhwd],
move.v, nor.v, or.v, srar.[bhwd], srari.[bhwd], srlr.[bhwd], srlri.[bhwd],
st.[bhwd], subsus_u.[bhwd], subsuu_s.[bhwd], vshf.[bhwd], xor.v

llvm-svn: 192896
2013-10-17 13:57:25 +00:00
Daniel Sanders a4eaf59f9e [mips][msa] Added lsa instruction
llvm-svn: 192895
2013-10-17 13:38:20 +00:00
Alexey Samsonov caabb0eac1 [DebugInfo] Delete dead code, simplify and fix code style for some existing code. No functionality change.
llvm-svn: 192894
2013-10-17 13:28:16 +00:00
Ed Maste 737e92b036 Remove unused DWARFCompileUnit::Extract variant
llvm-svn: 192893
2013-10-17 13:23:03 +00:00
Kostya Serebryany 8e2881d0c2 [asan] fix a failure with ASAN_OPTIONS=verbosity=1:use_sigaltstack=1
llvm-svn: 192892
2013-10-17 13:18:21 +00:00
NAKAMURA Takumi 1c19a0f4a8 Lit: LIT_PRESERVES_TMP should be aware of TMPDIR, too.
TMPDIR is preferred in Unix.

llvm-svn: 192891
2013-10-17 13:11:13 +00:00
Benjamin Kramer d687560d51 Fix tests not to depend on specific regalloc or instruction order.
They were failing with -mcpu=atom.

llvm-svn: 192890
2013-10-17 12:41:05 +00:00
Daniel Sanders 66f5e46a2d Fix r192888: test/CodeGen/Mips/msa/3r_ld_st.ll should have been deleted
llvm-svn: 192889
2013-10-17 12:36:35 +00:00
Daniel Sanders 0390568a09 [mips][msa] Removed ldx.[bhwd] and stx.[bhwd].
These were present in a previous version of the MSA spec but are not
present in the published version. There is no hardware that uses these
instructions.

llvm-svn: 192888
2013-10-17 12:16:03 +00:00
NAKAMURA Takumi 199f138a07 Lit: Introduce an environment variable, $LIT_PRESERVES_TMP, to preserve TMP (and TEMP).
This is intended to check how many temporary files would be generated in automated builders.

llvm-svn: 192887
2013-10-17 12:10:12 +00:00
Evgeniy Stepanov 4bbf273173 [sanitizer] Fix unpoisoning of msghdr::msg_name in recvmsg interceptor.
llvm-svn: 192886
2013-10-17 11:32:30 +00:00
Kostya Serebryany f04ae33106 [asan] Fix a deadlock between asan's allocator and lsan
Summary:
This fixes a deadlock which happens in lsan
on a large memalign-allocated chunk that resides in lsan's root set.

Reviewers: samsonov, earthdok

Reviewed By: earthdok

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1957

llvm-svn: 192885
2013-10-17 11:18:11 +00:00
Richard Sandiford 95f7ba988b Replace sra with srl if a single sign bit is required
E.g. (and (sra (i32 x) 31) 2) -> (and (srl (i32 x) 30) 2).

llvm-svn: 192884
2013-10-17 11:16:57 +00:00
Andrea Di Biagio 561badf717 Fix edge condition in DAGCombiner to improve codegen of shift sequences.
When canonicalizing dags according to the rule
(shl (zext (shr X, c1) ), c1) ==> (zext (shl (shr X, c1), c1))

remember to add the new shl dag to the DAGCombiner worklist of nodes.
If we don't explicitly add it to the worklist of nodes to visit, we
may not trigger later on the rule that folds the shift left + logical
shift right into a AND instruction with bitmask.

llvm-svn: 192883
2013-10-17 11:02:58 +00:00
Evgeniy Stepanov 21a9c93a4d [msan] Use zero-extension in shadow cast by default.
Switch to sign-extension in r192575 caused 7% perf loss on 482.sphinx3.

llvm-svn: 192882
2013-10-17 10:53:50 +00:00
Anders Waldenborg 39f5d7d5f0 llvm-c: Don't assert in LLVMTargetMachineEmitToFile on nonexistent file
Error handling code for raw_fd_ostream constructor is present, but
never used, because formatted_raw_ostream will always assert on closed
fd's before.

Patch by Peter Zotov

Differential Revision: http://llvm-reviews.chandlerc.com/D1909

llvm-svn: 192881
2013-10-17 10:39:35 +00:00
Daniel Sanders 199b731b42 [mips][msa] Correct definition order of ftrunc_[su], ftint_[su], and ftq.
Define these three instructions in alphabetical order (like the rest of the
file).
No functional change.

llvm-svn: 192880
2013-10-17 10:30:12 +00:00
Michael Kuperstein 2cbd5132bf Changing DebugInfoFinder to iterate over all the compile units.
Solves http://llvm.org/bugs/show_bug.cgi?id=17507

Committed on behalf of alon.mishne@intel.com

llvm-svn: 192879
2013-10-17 10:27:12 +00:00
Anders Waldenborg a89c1e3145 llvm-c: Return NULL from LLVMGetFirstTarget instead of asserting
If no targets are registered, LLVMGetFirstTarget currently fails with
an assertion. This patch makes it return NULL instead, similarly to
how LLVMGetNextTarget would.

Patch by Peter Zotov

Differential Revision: http://llvm-reviews.chandlerc.com/D1908

llvm-svn: 192878
2013-10-17 10:25:24 +00:00
David Majnemer 81857f0bcb Remove unicode characters, trailing whitespace from test case
llvm-svn: 192877
2013-10-17 09:55:56 +00:00
Alexey Samsonov bc7c87a8cb [Sanitizer] Move pthread_cond_signal and pthread_cond_broadcast to common interceptors
llvm-svn: 192876
2013-10-17 09:24:03 +00:00
Timur Iskhodzhanov 406a479ddb Follow-up to r192822: fix Clang assertion when building with -fexceptions
llvm-svn: 192875
2013-10-17 09:11:45 +00:00
Dmitry Vyukov 333112a439 tsan: merge 2 similar tests into 1
llvm-svn: 192874
2013-10-17 08:27:24 +00:00
Dmitry Vyukov e88dbe5774 tsan: add a test for __tsan_default_options()
llvm-svn: 192873
2013-10-17 08:13:38 +00:00
Dmitry Vyukov ae4ea1d338 tsan: update docs
update docs for no_sanitize_thread attribute and blacklist

llvm-svn: 192872
2013-10-17 08:06:19 +00:00
Dmitry Vyukov b1ad5720a2 tsan: implement no_sanitize_thread attribute
If a function has no_sanitize_thread attribute,
do not instrument memory accesses in it.

llvm-svn: 192871
2013-10-17 07:20:06 +00:00
Will Dietz ece9ede240 Use configured PYTHON in asan lit tests.
llvm-svn: 192870
2013-10-17 05:33:22 +00:00
Bill Wendling 7c3d2e11f0 This is now passing. Uncomment and close out PR6281.
llvm-svn: 192869
2013-10-17 04:13:35 +00:00
Saleem Abdulrasool 55410fff8e unwinder: conditionalise availability
__attribute__ (( unavailable )) is for Apple specific builds.  Create a macro
to conditionalise the usage of the macro.  This is to aid in porting the
unwinder to other platforms.

llvm-svn: 192868
2013-10-17 03:57:41 +00:00
Chandler Carruth b4d179cc4f Add support to the Clang driver for forwarding all of gfortran's flags
to GCC when asked to compile a fortran input.

This fixes a regression with essentially every Fortran compile since we
started rejecting unknown flags. Also moves a mis-classified gfortran
flag into the nicely documented set.

llvm-svn: 192867
2013-10-17 03:28:24 +00:00
Jim Grosbach c044c65470 x86: Move bitcasts outside concat_vector.
Consider the following:

typedef unsigned short ushort4U __attribute__((ext_vector_type(4),
aligned(2)));
typedef unsigned short ushort4 __attribute__((ext_vector_type(4)));
typedef unsigned short ushort8 __attribute__((ext_vector_type(8)));
typedef int int4 __attribute__((ext_vector_type(4)));

int4 __bbase_cvt_int(ushort4 v) {
  ushort8 a;
  a.lo = v;
  return _mm_cvtepu16_epi32(a);
}

This generates the, not unreasonable, IR:
define <4 x i32> @foo0(double %v.coerce) nounwind ssp {
  %tmp = bitcast double %v.coerce to <4 x i16>
  %tmp1 = shufflevector <4 x i16> %tmp, <4 x i16> undef, <8 x i32> <i32
  %0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
  %tmp2 = tail call <4 x i32> @llvm.x86.sse41.pmovzxwd(<8 x i16> %tmp1)
  ret <4 x i32> %tmp2
}

The problem is when type legalization gets hold of the v4i16. It
legalizes that by spilling to the stack, then doing a zero-extending
load. Things go even more silly from there, ending up with something
like:
_foo0:
  movsd %xmm0, -8(%rsp)       <== Spill to the stack.
  movq  -8(%rsp), %xmm0       <== Reload it right back out.
  pmovzxwd  %xmm0, %xmm1      <== Here's what we actually asked for.
  pblendw $1, %xmm1, %xmm0    <== We don't need this at all
  pmovzxwd  %xmm0, %xmm0      <== We already did this
  ret

The v8i8 to v8i16 zext intrinsic gives even worse results, with two
table lookups via pshufb instructions(!!).

To avoid all that, we can move the bitcasting until after we've formed
the wider (legal) vector type. Then our normal codegen flows along
nicely and we get the expected:
_foo0:
  pmovzxwd  %xmm0, %xmm0
  ret

rdar://15245794

llvm-svn: 192866
2013-10-17 02:58:06 +00:00
Eric Christopher 2c8b7907c3 According to the dwarf standard pubnames and pubtypes for languages
like C++ should be the fully qualified names for the type.

Add a routine that does a language specific context walk to build
up the qualified name and use it when we add types/names to the
tables. Expand the gnu pubnames testcase as it's the most complex
to make sure that qualified types are also being added.

llvm-svn: 192865
2013-10-17 02:06:06 +00:00
Filip Pizlo a535b14157 Expose install_fatal_error_handler() through the C API.
I expose the API with some caveats:

- The C++ API involves a traditional void* opaque pointer for the fatal 
error callback.  The C API doesn’t do this.  I don’t think that the void* 
opaque pointer makes any sense since this is a global callback - there will 
only be one of them.  So if you need to pass some data to your callback, 
just put it in a global variable.

- The bindings will ignore the gen_crash_diag boolean.  I ignore it because 
(1) I don’t know what it does, (2) it’s not documented AFAIK, and (3) I 
couldn’t imagine any use for it.  I made the gut call that it probably 
wasn’t important enough to expose through the C API.

llvm-svn: 192864
2013-10-17 01:38:28 +00:00
Jack Carter d4e9615d1c [projects/test-suite] White space and long line fixes.
No functionality changes.

llvm-svn: 192863
2013-10-17 01:34:33 +00:00
Eric Christopher 9e6f5f9ac7 Add the context that a function was created in as the context for the
function, not the context of the context.

llvm-svn: 192862
2013-10-17 01:31:21 +00:00
Eric Christopher 96eff3f393 Add the subprogram DIEs to the context they're created with only
if they're a declaration, otherwise they're owned by the compile
unit.

llvm-svn: 192861
2013-10-17 01:31:12 +00:00
Reid Kleckner 00d33a5cb1 Add implementations of the MSVC barrier intrinsics
Summary:
These are deprecated in VS 2012 according to MSDN.  They don't actually
compile down to any code.  They prevent the compiler from reordering
memory accesses across the barrier, which is what a memory-clobbering
volatile asm does.

Reviewers: echristo

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1954

llvm-svn: 192860
2013-10-17 01:29:48 +00:00
Hans Wennborg 69918bccab Re-commit r192758 - MC: quote tricky symbol names in asm output
The reason this got reverted was that the @feat.00 symbol which was emitted
for every TU became quoted, and on cygwin/mingw we use the gas assembler which
couldn't handle the quotes.

This commit fixes the problem by only emitting @feat.00 for win32, where we use
clang -cc1as to assemble. gas would just drop this symbol anyway, so there is no
loss there.

With @feat.00 gone, there shouldn't be quoted symbols showing up on cygwin since
it uses the Itanium ABI, which doesn't put these funny characters in symbols.

> Because of win32 mangling, we produce symbol and section names with
> funny characters in them, most notably @ characters.
>
> MC would choke on trying to parse its own assembly output. This patch addresses
> that by:
>
> - Making @ trigger quoting of symbol names
> - Also quote section names in the same way
> - Just parse section names like other identifiers (to allow for quotes)
> - Don't assume @ signifies a symbol variant if it is in a string.

llvm-svn: 192859
2013-10-17 01:13:02 +00:00
Greg Clayton 312bcbe8b4 <rdar://problem/14972424>
- Made the dynamic register context for the GDB remote plug-in inherit from the generic DynamicRegisterInfo to avoid code duplication
- Finished up the target definition python setting stuff.
- Added a new "slice" key/value pair that can specify that a register is part of another register:
    { 'name':'eax', 'set':0, 'bitsize':32, 'encoding':eEncodingUint, 'format':eFormatHex, 'slice': 'rax[31:0]' },
- Added a new "composite" key/value pair that can specify that a register is made up of two or more registers:
    { 'name':'d0', 'set':0, 'bitsize':64 , 'encoding':eEncodingIEEE754, 'format':eFormatFloat, 'composite': ['s1', 's0'] },
- Added a new "invalidate-regs" key/value pair for when a register is modified, it can invalidate other registers:
    { 'name':'cpsr', 'set':0, 'bitsize':32 , 'encoding':eEncodingUint, 'format':eFormatHex, 'invalidate-regs': ['r8', 'r9', 'r10', 'r11', 'r12', 'r13', 'r14', 'r15']},
    
This now completes the feature that allows a GDB remote target to completely describe itself.

llvm-svn: 192858
2013-10-17 01:10:23 +00:00
Greg Clayton 8afa543737 Fixed the MacOSX non "Debug" builds so that "lldb-platform" doesn't fail to link.
llvm-svn: 192857
2013-10-17 00:27:14 +00:00
David Blaikie 8a142aaa01 DIEHash: Include the type's context in the type hash.
llvm-svn: 192856
2013-10-17 00:10:34 +00:00
David Blaikie 6316ca45a7 DIEHash: Use DW_FORM_sdata for integers, per spec.
This allows us to produce the same hash as GCC for at least some simple
examples.

llvm-svn: 192855
2013-10-16 23:36:20 +00:00
David Blaikie d398ac561f Invert arguments to ASSERT_EQ to match gtest diagnostic printing
GTest assumes the left hand side of the assert is the expectation and
the right hand side is the test result. It's easier to read gtest
failures when these things are ordered correctly.

llvm-svn: 192854
2013-10-16 22:43:10 +00:00
Fariborz Jahanian 1b6678767d ObjectiveC migrator. Remove blank lines
when inferring property from setter/getter
methods. // rdar://15200949

llvm-svn: 192853
2013-10-16 22:35:19 +00:00