Commit Graph

235435 Commits

Author SHA1 Message Date
Matt Arsenault 3add3a40a4 LoadStoreVectorizer: Fix warning about extra semicolon
llvm-svn: 274406
2016-07-01 23:26:54 +00:00
Matt Arsenault accddacb70 TII: Fix inlineasm size counting comments as insts
The main problem was counting comments on their own
line as instructions.

llvm-svn: 274405
2016-07-01 23:26:50 +00:00
Eric Fiselier 58b6e3e3d0 Turn off ASAN's odr-violation diagnostics for now. See PR28391
llvm-svn: 274404
2016-07-01 23:25:47 +00:00
Eric Fiselier d3a1ed814b Work around ABI break caused by C++17 inline variables.
llvm-svn: 274403
2016-07-01 23:22:25 +00:00
Matt Arsenault 28aaf45c10 PeepholeOptimizer: Relax assert
Allow implicit defs

llvm-svn: 274402
2016-07-01 23:15:06 +00:00
David Majnemer bc5976ad58 [CodeView] Include MSVC style names for unnamed types
The CodeView printer expects to be able to generate fully qualified
names from the debug info graph.  This means that we need to include the
MSVC-style name in the debug info for anonymous types.

llvm-svn: 274401
2016-07-01 23:12:54 +00:00
David Majnemer 08bd744c2c [CodeView] Include the offset of nested members
Given something like:
  struct S {
    int a;
    struct { int b; };
  };

We would fail to give 'b' offset 4.  Instead, we would give it the
offset it has inside of it's struct.

llvm-svn: 274400
2016-07-01 23:12:48 +00:00
David Majnemer 6bdc24e7b6 [CodeView] Pretty print anonymous scopes
A namespace without a name should be written out as `anonymous
namespace' while a tag type without a name should be written out as
<unnamed-tag>.

llvm-svn: 274399
2016-07-01 23:12:45 +00:00
Matt Arsenault 7f681ac7a9 AMDGPU: Add feature for unaligned access
llvm-svn: 274398
2016-07-01 23:03:44 +00:00
Matt Arsenault 8af47a09e5 AMDGPU: Expand unaligned accesses early
Due to visit order problems, in the case of an unaligned copy
the legalized DAG fails to eliminate extra instructions introduced
by the expansion of both unaligned parts.

llvm-svn: 274397
2016-07-01 22:55:55 +00:00
Tim Shen 53547d95ca Removes CHECKs for symbolic label names (as Debug Clang will generate).
Differential Revision: http://reviews.llvm.org/D20499

llvm-svn: 274396
2016-07-01 22:50:00 +00:00
Evgeniy Stepanov b736335dc3 [msan] Fix __msan_maybe_ for non-standard type sizes.
Fix incorrect calculation of the type size for __msan_maybe_warning_N
call that resulted in an invalid (narrowing) zext instruction and
"Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed."

Only happens in very large functions (with more than 3500 MSan
checks) operating on integer types that are not power-of-two.

llvm-svn: 274395
2016-07-01 22:49:59 +00:00
Matt Arsenault 327bb5ad82 AMDGPU: Improve load/store of illegal types.
There was a combine before to handle the simple copy case.
Split this into handling loads and stores separately.

We might want to change how this handles some of the vector
extloads, since this can result in large code size increases.

llvm-svn: 274394
2016-07-01 22:47:50 +00:00
Greg Clayton 591ff8376b Fixed thread local storage test case to run normally with no expected fail for Darwin, always skip on windows, and expected fail for all other OSs while mentioning the new bug I filed to track fixing TLS variables: https://llvm.org/bugs/show_bug.cgi?id=28392
llvm-svn: 274393
2016-07-01 22:33:13 +00:00
Manman Ren ebe8cf55ac C++14 init-capture: error out instead of crashing.
When we have template arguments, we have a function and a pattern, the variable
in init-capture belongs to the pattern decl when checking if the lhs of
"max = current" is modifiable:
  auto find = [max = init](auto current) {
    max = current;
  };

In function isReferenceToNonConstCapture, we handle the case where the decl
context for the variable is not part of the current context.

Instead of crashing, we emit an error message:
cannot assign to a variable captured by copy in a non-mutable lambda

rdar://26997922

llvm-svn: 274392
2016-07-01 22:27:16 +00:00
Reid Kleckner ad56ea3129 [codeview] Don't record UDTs for anonymous structs
MSVC makes up names for these anonymous structs, but we don't (yet).
Eventually Clang should use getTypedefNameForAnonDecl() to put some name
in the debug info, and we can update the test case when that happens.

llvm-svn: 274391
2016-07-01 22:24:51 +00:00
Justin Bogner 0efaa349e4 IR: Set TargetPrefix for some X86 and AArch64 intrinsics where it was missing
llvm-svn: 274390
2016-07-01 22:07:11 +00:00
Alina Sbirlea 8d8aa5dd6c Address two correctness issues in LoadStoreVectorizer
Summary:
GetBoundryInstruction returns the last instruction as the instruction which follows or end(). Otherwise the last instruction in the boundry set is not being tested by isVectorizable().
Partially solve reordering of instructions. More extensive solution to follow.

Reviewers: tstellarAMD, llvm-commits, jlebar

Subscribers: escha, arsenm, mzolotukhin

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

llvm-svn: 274389
2016-07-01 21:44:12 +00:00
Greg Clayton c7bb34f6ec Thread local storage was already broken on Linux and the tests were passing because there was a dectorator:
@unittest2.expectedFailure("rdar://7796742")
    
Which was covering up the fact this was failing on linux and hexagon. I added back a decorator so we don't break any build bots.

llvm-svn: 274388
2016-07-01 21:25:20 +00:00
Tim Shen ff12edbff4 Remove unncessary CHECKs from r274385
llvm-svn: 274387
2016-07-01 21:16:58 +00:00
Etienne Bergeron 5393ddde91 [compiler-rt] Fix cmake to propagate debug info to runtime unittests
Summary:
The debug information is not present due to a mis named variabl in 
the cmake files.

Reviewers: rnk

Subscribers: kubabrecka, wang0109, llvm-commits, chrisha

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

llvm-svn: 274386
2016-07-01 21:12:07 +00:00
Tim Shen 421119fd89 [Temporary, Lifetime] Add lifetime marks for temporaries
With all MaterializeTemporaryExprs coming with a ExprWithCleanups, it's
easy to add correct lifetime.end marks into the right RunCleanupsScope.

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

llvm-svn: 274385
2016-07-01 21:08:47 +00:00
Krzysztof Parzyszek 1bba89612b [Hexagon] Revert r274381: that was actually wrong
llvm-svn: 274384
2016-07-01 20:45:19 +00:00
Davide Italiano e929f424a4 [BitcodeFile] Simplify shouldSkip(). NFCI.
llvm-svn: 274383
2016-07-01 20:43:28 +00:00
Etienne Bergeron 3652622cef tab to whitespaces
llvm-svn: 274382
2016-07-01 20:34:25 +00:00
Krzysztof Parzyszek a17250d8e0 [Hexagon] Use MachineOperand::readsReg instead of isUse
llvm-svn: 274381
2016-07-01 20:28:30 +00:00
Felix Berger 7f8827576c [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.
Summary:

Make check more useful in the following two cases:

The parameter is passed by non-const value, has a non-deleted move constructor and is only referenced once in the function as argument to the type's copy constructor.
The parameter is passed by non-const value, has a non-deleted move assignment operator and is only referenced once in the function as argument of the the type's copy assignment operator.
In this case suggest a fix to move the parameter which avoids the unnecessary copy and is closest to what the user might have intended.

Reviewers: alexfh, sbenza

Subscribers: cfe-commits, Prazek

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

llvm-svn: 274380
2016-07-01 20:12:15 +00:00
Vedant Kumar 2aac720adc [Driver] Delete some dead code (NFC)
llvm-svn: 274379
2016-07-01 19:41:20 +00:00
Argyrios Kyrtzidis e7c91045da [libclang] Sync-up the way top-level decls in an ASTUnit are handled with how decls in a DeclContext are handled.
rdar://19775013

llvm-svn: 274378
2016-07-01 19:10:54 +00:00
Greg Clayton 0ba05f1835 Revert fix that didn't work. I will need to debug this on linux to figure things out.
llvm-svn: 274377
2016-07-01 18:55:55 +00:00
Reid Kleckner 6e96a4c64a [pdb] Check the display name for <unnamed-tag>, not the linkage name
This issue was encountered on libcmt.pdb, which has a type record that
looks like this:

  Struct (0x1094) {
    TypeLeafKind: LF_STRUCTURE (0x1505)
    MemberCount: 3
    Properties [ (0x200)
      HasUniqueName (0x200)
    ]
    FieldList: <field list> (0x1093)
    DerivedFrom: 0x0
    VShape: 0x0
    SizeOf: 4
    Name: <unnamed-tag>
    LinkageName: .?AU<unnamed-tag>@@
  }

The checks for startswith/endswith "<unnamed-tag>" should look at the
display name, not the linkage name.

llvm-svn: 274376
2016-07-01 18:43:29 +00:00
Greg Clayton a89746907f Try to fix Ubuntu buildbots after I broke thread local variables with 274366.
llvm-svn: 274374
2016-07-01 18:22:01 +00:00
Reid Kleckner c92e9469c4 [codeview] Assert that our CV type records are valid
We were asserting that our type records were valid when emitting
assembly, but not when emitting an object file.

I've been seeing lots of LNK1285 errors (corrupt PDB) during incremental
debug self-host builds with the MSVC linker, and hopefully this will
catch some of them earlier.

llvm-svn: 274373
2016-07-01 18:05:56 +00:00
Matt Arsenault 105c2a204c AMDGPU/SI: Enable testing several variants for si scheduler
Enable testing different scheduling variants if sgpr usage
is very high. It was previously disabled because of a bug
in handleMove, but it has been fixed since.

Patch by Axel Davy

llvm-svn: 274372
2016-07-01 18:03:46 +00:00
Jonathan Peyton 6b560f0dd9 Fix checks on schedule struct
This change fixes an error in comparing the existing schedule on the team to
the new schedule, in the chunk field. Also added additional checks and used
KMP_CHECK_UPDATE where appropriate.

Patch by Terry Wilmarth.

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

llvm-svn: 274371
2016-07-01 17:54:32 +00:00
Matt Arsenault f652caea65 Emit more intrinsics for builtin functions
This is important for building libclc. Since r273039 tests are failing
due to now emitting calls to these functions instead of emitting the
DAG node. The libm function names are implemented for OpenCL, and should
call the locally defined versions, so -fno-builtin is used. The IR
Some functions use the __builtins and expect the intrinsics to be
emitted. Without this we end up with nobuiltin calls to intrinsics
or to unsupported library calls.

llvm-svn: 274370
2016-07-01 17:38:14 +00:00
Jonathan Peyton c1666960f9 Improve performance of #pragma omp single
EPCC Performance of single is considerably worse than plain barrier.
Adding a read-only check to the code before the atomic compare-and-store
helps considerably.

Patch by Terry Wilmarth.

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

llvm-svn: 274369
2016-07-01 17:37:49 +00:00
Dehao Chen 7b2c997736 Specify mtriple for the frame-order.ll test.
Summary: original test may have different bahavior on different bot, specifically it broke llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast

Reviewers: majnemer

Subscribers: llvm-commits

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

llvm-svn: 274368
2016-07-01 17:35:13 +00:00
Hans Wennborg a3bb5f1594 Revert r274347 "[ARM] Refactor Thumb2 mul instruction descs"
This caused PR28387: Assertion "#operands for dag node doesn't match .td file!"

llvm-svn: 274367
2016-07-01 17:26:42 +00:00
Greg Clayton 63a27afae3 Added support for thread local variables on all Apple OS variants.
We had support that assumed that thread local data for a variable could be determined solely from the module in which the variable exists. While this work for linux, it doesn't work for Apple OSs. The DWARF for thread local variables consists of location opcodes that do something like:

DW_OP_const8u (x)
DW_OP_form_tls_address

or 

DW_OP_const8u (x)
DW_OP_GNU_push_tls_address

The "x" is allowed to be anything that is needed to determine the location of the variable. For Linux "x" is the offset within the TLS data for a given executable (ModuleSP in LLDB). For Apple OS variants, it is the file address of the data structure that contains a pthread key that can be used with pthread_getspecific() and the offset needed. 

This fix passes the "x" along to the thread:

virtual lldb::addr_t
lldb_private::Thread::GetThreadLocalData(const lldb::ModuleSP module, lldb::addr_t tls_file_addr);

Then this is passed along to the DynamicLoader::GetThreadLocalData():

virtual lldb::addr_t
lldb_private::DynamicLoader::GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread, lldb::addr_t tls_file_addr);

This allows each DynamicLoader plug-in do the right thing for the current OS.

The DynamicLoaderMacOSXDYLD was modified to be able to grab the pthread key from the data structure that is in memory and call "void *pthread_getspecific(pthread_key_t key)" to get the value of the thread local storage and it caches it per thread since it never changes.

I had to update the test case to access the thread local data before trying to print it as on Apple OS variants, thread locals are not available unless they have been accessed at least one by the current thread.

I also added a new lldb::ValueType named "eValueTypeVariableThreadLocal" so that we can ask SBValue objects for their ValueType and be able to tell when we have a thread local variable.

<rdar://problem/23308080>

llvm-svn: 274366
2016-07-01 17:17:23 +00:00
John Brawn 4e3656d2cb Make extract_symbols.py be compatible with Python 3
This involved running 2to3 on it and adjusting all uses of subprocess to use
universal_newlines=True so the output is text instead of binary. It remains
compatible with Python 2.7.

llvm-svn: 274365
2016-07-01 17:05:58 +00:00
Francis Ricci 7f9fbec3e8 Skip TestDisassembleRawData when remote
Summary:
As this test will create a new target, it will cause all following tests
to fail when running in platform mode, if the new target does not match
the existing architecture (for example, x86 vs x86_64).

Reviewers: zturner, spyffe, clayborg

Subscribers: lldb-commits

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

llvm-svn: 274364
2016-07-01 16:47:44 +00:00
Duncan P. N. Exon Smith 4a876eb645 CodeGen: Use MachineInstr& in RegisterCoalescer, NFC
Remove a few more implicit iterator to pointer conversions by preferring
MachineInstr&.

llvm-svn: 274363
2016-07-01 16:43:13 +00:00
Sanjay Patel 887aa6d6ef fix documentation comments; NFC
llvm-svn: 274362
2016-07-01 16:41:59 +00:00
Duncan P. N. Exon Smith aae6f3c95e CodeGen: Avoid implicit conversions in TargetInstrInfo, NFC
Avoid implicit conversions from MachineBasicBlock::iterator to
MachineInstr* in TargetInstrInfo.

llvm-svn: 274361
2016-07-01 16:38:28 +00:00
Duncan P. N. Exon Smith b77911be02 CodeGen: Use MachineInstr& in ScheduleDAGIntrs, NFC
Use MachineInstr& to avoid implicit conversions from
MachineBasicBlock::iterator to MachineInstr*.  In one case, this could
use a range-based for loop, but the other loops iterated in reverse
order.

One of the reverse-loops checked the MachineInstr* for nullptr, a
condition that is provably unreachable.  (And even if my proof has a
flaw, UBSan would catch the bug.)

llvm-svn: 274360
2016-07-01 16:21:48 +00:00
Vassil Vassilev ccfadeb20f Revert r274348 and r274349 until the Windows failures are fixed.
llvm-svn: 274359
2016-07-01 16:07:57 +00:00
Adrian Prantl b340676439 Reapply "Define a module map entry for DebugInfo/CodeView."
This reapplies r274313 with two additional #include directives needed
when submodule visibility is enabled.

Fixes PR28384.

llvm-svn: 274358
2016-07-01 15:54:46 +00:00
Dehao Chen ad2b4e1334 Do not count debug instructions when counting number of uses to reorder frame objects.
Summary: The code generation should be independent of the debug info.

Reviewers: zansari, davidxl, mkuper, majnemer

Subscribers: majnemer, llvm-commits

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

llvm-svn: 274357
2016-07-01 15:40:25 +00:00
Saleem Abdulrasool 1f5ceb0b5d Driver: support -L for MSVC toolchain under the GNU driver
When not using clang in the CL emulation mode, honour the -L flags as additional
library paths to pass to the linker invocation.

llvm-svn: 274356
2016-07-01 15:36:31 +00:00