Commit Graph

154785 Commits

Author SHA1 Message Date
Bill Schmidt 0cf702fa61 [PowerPC] Skeletal FastISel support for 64-bit PowerPC ELF.
This is the first of many upcoming patches for PowerPC fast
instruction selection support.  This patch implements the minimum
necessary for a functional (but extremely limited) FastISel pass.  It
allows the table-generated portions of the selector to be created and
used, but in most cases selection will fall back to the DAG selector.
None of the block terminator instructions are implemented yet, and
most interesting instructions require some special handling.
Therefore there aren't any new test cases with this patch.  There will
be quite a few tests coming with future patches.

This patch adds the make/CMake support for the new code (including
tablegen -gen-fast-isel) and creates the FastISel object for PPC64 ELF
only.  It instantiates the necessary virtual functions
(TargetSelectInstruction, TargetMaterializeConstant,
TargetMaterializeAlloca, tryToFoldLoadIntoMI, and FastLowerArguments),
but of these, only TargetMaterializeConstant contains any useful
implementation.  This is present since the table-generated code
requires the ability to materialize integer constants for some
instructions.

This patch has been tested by building and running the
projects/test-suite code with -O0.  All tests passed with the
exception of a couple of long-running tests that time out using -O0
code generation.

llvm-svn: 187399
2013-07-30 00:50:39 +00:00
Aaron Ballman be50eb86e6 Refactor some attributes to use checkFunctionOrMethodArgumentIndex instead of using custom logic. No functional changes intended.
llvm-svn: 187398
2013-07-30 00:48:57 +00:00
Quentin Colombet e2e0548d77 [R600] Replicate old DAGCombiner behavior in target specific DAG combine.
build_vector is lowered to REG_SEQUENCE, which is something the register
allocator does a good job at optimizing.

llvm-svn: 187397
2013-07-30 00:27:16 +00:00
Quentin Colombet 6bf4baa408 [DAGCombiner] insert_vector_elt: Avoid building a vector twice.
This patch prevents the following combine when the input vector is used more
than once.
insert_vector_elt (build_vector elt0, ..., eltN), NewEltIdx, idx
=>
build_vector elt0, ..., NewEltIdx, ..., eltN 

The reasons are:
- Building a vector may be expensive, so try to reuse the existing part of a
  vector instead of creating a new one (think big vectors).
- elt0 to eltN now have two users instead of one. This may prevent some other
  optimizations.

llvm-svn: 187396
2013-07-30 00:24:09 +00:00
Greg Clayton 6e10f149c4 <rdar://problem/14526890>
Fixed a crasher when using memory threads where a thread is sticking around too long and was causing problems when it didn't have a thread plan. 

llvm-svn: 187395
2013-07-30 00:23:06 +00:00
Eric Christopher 4ed04e2ee3 Move file to X86 and add a triple to fix darwin bots for now.
The problem is due to the section name being explicitly mentioned in
the IR and differing between the two platforms.

llvm-svn: 187394
2013-07-30 00:20:06 +00:00
Eric Christopher e414ece79a Fix a truly egregious thinko in anonymous namespace check,
update testcase to make sure we generate debug info for walrus
by adding a non-trivial constructor and verify that we don't
emit an ODR signature for the type.

llvm-svn: 187393
2013-07-29 23:53:08 +00:00
Eric Christopher d853ea3142 Make sure we don't emit an ODR hash for types with no name and make
sure the comments for each testcase are a bit easier to distinguish.

llvm-svn: 187392
2013-07-29 23:53:05 +00:00
Eric Christopher 32d1531a33 Clarify comments for types contained in anonymous namespaces and
odr hashes.

llvm-svn: 187391
2013-07-29 23:53:01 +00:00
Rui Ueyama 85cd10ffa0 [PECOFF][Driver] Remove quotes from command line arguments.
The command line option in .drectve section may be quoted by double
quotes, and if that's the case we have to remove them.

llvm-svn: 187390
2013-07-29 23:32:22 +00:00
Daniel Malea 4d3de853a2 Fix TestConcurrentEvents to behave nicely with GCC 4.8
- newer gcc generates additional debuginfo for function exit (stack object desctruction) which was causing tests to fail
- work-around consists of not declaring any stack objects in main()

llvm-svn: 187389
2013-07-29 23:13:08 +00:00
Rui Ueyama b469aeb164 [PECOFF] Process Import Name/Type field in the import library.
This patch removes hacky mangle() function, which strips all decorations
uncondtitionally. LLD now interprets Import Name/Type field in the import
library properly as described in the Microsoft PE/COFF Spec.

llvm-svn: 187388
2013-07-29 22:55:39 +00:00
David Blaikie 4bc4751755 Remove assert header dependency in test
llvm-svn: 187387
2013-07-29 22:37:42 +00:00
Alexander Kornienko 6d8cf83a4d Simplified SourceManager::translateLineCol a bit.
Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits

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

llvm-svn: 187386
2013-07-29 22:26:10 +00:00
Eric Christopher f8542ec305 Elaborate a bit on the type unit and ODR conditional code.
llvm-svn: 187385
2013-07-29 22:24:32 +00:00
John Thompson dc118270ac Fixed comment typo.
llvm-svn: 187384
2013-07-29 21:59:41 +00:00
Rafael Espindola d123099abc Make file_status::getUniqueID const.
llvm-svn: 187383
2013-07-29 21:55:38 +00:00
Rui Ueyama 7ac447fdfc [PECOFF] Replace the magic number with sizeof().
llvm-svn: 187382
2013-07-29 21:54:43 +00:00
Rui Ueyama 5b274f3414 Fix test failure introduced in r187271 by enabling pipefail.
llvm-svn: 187381
2013-07-29 21:50:33 +00:00
Rafael Espindola cb87e35ed6 Delete documentation for deleted options.
llvm-svn: 187380
2013-07-29 21:35:48 +00:00
Rafael Espindola 073ff10138 Update for llvm api change.
llvm-svn: 187379
2013-07-29 21:26:52 +00:00
Rafael Espindola 7f822a9306 Include st_dev to make the result of getUniqueID actually unique.
This will let us use getUniqueID instead of st_dev directly on clang.

llvm-svn: 187378
2013-07-29 21:26:49 +00:00
Ed Maste 64fad60e34 Use flag instead of rwlock state to track process running state
LLDB requires that the inferior process be stopped before, and remain
stopped during, certain accesses to process state.

Previously this was achieved with a POSIX rwlock which had a write lock
taken for the duration that the process was running, and released when
the process was stopped.  Any access to process state was performed with
a read lock held.

However, POSIX requires that pthread_rwlock_unlock() be called from the
same thread as pthread_rwlock_wrlock(), and lldb needs to stop and start
the process from different threads.  Violating this constraint is
technically undefined behaviour, although as it happens Linux and Darwin
result in the unlock proceeding in this case.  FreeBSD follows POSIX
more strictly, and the unlock would fail, resulting in a hang later upon
the next attempt to take the lock.

All read lock consumers use ReadTryLock() and handle failure to obtain
the lock (typically by logging an error "process is running").  Thus,
instead of using the lock state itself to track the running state, this
change adds an explicit m_running flag.  ReadTryLock tests the flag, and
if the process is not running it returns with the read lock held.

WriteLock and WriteTryLock are renamed to SetRunning and TrySetRunning,
and (if successful) they set m_running with the lock held.  This way,
read consumers can determine if the process is running and act
appropriately, and write consumers are still held off from starting the
process if read consumers are active.

Note that with this change there are still some curious access patterns,
such as calling WriteUnlock / SetStopped twice in a row, and there's no
protection from multiple threads trying to simultaneously start the
process.  In practice this does not seem to be a problem, and was
exposing other undefined POSIX behaviour prior to this change.

llvm-svn: 187377
2013-07-29 20:58:06 +00:00
Chandler Carruth 35e64ba03a Make this test not try to write on object file and test all of the
output rather than just part of it.

Also, remove the frighteningly ancient comment about not working with
the gcc-driver. (!!!)

llvm-svn: 187376
2013-07-29 20:29:53 +00:00
Manman Ren 620e978f69 Debug Info: enable verifier for testing cases.
llvm-svn: 187375
2013-07-29 20:18:19 +00:00
Richard Smith 1235a8dac6 PR16715: Fix assert in verifier: only mark call to 'operator new' as 'builtin' if
corresponding 'operator new' was actually emitted as a function marked 'nobuiltin'.

llvm-svn: 187374
2013-07-29 20:14:16 +00:00
Peter Collingbourne e572e17a8e Fix warning.
llvm-svn: 187373
2013-07-29 20:13:41 +00:00
Peter Collingbourne 9058c07c95 Move UnpoisonMappedDSO to sanitizer_common.
This is so DFSan will be able to use it.

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

llvm-svn: 187372
2013-07-29 19:09:49 +00:00
Akira Hatanaka 52dd808bc3 [mips] Add comment and simplify function.
llvm-svn: 187371
2013-07-29 19:08:34 +00:00
John Thompson 7c6e79f395 Fixed comment issues (non-ASCII chars, typos) per review, expanded some comments.
llvm-svn: 187370
2013-07-29 19:07:00 +00:00
Howard Hinnant e5c13decbe Debug mode for unordered_multiset. The exercise spotted a few places I had missed on unordered_set, so I picked those up as well.
There are actually two debug modes:

   1.  -D_LIBCPP_DEBUG2 or -D_LIBCPP_DEBUG2=1
       This is a relatively expensive debug mode, but very thorough.  This is normally what you want to debug with, but may turn O(1) operations into O(N) operations.

   2.  -D_LIBCPP_DEBUG2=0
       This is "debug lite."  Only preconditions that can be checked with O(1) expense are checked.  For example range checking on an indexing operation.  But not iterator validity.

llvm-svn: 187369
2013-07-29 19:05:47 +00:00
Nadav Rotem 16e9dd4dd2 Add the C source code to the test to make it easier to update when debug info changes.
Thanks Eric.

llvm-svn: 187368
2013-07-29 18:47:36 +00:00
Rafael Espindola 74ca78ed9b Convert a use of status with llvm::sys::fs::getUniqueID.
llvm-svn: 187367
2013-07-29 18:43:40 +00:00
Hans Wennborg 4a9ca978b0 test/Driver/cl.c, remove quotes around /help
The quotes (from r187330) didn't really help here, the trick was to disable
the test on MSYS builds. This removes those quotes, changes back the comment
to explain why /? has to be quoted specifically, and moves the REQUIRES
line to the top of the file because that's important.

llvm-svn: 187366
2013-07-29 18:40:38 +00:00
David Blaikie 021221db7c Support for Thread Safety Analysis in C
Patch by Ethan Jackson.

llvm-svn: 187365
2013-07-29 18:24:03 +00:00
Rafael Espindola e4777f4638 Convert a use of stat with sys::fs::status.
llvm-svn: 187364
2013-07-29 18:22:23 +00:00
Nadav Rotem d9c74cc6d3 SLPVectorier: update the debug location for the new instructions.
llvm-svn: 187363
2013-07-29 18:18:46 +00:00
Manman Ren e9a52e18da Debug Info: update testing cases to pass verifier.
llvm-svn: 187362
2013-07-29 18:12:58 +00:00
Ashok Thirumurthi 6e264d39dc Adds a DW_OP_call_frame_cfa handler when evaluating DWARF 3/4 expressions
in LLDB that load the canonical frame address rather than a location list.

- Handles the simple case where a CFA can be pulled from the current stack frame.
- Fixes more than one hundred failing tests with gcc 4.8!

TODO: Use UnwindPlan::GetRowForFunctionOffset if the DWARFExpression needs
to be evaluated in a context analogous to a virtual unwind (perhaps using RegisterContextLLDB).

- Also adds some comments to DWARFCallFrameInfo whenever I got confused.

llvm-svn: 187361
2013-07-29 16:05:11 +00:00
Guillaume Papin a3eede2cc2 cpp11-migrate: Add -for-compilers command line switch.
This change add a new option command line option -for-compilers that allows the
user to enable multiple transforms automatically.

Another difference is that now all transforms are enabled by default.

llvm-svn: 187360
2013-07-29 15:58:47 +00:00
Rafael Espindola ee30546c00 Fix handling of "clang c:foo"
On windows, c:foo is a valid file path, but stat fails on just "c:". This
causes a problem for clang since its file manager wants to cache data about
the parent directory.

There are refactorings to be done in here, but this gives clang the correct
behavior and testing first.

Patch by Yunzhong Gao!

llvm-svn: 187359
2013-07-29 15:47:24 +00:00
Howard Hinnant aa5aa98eab Add operator new[] to test. Partial fix for valgrind warning in http://llvm.org/bugs/show_bug.cgi?id=16703.
llvm-svn: 187358
2013-07-29 14:43:42 +00:00
Marshall Clow 83c08b4497 Implement N3421; comparison predicates<void>
llvm-svn: 187357
2013-07-29 14:21:53 +00:00
Nico Rieck 7fdaee8f15 Use proper section suffix for COFF weak symbols
32-bit symbols have "_" as global prefix, but when forming the name of
COMDAT sections this prefix is ignored. The current behavior assumes that
this prefix is always present which is not the case for 64-bit and names
are truncated.

llvm-svn: 187356
2013-07-29 13:58:39 +00:00
Nico Rieck 06d17c80cc Proper va_arg/va_copy lowering on win64
Win64 uses CharPtrBuiltinVaList instead of X86_64ABIBuiltinVaList like
other 64-bit targets.

llvm-svn: 187355
2013-07-29 13:07:06 +00:00
Aaron Ballman f5aacd34e4 Re-application of 187310. Re-enabling warning C4275 for MSVC 11 and up, but not MSVC 10 since it is still required there.
llvm-svn: 187354
2013-07-29 13:02:08 +00:00
Rafael Espindola b6b5f52ee8 Add support for the 's' operation to llvm-ar.
If no other operation is specified, 's' becomes an operation instead of an
modifier. The s operation just creates a symbol table. It is the same as
running ranlib.

We assume the archive was created by a sane ar (like llvm-ar or gnu ar) and
if the symbol table is present, then it is current. We use that to optimize
the most common case: a broken build system that thinks it has to run ranlib.

llvm-svn: 187353
2013-07-29 12:40:31 +00:00
Nico Rieck 2c9c89b21d MC: Support larger COFF string tables
Single-slash encoded entries do not require a terminating null. This bumps
the maximum table size from ~1MB to ~9.5MB.

llvm-svn: 187352
2013-07-29 12:30:12 +00:00
NAKAMURA Takumi 1373b743bb ExceptionDemo.cpp: Tweak a @param. [-Wdocumentation]
llvm-svn: 187351
2013-07-29 11:03:50 +00:00
Benjamin Kramer fb34989a82 Some Intel Penryn CPUs come with SSE4 disabled. Detect them as core 2.
PR16721.

llvm-svn: 187350
2013-07-29 11:02:08 +00:00