platform/upstream/llvm.git
8 years agoMake tsan tests more portable (take 2)
Renato Golin [Thu, 14 Apr 2016 12:10:21 +0000 (12:10 +0000)]
Make tsan tests more portable (take 2)

Using stderr more uniformily, avoiding potential races when scanning stdout
and stderr output.

Patch by Maxim Kuvyrkov.

llvm-svn: 266294

8 years ago[analyzer] Make it possible to query the function name from a CallDescription.
Gabor Horvath [Thu, 14 Apr 2016 11:56:28 +0000 (11:56 +0000)]
[analyzer] Make it possible to query the function name from a CallDescription.

llvm-svn: 266293

8 years ago[ASTImporter] Implement some expression-related AST node import.
Artem Dergachev [Thu, 14 Apr 2016 11:51:27 +0000 (11:51 +0000)]
[ASTImporter] Implement some expression-related AST node import.

Introduce ASTImporter unit test framework.

Fix a memory leak introduced in cf8ccff5: an array is allocated
in ImportArray and never freed.

Support new node kinds:

- GCCAsmStmt

- AddrLabelExpr
- AtomicExpr
- CompoundLiteralExpr
- CXXBoolLiteralExpr
- CXXNullPtrLiteralExpr
- CXXThisExpr
- DesignatedInitExpr
- GNUNullExpr
- ImplicitValueInitExpr
- InitListExpr
- OpaqueValueExpr
- PredefinedExpr
- ParenListExpr
- StmtExpr
- VAArgExpr

- BinaryConditionalOperator
- ConditionalOperator

- FloatingLiteral
- StringLiteral

- InjectedClassNameType
- TemplateTypeParmType

- LabelDecl

Patch by Aleksei Sidorin!

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

llvm-svn: 266292

8 years agoasan: fix build
Dmitry Vyukov [Thu, 14 Apr 2016 11:40:08 +0000 (11:40 +0000)]
asan: fix build

Some bots failed with:

sanitizer_quarantine.h:104:7: error: unused typedef 'assertion_failed__104' [-Werror,-Wunused-local-typedef]
      COMPILER_CHECK(kPrefetch <= ARRAY_SIZE(b->batch));

Replace COMPILER_CHECK with CHECK.

llvm-svn: 266291

8 years agoReapply r258505 after r266254, this time with a comment to make it more sticky.
Nico Weber [Thu, 14 Apr 2016 11:12:32 +0000 (11:12 +0000)]
Reapply r258505 after r266254, this time with a comment to make it more sticky.

llvm-svn: 266290

8 years ago[Coverage] Update testing methods to support more than two files
Igor Kudrin [Thu, 14 Apr 2016 10:43:37 +0000 (10:43 +0000)]
[Coverage] Update testing methods to support more than two files

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

llvm-svn: 266289

8 years agoasan: fix out-of-bounds access in quarantine
Dmitry Vyukov [Thu, 14 Apr 2016 09:52:33 +0000 (09:52 +0000)]
asan: fix out-of-bounds access in quarantine

llvm-svn: 266288

8 years ago[MSVC] Fix check for wchar_t type in case of -fno-wchar
Dmitry Polukhin [Thu, 14 Apr 2016 09:52:06 +0000 (09:52 +0000)]
[MSVC] Fix check for wchar_t type in case of -fno-wchar

The example below should work identically with and without compiler native
wchar_t support.

void foo(wchar_t * t = L"");

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

llvm-svn: 266287

8 years agoFileSpec: make matching separator-agnostic again
Pavel Labath [Thu, 14 Apr 2016 09:38:06 +0000 (09:38 +0000)]
FileSpec: make matching separator-agnostic again

Summary:
In D18689, I removed the call to Normalize() in FileSpec::SetFile, because it no longer seemed
needed, and it resolved a quirk in the FileSpec API (spec.GetCString() returnes a path with
backslashes, but spec.GetDirectory().GetCString() has forward slashes). This turned out to be a
problem because we would consider paths with different separators as different (which led to
unresolved breakpoints for instance).

Here, I am putting back in the call to Normalize() and adding a unittest for FileSpec::Equal. I
am commenting out the GetDirectory unittests until we figure out the what is the expected
behaviour here.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 266286

8 years ago[mips] Remove duplicate tests and add missing prefixes for *-LABEL checks. NFC.
Vasileios Kalintiris [Thu, 14 Apr 2016 09:13:13 +0000 (09:13 +0000)]
[mips] Remove duplicate tests and add missing prefixes for *-LABEL checks. NFC.

Summary:
The only difference between the removed tests and the pre-existing
ones, is the materialization of the zero constant, which shouldn't
matter for these cases.

Reviewers: dsanders, sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

llvm-svn: 266285

8 years ago[Coverage] Avoid unnecessary copying of std::vector
Igor Kudrin [Thu, 14 Apr 2016 09:10:00 +0000 (09:10 +0000)]
[Coverage] Avoid unnecessary copying of std::vector

Approved by: Justin Bogner <mail@justinbogner.com>

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

llvm-svn: 266284

8 years ago[tsan] Fix size reporting for OS X zone allocator with 0-sized allocations
Kuba Brecka [Thu, 14 Apr 2016 09:05:19 +0000 (09:05 +0000)]
[tsan] Fix size reporting for OS X zone allocator with 0-sized allocations

The custom zone implementation for OS X must not return 0 (even for 0-sized allocations). Returning 0 indicates that the pointer doesn't belong to the zone. This can break existing applications. The underlaying allocator allocates 1 byte for 0-sized allocations anyway, so returning 1 in this case is okay.

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

llvm-svn: 266283

8 years agoRevert "Support arbitrary addrspace pointers in masked load/store intrinsics"
Adam Nemet [Thu, 14 Apr 2016 08:47:17 +0000 (08:47 +0000)]
Revert "Support arbitrary addrspace pointers in masked load/store intrinsics"

This reverts commit r266086.

It breaks the LTO build of gcc in SPEC2000.

llvm-svn: 266282

8 years agoThinLTO: linkonce compile-time optimization, do not bother when there is only one...
Mehdi Amini [Thu, 14 Apr 2016 08:46:22 +0000 (08:46 +0000)]
ThinLTO: linkonce compile-time optimization, do not bother when there is only one input file

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266281

8 years ago[Clang][AVX512][BUILTIN] Adding support for intrinsics of vpmov{d|q}{b|w|d}{128|256...
Michael Zuckerman [Thu, 14 Apr 2016 07:56:51 +0000 (07:56 +0000)]
[Clang][AVX512][BUILTIN] Adding support for intrinsics of vpmov{d|q}{b|w|d}{128|256|512} instruction set

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

llvm-svn: 266280

8 years ago[CodeGen] Teach LLVM how to lower @llvm.{min,max}num to {MIN,MAX}NAN
David Majnemer [Thu, 14 Apr 2016 07:13:24 +0000 (07:13 +0000)]
[CodeGen] Teach LLVM how to lower @llvm.{min,max}num to {MIN,MAX}NAN

The behavior of {MIN,MAX}NAN differs from that of {MIN,MAX}NUM when only
one of the inputs is NaN: -NUM will return the non-NaN argument while
-NAN would return NaN.

It is desirable to lower to @llvm.{min,max}num to -NAN if they don't
have a native instruction for -NUM.  Notably, ARMv7 NEON's vmin has the
-NAN semantics.

N.B.  Of course, it is only safe to do this if the intrinsic call is
marked nnan.

llvm-svn: 266279

8 years ago[Clang][AVX512][Builtin] Adding intrinsics of vpmovus{d|q}{b|w|d}{128|256|512} instru...
Michael Zuckerman [Thu, 14 Apr 2016 06:48:09 +0000 (06:48 +0000)]
[Clang][AVX512][Builtin] Adding intrinsics of vpmovus{d|q}{b|w|d}{128|256|512} instruction set

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

llvm-svn: 266278

8 years agoMake sure the LLVMContext outlive the CompilerInstance
Mehdi Amini [Thu, 14 Apr 2016 05:37:41 +0000 (05:37 +0000)]
Make sure the LLVMContext outlive the CompilerInstance

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266277

8 years agoDo not use llvm:getGlobalContext() in unittests
Mehdi Amini [Thu, 14 Apr 2016 05:34:32 +0000 (05:34 +0000)]
Do not use llvm:getGlobalContext() in unittests

Currently trying to nuke this API from LLVM.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266276

8 years agoDo not use getGlobalContext()... ever.
Mehdi Amini [Thu, 14 Apr 2016 04:36:40 +0000 (04:36 +0000)]
Do not use getGlobalContext()... ever.

This code was creating a new type in the global context, regardless
of which context the user is sitting in, what can possibly go wrong?

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266275

8 years agoFix Android build after r266267
Oleksiy Vyalov [Thu, 14 Apr 2016 02:02:12 +0000 (02:02 +0000)]
Fix Android build after r266267

llvm-svn: 266274

8 years agoELF: Do not create copy relocations for references in writable sections.
Peter Collingbourne [Thu, 14 Apr 2016 01:48:11 +0000 (01:48 +0000)]
ELF: Do not create copy relocations for references in writable sections.

They are unnecessary, as the dynamic loader can apply the original relocations
directly. This was also resulting in the creation of copy relocations in PIEs.

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

llvm-svn: 266273

8 years agoAMDGPU: Implement canonicalize
Matt Arsenault [Thu, 14 Apr 2016 01:42:16 +0000 (01:42 +0000)]
AMDGPU: Implement canonicalize

Also add generic DAG node for it.

llvm-svn: 266272

8 years agoDon't use auto - (try to) appease the Android g++ bot
Enrico Granata [Thu, 14 Apr 2016 01:23:01 +0000 (01:23 +0000)]
Don't use auto - (try to) appease the Android g++ bot

llvm-svn: 266271

8 years agoTargetLowering: Factor out common code for tail call eligibility checking; NFC
Matthias Braun [Thu, 14 Apr 2016 01:10:42 +0000 (01:10 +0000)]
TargetLowering: Factor out common code for tail call eligibility checking; NFC

llvm-svn: 266270

8 years ago[modules] Store the location of the lexical update record in a decl update as
Richard Smith [Thu, 14 Apr 2016 00:50:18 +0000 (00:50 +0000)]
[modules] Store the location of the lexical update record in a decl update as
an offset from the current record rather than as an absolute bit number. This
gives a minor .pcm file size reduction.

llvm-svn: 266269

8 years agoReorder ASTNodeKind::AllKindInfo to match NodeKindId.
Alexander Kornienko [Thu, 14 Apr 2016 00:47:40 +0000 (00:47 +0000)]
Reorder ASTNodeKind::AllKindInfo to match NodeKindId.

Summary:
AllKindInfo is being indexed by NodeKindId, so the order must match.
Extended ASTTypeTraits tests to cover this.

Reviewers: sbenza

Subscribers: cfe-commits, klimek

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

llvm-svn: 266268

8 years agoAugment the 'language objc class-table dump' command to take a "-v" option, which...
Enrico Granata [Thu, 14 Apr 2016 00:43:20 +0000 (00:43 +0000)]
Augment the 'language objc class-table dump' command to take a "-v" option, which makes it print ivar and method information, as well as an optional regex argument which filters out all class names that don't match the regex

llvm-svn: 266267

8 years ago[modules] Remove CXX_BASE_SPECIFIERS_OFFSETS table. Instead of storing an ID of
Richard Smith [Thu, 14 Apr 2016 00:29:55 +0000 (00:29 +0000)]
[modules] Remove CXX_BASE_SPECIFIERS_OFFSETS table. Instead of storing an ID of
a table entry in the corresponding decl, store an offset from the current
record to the relevant CXX_BASE_SPECIFIERS record. This results in fewer
indirections and a minor .pcm file size reduction.

llvm-svn: 266266

8 years agoclang-tools-extra/test/clang-tidy/readability-deleted-default.cpp: Add -fno-ms-compat...
NAKAMURA Takumi [Wed, 13 Apr 2016 23:50:45 +0000 (23:50 +0000)]
clang-tools-extra/test/clang-tidy/readability-deleted-default.cpp: Add -fno-ms-compatibility.

llvm-svn: 266265

8 years agoObjC kindof: order the methods in global pool relative to availability.
Manman Ren [Wed, 13 Apr 2016 23:43:56 +0000 (23:43 +0000)]
ObjC kindof: order the methods in global pool relative to availability.

r265877 tries to put methods that are deprecated or unavailable to the
front of the global pool to emit diagnostics, but it breaks some of
our existing codes that depend on choosing a certain method for id
lookup.

This commit orders the methods with the same declaration with respect
to the availability, but do not order methods with different declaration.

rdar://25707511

llvm-svn: 266264

8 years ago[CodeGen] Avoid ctor/dtor boilerplate with some C++11
Reid Kleckner [Wed, 13 Apr 2016 23:37:17 +0000 (23:37 +0000)]
[CodeGen] Avoid ctor/dtor boilerplate with some C++11

Non-owning pointers that cache LLVM types and constants can use
'nullptr' default member initializers so that we don't need to mention
them in the constructor initializer list.

Owning pointers should use std::unique_ptr so that we don't need to
manually delete them in the destructor. They also don't need to be
mentioned in the constructor at that point.

NFC

llvm-svn: 266263

8 years ago[CFLAA] Fix up code style a bit. NFC.
George Burgess IV [Wed, 13 Apr 2016 23:27:37 +0000 (23:27 +0000)]
[CFLAA] Fix up code style a bit. NFC.

llvm-svn: 266262

8 years ago[ppc] add tests to show potential andc optimization
Sanjay Patel [Wed, 13 Apr 2016 23:23:30 +0000 (23:23 +0000)]
[ppc] add tests to show potential andc optimization

llvm-svn: 266261

8 years agoARM: override cost function to re-enable ConstantHoisting (& fix it).
Tim Northover [Wed, 13 Apr 2016 23:08:27 +0000 (23:08 +0000)]
ARM: override cost function to re-enable ConstantHoisting (& fix it).

At some point, ARM stopped getting any benefit from ConstantHoisting because
the pass called a different variant of getIntImmCost. Reimplementing the
correct variant revealed some problems, however:

  + ConstantHoisting was modifying switch statements. This is simply invalid,
    the cases must remain integer constants no matter the notional cost.
  + ConstantHoisting was mangling alloca instructions in the entry block. These
    should be handled by FrameLowering, so constants actually have a cost of 0.
    Worse, the resulting bitcasts meant they became dynamic allocas.

rdar://25707382

llvm-svn: 266260

8 years agoRevert "Add LLVMGetAttrKindIDInContext in the C API in order to facilitate migration...
Amaury Sechet [Wed, 13 Apr 2016 23:01:39 +0000 (23:01 +0000)]
Revert "Add LLVMGetAttrKindIDInContext in the C API in order to facilitate migration away from LLVMAttribute"

This reverts commit 0bcfd95c268bcb180a525e1837e84475df8acdc7.

llvm-svn: 266259

8 years agoValueMapper: Resolve cycles on the new nodes
Duncan P. N. Exon Smith [Wed, 13 Apr 2016 22:54:01 +0000 (22:54 +0000)]
ValueMapper: Resolve cycles on the new nodes

Fix a major bug from r265456.  Although it's now much rarer, ValueMapper
sometimes has to duplicate cycles.  The
might-transitively-reference-a-temporary counts don't decrement on their
own when there are cycles, and you need to call MDNode::resolveCycles to
fix it.

r265456 was checking the input nodes to see if they were unresolved.
This is useless; they should never be unresolved.  Instead we should
check the output nodes and resolve cycles on them.

llvm-svn: 266258

8 years agoAdd LLVMGetAttrKindIDInContext in the C API in order to facilitate migration away...
Amaury Sechet [Wed, 13 Apr 2016 22:51:40 +0000 (22:51 +0000)]
Add LLVMGetAttrKindIDInContext in the C API in order to facilitate migration away from LLVMAttribute

Summary: LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values.

Reviewers: Wallbraker, whitequark, joker.eph, echristo

Subscribers: llvm-commits

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

llvm-svn: 266257

8 years ago[IR] Optimize memory usage of Metadata on MSVC
Reid Kleckner [Wed, 13 Apr 2016 22:46:06 +0000 (22:46 +0000)]
[IR] Optimize memory usage of Metadata on MSVC

An unsigned 2 bit bitfield takes 4 bytes in MSVC. Instead of a bitfield,
just use an unsigned char. We can go back to a bitfield when someone
implements the TODO of exposing and reusing the remaining 6 bits.

llvm-svn: 266256

8 years ago[llvm-lto] Uniform error handling. NFC.
Davide Italiano [Wed, 13 Apr 2016 22:08:26 +0000 (22:08 +0000)]
[llvm-lto] Uniform error handling. NFC.

llvm-svn: 266255

8 years ago[modules] Remove CXX_CTOR_INITIALIZERS_OFFSETS table. Instead of storing an ID
Richard Smith [Wed, 13 Apr 2016 21:57:08 +0000 (21:57 +0000)]
[modules] Remove CXX_CTOR_INITIALIZERS_OFFSETS table. Instead of storing an ID
of a table entry in the corresponding decl, store an offset from the current
record to the relevant CXX_CTOR_INITIALIZERS record. This results in fewer
indirections and a minor .pcm file size reduction.

llvm-svn: 266254

8 years agoARM: Use a callee save register for the swiftself parameter.
Matthias Braun [Wed, 13 Apr 2016 21:43:25 +0000 (21:43 +0000)]
ARM: Use a callee save register for the swiftself parameter.

It is very likely that the swiftself parameter is alive throughout most
functions function so putting it into a callee save register should
avoid spills for the callers with only a minimum amount of extra spills
in the callees.

Currently the generated code is correct but unnecessarily spills and
reloads arguments passed in callee save registers, I will address this
in upcoming patches.

This also adds a missing check that for tail calls the preserved value
of the caller must be the same as the callees parameter.

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

llvm-svn: 266253

8 years agoX86: Use a callee save register for the swiftself parameter.
Matthias Braun [Wed, 13 Apr 2016 21:43:21 +0000 (21:43 +0000)]
X86: Use a callee save register for the swiftself parameter.

It is very likely that the swiftself parameter is alive throughout most
functions function so putting it into a callee save register should
avoid spills for the callers with only a minimum amount of extra spills
in the callees.

Currently the generated code is correct but unnecessarily spills and
reloads arguments passed in callee save registers, I will address this
in upcoming patches.

This also adds a missing check that for tail calls the preserved value
of the caller must be the same as the callees parameter.

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

llvm-svn: 266252

8 years agoAArch64: Use a callee save registers for swiftself parameters
Matthias Braun [Wed, 13 Apr 2016 21:43:16 +0000 (21:43 +0000)]
AArch64: Use a callee save registers for swiftself parameters

It is very likely that the swiftself parameter is alive throughout most
functions function so putting it into a callee save register should
avoid spills for the callers with only a minimum amount of extra spills
in the callees.

Currently the generated code is correct but unnecessarily spills and
reloads arguments passed in callee save registers, I will address this
in upcoming patches.

This also adds a missing check that for tail calls the preserved value
of the caller must be the same as the callees parameter.

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

llvm-svn: 266251

8 years ago[llvm-lto] clang-format before working on this file.
Davide Italiano [Wed, 13 Apr 2016 21:41:35 +0000 (21:41 +0000)]
[llvm-lto] clang-format before working on this file.

llvm-svn: 266250

8 years agoReturn immediately from analyzeCall if analyzeBlock returns false.
Easwaran Raman [Wed, 13 Apr 2016 21:20:22 +0000 (21:20 +0000)]
Return immediately from analyzeCall if analyzeBlock returns false.

This is part of the patch reviewed at http://reviews.llvm.org/D17584

llvm-svn: 266249

8 years agoStart to add real error messages for malformed Mach-O files.
Kevin Enderby [Wed, 13 Apr 2016 21:17:58 +0000 (21:17 +0000)]
Start to add real error messages for malformed Mach-O files.
And update the existing test cases in test/Object/macho-invalid.test
to use llvm-objdump with the -macho option to produce these
error messages and stop producing the generic "Invalid data
was encountered while parsing the file" message.

Working from the beginning of the file, if the mach header is too large for
the size of the file and then if the load commands that follow extend past
the end of the file these two errors now generate correct error messages.

Both of these have existing test cases in test/Object/macho-invalid.test .

But the first with macho-invalid-header it will never trigger the error message
"mach header extends past the end of the file" using any of the llvm tools as
they all use identify_magic() which rejects files with the correct magic number
that are too small in size.  So I tested this by hacking that code and seeing the
error message down in parseHeader() really does happen.  So in case there
is ever code in llvm that directly calls createMachOObjectFile() this error
message will be correctly produced.

The second error message of "load commands extends past the end of the file"
is triggered by a number of existing tests cases in test/Object/macho-invalid.test .
Also other tests trigger different error messages now like "ilocalsym plus
nlocalsym in LC_DYSYMTAB load command extends past the end of the
symbol table".

There are two existing test cases that still get the "Invalid data was encountered ..."
error messages that I will tackle next.  But they will involve a bit of pluming an
Expect<...> up through the call stack and I want to do those as separate changes.

FYI, for those test cases that were trying to test specific errors that now get
different errors I’ll fix those in follow on changes and create new test cases
for those so they test the error they were meant to test.

llvm-svn: 266248

8 years agoNFC mergefunc: const correctness
JF Bastien [Wed, 13 Apr 2016 21:12:21 +0000 (21:12 +0000)]
NFC mergefunc: const correctness

Some of the comparators were const others weren't making it annoying to add new comparators which call existing ones.

llvm-svn: 266247

8 years ago[asan] Prefer alloc-dealloc-mismatch to new-delete-type-mismatch.
Evgeniy Stepanov [Wed, 13 Apr 2016 21:04:27 +0000 (21:04 +0000)]
[asan] Prefer alloc-dealloc-mismatch to new-delete-type-mismatch.

With -fsized-deallocation, new[] vs delete mismatch is reported as
new-delete-type-mismatch. This is technically true, but
alloc-dealloc-mismatch describes it better.

llvm-svn: 266246

8 years ago[SemaObjC] Properly handle mix between type arguments and protocols.
Bruno Cardoso Lopes [Wed, 13 Apr 2016 20:59:07 +0000 (20:59 +0000)]
[SemaObjC] Properly handle mix between type arguments and protocols.

Under certain conditions clang currently fails to properly diagnostic ObjectC
parameter list when type args and protocols are mixed in the same list. This
happens when the first item in the parameter list is a (1) protocol, (2)
unknown type or (3) a list of protocols/unknown types up to the first type
argument. Fix the problem to report the proper error, example:

NSArray<M, NSValue *, NSURL, NSArray <id <M>>> *foo = @[@"a"];
NSNumber *bar = foo[0];
NSLog(@"%@", bar);

$ clang ...
x.m:7:13: error: angle brackets contain both a type ('NSValue') and a protocol ('M')
        NSArray<M, NSValue *, NSURL, NSArray <id <M>>> *foo = @[@"a"];
                ~  ^

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

rdar://problem/22204367

llvm-svn: 266245

8 years agoAMDGPU/SI: Add support for spilling VGPRs without having to scavenge registers
Tom Stellard [Wed, 13 Apr 2016 20:44:16 +0000 (20:44 +0000)]
AMDGPU/SI: Add support for spilling VGPRs without having to scavenge registers

Summary:
When we are spilling SGPRs to scratch memory, we usually don't have
free SGPRs to do the address calculation, so we need to re-use the
ScratchOffset register for the calculation.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 266244

8 years ago[x86] add tests to show potential BMI optimization
Sanjay Patel [Wed, 13 Apr 2016 20:40:43 +0000 (20:40 +0000)]
[x86] add tests to show potential BMI optimization

llvm-svn: 266243

8 years agoMake sure CheckDestructor gets called on dllimported classes if the vtable is used...
Hans Wennborg [Wed, 13 Apr 2016 20:21:15 +0000 (20:21 +0000)]
Make sure CheckDestructor gets called on dllimported classes if the vtable is used (PR27319)

llvm-svn: 266242

8 years ago[DebugInfo] Optimize memory layout of DISubprogram.
Davide Italiano [Wed, 13 Apr 2016 20:17:42 +0000 (20:17 +0000)]
[DebugInfo] Optimize memory layout of DISubprogram.

A DISubprogram on x86_64 was 48 bytes. During an LTO build we
end up allocating *a lot* of these (see Duncan's numbers on
llvm-dev and/or my numbers in the review link).
This change reduces the size to 40 bytes, with a nice effect
on peak memory usage when LTO'ing clang.
There are more classes in the hierarchy which can be compacted
so more patches will come. DISubprogram was the biggest offender
in my profiling, anyway.

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

llvm-svn: 266241

8 years ago[PGO] Fix the buildbots for r266229.
Betul Buyukkurt [Wed, 13 Apr 2016 20:02:07 +0000 (20:02 +0000)]
[PGO] Fix the buildbots for r266229.

llvm-svn: 266240

8 years agoLit C++11 Compatibility Patch #7
Charles Li [Wed, 13 Apr 2016 20:00:45 +0000 (20:00 +0000)]
Lit C++11 Compatibility Patch #7

13 tests have been updated for C++11 compatibility.
Differential Revision: http://reviews.llvm.org/D19068

llvm-svn: 266239

8 years agoAsmParser: record "# line file" context to calculate location for diag
Tim Northover [Wed, 13 Apr 2016 19:46:54 +0000 (19:46 +0000)]
AsmParser: record "# line file" context to calculate location for diag

Since we can't emit diagnostics for missing "jmp 1f" labels until the end of
the file, we need to be able to restore the context used to calculate
file/line. This is basically the "# line file" directive that's being used at
the time the expression is seen.

rdar://25706972

llvm-svn: 266238

8 years agoTest case for r265852.
Easwaran Raman [Wed, 13 Apr 2016 19:43:31 +0000 (19:43 +0000)]
Test case for r265852.

llvm-svn: 266237

8 years agoLibDriver: Silently do nothing when provided no inputs.
Peter Collingbourne [Wed, 13 Apr 2016 19:36:04 +0000 (19:36 +0000)]
LibDriver: Silently do nothing when provided no inputs.

This behavior is strange, but it matches lib.exe. Based on a patch by
Nico Weber.

Fixes PR27335.

llvm-svn: 266236

8 years ago[CrashReproducer] Add test to run the reproducer script + modules
Bruno Cardoso Lopes [Wed, 13 Apr 2016 19:28:24 +0000 (19:28 +0000)]
[CrashReproducer] Add test to run the reproducer script + modules

Now that we have basic support in place, make sure the reproducer script
works with modules for a simple testcase.

llvm-svn: 266235

8 years ago[CrashReproducer] Setup 'use-external-names' in YAML files.
Bruno Cardoso Lopes [Wed, 13 Apr 2016 19:28:21 +0000 (19:28 +0000)]
[CrashReproducer] Setup 'use-external-names' in YAML files.

Hide the real paths when rebuilding from VFS by setting up the crash
reproducer to use 'use-external-names' = false. This way we avoid
module redifinition errors and consistently use the same paths against
all modules.

With this change on Darwin we are able to simulate a crash for a simple
application using "Foundation/Foundation.h" (which relies on a bunch of
different frameworks and headers) and successfully rebuild all the
modules by relying solely at the VFS overlay.

llvm-svn: 266234

8 years ago[VFS] Move default values to in-class member initialization. NFC
Bruno Cardoso Lopes [Wed, 13 Apr 2016 19:28:16 +0000 (19:28 +0000)]
[VFS] Move default values to in-class member initialization. NFC

llvm-svn: 266233

8 years agoFix warning about unused variable.
Rafael Espindola [Wed, 13 Apr 2016 19:09:48 +0000 (19:09 +0000)]
Fix warning about unused variable.

llvm-svn: 266232

8 years agogit-clang-format. NFC.
Rafael Espindola [Wed, 13 Apr 2016 19:07:40 +0000 (19:07 +0000)]
git-clang-format. NFC.

llvm-svn: 266231

8 years agoDon't set MustBeInDynSym for hidden symbols.
Rafael Espindola [Wed, 13 Apr 2016 19:03:34 +0000 (19:03 +0000)]
Don't set MustBeInDynSym for hidden symbols.

llvm-svn: 266230

8 years ago[PGO] Remove redundant VP instrumentation
Betul Buyukkurt [Wed, 13 Apr 2016 18:52:19 +0000 (18:52 +0000)]
[PGO] Remove redundant VP instrumentation

LLVM optimization passes may reduce a profiled target expression
to a constant. Removing runtime calls at such instrumentation points
would help speedup the runtime of the instrumented program.

llvm-svn: 266229

8 years ago[PowerPC] Basic support for P9 byte comparison and count trailing zero insns
Nemanja Ivanovic [Wed, 13 Apr 2016 18:51:18 +0000 (18:51 +0000)]
[PowerPC] Basic support for P9 byte comparison and count trailing zero insns

This patch corresponds to review:
http://reviews.llvm.org/D17850

This patch implements the following instructions:
cmprb, cmpeqb, cnttzw, cnttzw., cnttzd, cnttzd.

llvm-svn: 266228

8 years agoELF: Implement --dynamic-list
Adhemerval Zanella [Wed, 13 Apr 2016 18:51:11 +0000 (18:51 +0000)]
ELF: Implement --dynamic-list

This patch implements the --dynamic-list option, which adds a list of
global symbol that either should not be bounded by default definition
when creating shared libraries, or add in dynamic symbol table in the
case of creating executables.

The patch modifies the ScriptParserBase class to use a list of Token
instead of StringRef, which contains information if the token is a
quoted or unquoted strings. It is used to use a faster search for
exact match symbol name.

The input file follow a similar format of linker script with some
simplifications (it does not have scope or node names). It leads
to a simplified parser define in DynamicList.{cpp,h}.

Different from ld/gold neither glob pattern nor mangled names
(extern 'C++') are currently supported.

llvm-svn: 266227

8 years agoRemove redundant null-check; NFC
Hubert Tong [Wed, 13 Apr 2016 18:41:03 +0000 (18:41 +0000)]
Remove redundant null-check; NFC

llvm-svn: 266226

8 years agollvm-dwp: Add assert text
David Blaikie [Wed, 13 Apr 2016 18:38:33 +0000 (18:38 +0000)]
llvm-dwp: Add assert text

Post-commit feedback from Eric Christopher on r265452.

llvm-svn: 266225

8 years agolibclang: Use early-return to reduce indentation.
David Blaikie [Wed, 13 Apr 2016 18:36:19 +0000 (18:36 +0000)]
libclang: Use early-return to reduce indentation.

& since I'll get blamed for all the lines anyway, remove some
else-after-return and otherwise tidy things up.

llvm-svn: 266224

8 years ago[AArch64] Disable LDP/STP for quads
Evandro Menezes [Wed, 13 Apr 2016 18:31:45 +0000 (18:31 +0000)]
[AArch64] Disable LDP/STP for quads

Disable LDP/STP for quads on Exynos M1 as they are not as efficient as pairs
of regular LDR/STR.

Patch by Abderrazek Zaafrani <a.zaafrani@samsung.com>.

llvm-svn: 266223

8 years agoSimplify memory management of CXEvalResultKind/ExprEvalResult using unique_ptr and...
David Blaikie [Wed, 13 Apr 2016 18:23:33 +0000 (18:23 +0000)]
Simplify memory management of CXEvalResultKind/ExprEvalResult using unique_ptr and a dtor

This doesn't seem to need to be a C type, C only handles a void*, so use
new/delete as usual to simplify allocation and cleanup.

Follow-up to r265994

llvm-svn: 266222

8 years agoRevert "[IR/Verifier] Each DISubprogram with isDefinition: true must belong to a...
Davide Italiano [Wed, 13 Apr 2016 18:08:07 +0000 (18:08 +0000)]
Revert "[IR/Verifier] Each DISubprogram with isDefinition: true must belong to a CU."

This reverts commit r266102. The O(N^2) verifier check causes timeouts
in LTO test suite.

llvm-svn: 266221

8 years ago[ELF] - Change -t implementation to print which archive members are used.
George Rimar [Wed, 13 Apr 2016 18:07:57 +0000 (18:07 +0000)]
[ELF] - Change -t implementation to print which archive members are used.

Previously each archive file was reported no matter were it's member used or not,
like:
lib/libLLVMSupport.a

Now lld prints line for each used internal file, like:
lib/libLLVMSupport.a(lib/Support/CMakeFiles/LLVMSupport.dir/StringSaver.cpp.o)
lib/libLLVMSupport.a(lib/Support/CMakeFiles/LLVMSupport.dir/Host.cpp.o)
lib/libLLVMSupport.a(lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.c.o)

That should be consistent with what gold do.

This fixes PR27243.

Differential revision: http://reviews.llvm.org/D19011

llvm-svn: 266220

8 years ago[analyzer] Nullability: Suppress diagnostic on bind with cast.
Devin Coughlin [Wed, 13 Apr 2016 17:59:24 +0000 (17:59 +0000)]
[analyzer] Nullability: Suppress diagnostic on bind with cast.

Update the nullability checker to allow an explicit cast to nonnull to
suppress a warning on an assignment of nil to a nonnull:

id _Nonnull x = (id _Nonnull)nil; // no-warning

This suppression as already possible for diagnostics on returns and
function/method arguments.

rdar://problem/25381178

llvm-svn: 266219

8 years ago[IR/DebugInfoMetadata] Simplify array length calculation by using array_lengthof...
David Blaikie [Wed, 13 Apr 2016 17:42:56 +0000 (17:42 +0000)]
[IR/DebugInfoMetadata] Simplify array length calculation by using array_lengthof instead of ArrayRef::size

llvm-svn: 266218

8 years agoCleanup Store Merging in UseAA case
Nirav Dave [Wed, 13 Apr 2016 17:27:26 +0000 (17:27 +0000)]
Cleanup Store Merging in UseAA case

This patch fixes a bug (PR26827) when using anti-aliasing in store
merging. This sets the chain users of the component stores to point to
the new store instead of the component stores chain parent.

Reviewers: jyknight

Subscribers: llvm-commits

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

llvm-svn: 266217

8 years agoSanity check `opt` options compatibility: can't have module-summary or module-hash...
Mehdi Amini [Wed, 13 Apr 2016 17:20:10 +0000 (17:20 +0000)]
Sanity check `opt` options compatibility: can't have module-summary or module-hash when emitting textual IR

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266216

8 years agoRevert "Make aliases explicit in the summary"
Mehdi Amini [Wed, 13 Apr 2016 17:20:07 +0000 (17:20 +0000)]
Revert "Make aliases explicit in the summary"

Inadvertently commited...

This reverts commit e618ec93786d99df2ddf280ad2d5e02f5516cecf.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266215

8 years agoMake aliases explicit in the summary
Mehdi Amini [Wed, 13 Apr 2016 17:18:42 +0000 (17:18 +0000)]
Make aliases explicit in the summary

Summary:
To be able to work accurately on the reference graph when taking decision
about internalizing, promoting, renaming, etc. We need to have the alias
information explicit.

Reviewers: tejohnson

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266214

8 years ago[OrderFiles] Don't allow lit to run dtrace multithreaded
Chris Bieneman [Wed, 13 Apr 2016 17:12:56 +0000 (17:12 +0000)]
[OrderFiles] Don't allow lit to run dtrace multithreaded

Dtrace is implemented to try and minimize performance impact on the process being traced. This results in dtrace dropping samples if it is taking too many CPU resources. Multi-threading dtrace increases the sample drop rate dramatically.

llvm-svn: 266213

8 years agoAArch64: allow 64-bit access to sysregs.
Tim Northover [Wed, 13 Apr 2016 17:08:55 +0000 (17:08 +0000)]
AArch64: allow 64-bit access to sysregs.

Although all the registers are actually 32-bits, I think we have to assume the
high 32-bits could be RES0 (the ARM ARM is unclear). If so, reading as a 32-bit
register can require extra zero extension operations.

llvm-svn: 266212

8 years agoARM: make Darwin's "-arch armv7em" default to hard-float.
Tim Northover [Wed, 13 Apr 2016 17:08:51 +0000 (17:08 +0000)]
ARM: make Darwin's "-arch armv7em" default to hard-float.

We've already paid the price for separate "armv7m" and "armv7em" slices
(support in other tools), it's silly to make them identical other than the
default CPU.

rdar://23055688

llvm-svn: 266211

8 years agoRevert inadvertently modified comment in r266131
Mehdi Amini [Wed, 13 Apr 2016 17:06:49 +0000 (17:06 +0000)]
Revert inadvertently modified comment in r266131

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266210

8 years agoQualify calls to addressof to avoid getting ADL. Fixes PR#27254.
Marshall Clow [Wed, 13 Apr 2016 17:02:23 +0000 (17:02 +0000)]
Qualify calls to addressof to avoid getting ADL. Fixes PR#27254.

llvm-svn: 266209

8 years agoELF: Use hidden visibility for all DefinedSynthetic symbols.
Peter Collingbourne [Wed, 13 Apr 2016 16:57:28 +0000 (16:57 +0000)]
ELF: Use hidden visibility for all DefinedSynthetic symbols.

This simplifies the code by allowing us to remove the visibility argument
to functions that create synthetic symbols.

The only functional change is that the visibility of the MIPS "_gp" symbol
is now hidden. Because this symbol is defined in every executable or DSO, it
would be difficult to observe a visibility change here.

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

llvm-svn: 266208

8 years agoTest dynamic relocations pointing to __stop_ symbols.
Rafael Espindola [Wed, 13 Apr 2016 16:33:02 +0000 (16:33 +0000)]
Test dynamic relocations pointing to __stop_ symbols.

llvm-svn: 266207

8 years agoAArch64: don't create instructions that write to xzr/wzr twice.
Tim Northover [Wed, 13 Apr 2016 16:25:39 +0000 (16:25 +0000)]
AArch64: don't create instructions that write to xzr/wzr twice.

These are unpredictable even on AArch64.

Patch by Yichao Yu.

llvm-svn: 266206

8 years ago[AMDGPU][llvm-mc] Support of Trap Handler registers (TTMP0..11 and TBA/TMA)git status
Artem Tamazov [Wed, 13 Apr 2016 16:18:41 +0000 (16:18 +0000)]
[AMDGPU][llvm-mc] Support of Trap Handler registers (TTMP0..11 and TBA/TMA)git status

Tests added along with implemented feature.
Note that there is a small leftover of unecessary MI sheduling issue
(more info in the review). CodeGen/AMDGPU/salu-to-valu.ll updated to fix
the false regression.

TODO: Support for TTMP quads, comma-separated syntax in "[]" and more.

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

llvm-svn: 266205

8 years ago[mips] Fix emitAtomicCmpSwapPartword to handle 64 bit pointers correctly
Zoran Jovanovic [Wed, 13 Apr 2016 16:02:25 +0000 (16:02 +0000)]
[mips] Fix emitAtomicCmpSwapPartword to handle 64 bit pointers correctly

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

llvm-svn: 266204

8 years ago[mips] Sign-extend i32 values truncated from previously zero-extended i32 values.
Vasileios Kalintiris [Wed, 13 Apr 2016 15:07:45 +0000 (15:07 +0000)]
[mips] Sign-extend i32 values truncated from previously zero-extended i32 values.

Summary:
This is a special case for MIPS64 because the architecture requires
properly 32-bit sign-extended values in the register containers.

Additionaly, we merge consecutive trunc + AssertZExt nodes in order
to avoid unnecessary sign-extensions when the extension comes from a
type smaller than i32.

Reviewers: dsanders

Subscribers: dsanders, sdardis, llvm-commits

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

llvm-svn: 266203

8 years ago[Clang][AVX512][Builtin] Adding support to intrinsics of pmovs{d|q}{b|w|d}{128|256...
Michael Zuckerman [Wed, 13 Apr 2016 15:02:04 +0000 (15:02 +0000)]
[Clang][AVX512][Builtin] Adding support to intrinsics of pmovs{d|q}{b|w|d}{128|256|512} instruction set

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

llvm-svn: 266202

8 years agoReverting r266199; it causes build bot failures.
Aaron Ballman [Wed, 13 Apr 2016 14:53:52 +0000 (14:53 +0000)]
Reverting r266199; it causes build bot failures.

http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/3255
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/3517

llvm-svn: 266201

8 years agoSimplify strlen to a subtraction for certain cases.
David L Kreitzer [Wed, 13 Apr 2016 14:31:06 +0000 (14:31 +0000)]
Simplify strlen to a subtraction for certain cases.

Patch by Li Huang (li1.huang@intel.com)

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

llvm-svn: 266200

8 years agoAdd functions declared in ctype.h to builtin function database. All functions are...
Aaron Ballman [Wed, 13 Apr 2016 13:55:58 +0000 (13:55 +0000)]
Add functions declared in ctype.h to builtin function database. All functions are annotated with nothrow and pure attribute, which enables better optimization.

Patch by Taewook Oh.

llvm-svn: 266199

8 years ago[OPENMP 4.0] Fixed DSA analysis for taskloop directives.
Alexey Bataev [Wed, 13 Apr 2016 13:36:48 +0000 (13:36 +0000)]
[OPENMP 4.0] Fixed DSA analysis for taskloop directives.

Patch make clang to perform analysis for task-based directives also for
taskloop-based directives.

llvm-svn: 266198

8 years agoMatch types in for loop to fix signedness comparison warning
Ed Maste [Wed, 13 Apr 2016 13:32:06 +0000 (13:32 +0000)]
Match types in for loop to fix signedness comparison warning

llvm-svn: 266197

8 years agoRemove obsolete comments
Pavel Labath [Wed, 13 Apr 2016 13:26:45 +0000 (13:26 +0000)]
Remove obsolete comments

llvm-svn: 266196

8 years ago[Clang][AVX512][Builtin] Adding support for VBROADCAST and VPBROADCASTB/W/D/Q instruc...
Michael Zuckerman [Wed, 13 Apr 2016 12:58:01 +0000 (12:58 +0000)]
[Clang][AVX512][Builtin] Adding support for VBROADCAST and VPBROADCASTB/W/D/Q instruction set

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

llvm-svn: 266195