platform/upstream/llvm.git
8 years agoWebAssembly: update expected GCC torture test failures
JF Bastien [Tue, 2 Feb 2016 14:27:34 +0000 (14:27 +0000)]
WebAssembly: update expected GCC torture test failures

The 3 programs used __attribute__((mode(?))) on enum, which clang r259497 fixed.

llvm-svn: 259508

8 years agoMake the remaining headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 14:24:21 +0000 (14:24 +0000)]
Make the remaining headers self-contained.

llvm-svn: 259507

8 years ago[StaticAnalyzer] Pull SymExpr and SymbolData into its own header to avoid cyclic...
Benjamin Kramer [Tue, 2 Feb 2016 14:24:11 +0000 (14:24 +0000)]
[StaticAnalyzer] Pull SymExpr and SymbolData into its own header to avoid cyclic includes.

llvm-svn: 259506

8 years agoRemove unneeded definition [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:16:22 +0000 (14:16 +0000)]
Remove unneeded definition [NFC]

llvm-svn: 259505

8 years agoAdd const keyword to MemoryAccess argument [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:16:01 +0000 (14:16 +0000)]
Add const keyword to MemoryAccess argument [NFC]

llvm-svn: 259504

8 years agoSort analysis members and unifiy documentation [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:15:37 +0000 (14:15 +0000)]
Sort analysis members and unifiy documentation [NFC]

llvm-svn: 259503

8 years agoRename the DataLayout member [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:15:13 +0000 (14:15 +0000)]
Rename the DataLayout member [NFC]

llvm-svn: 259502

8 years agoRemove helper function [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:14:40 +0000 (14:14 +0000)]
Remove helper function [NFC]

llvm-svn: 259501

8 years agoRemove unnecessary getAnalysis call [NFC]
Johannes Doerfert [Tue, 2 Feb 2016 14:14:20 +0000 (14:14 +0000)]
Remove unnecessary getAnalysis call [NFC]

llvm-svn: 259500

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Tue, 2 Feb 2016 13:52:52 +0000 (13:52 +0000)]
Add backend dignostic printer for unsupported features

Re-commit of r258950 after fixing layering violation.

The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

llvm-svn: 259499

8 years agoRefactor backend diagnostics for unsupported features
Oliver Stannard [Tue, 2 Feb 2016 13:52:43 +0000 (13:52 +0000)]
Refactor backend diagnostics for unsupported features

Re-commit of r258951 after fixing layering violation.

The BPF and WebAssembly backends had identical code for emitting errors
for unsupported features, and AMDGPU had very similar code. This merges
them all into one DiagnosticInfo subclass, that can be used by any
backend.

There should be minimal functional changes here, but some AMDGPU tests
have been updated for the new format of errors (it used a slightly
different format to BPF and WebAssembly). The AMDGPU error messages will
now benefit from having precise source locations when debug info is
available.

llvm-svn: 259498

8 years agoFix for PR8901: attribute "mode" rejected for enums and dependent types.
Denis Zobnin [Tue, 2 Feb 2016 13:50:39 +0000 (13:50 +0000)]
Fix for PR8901: attribute "mode" rejected for enums and dependent types.

Allow "mode" attribute for enum types, except for vector modes, for compatibility with GCC.
Support "mode" attribute with dependent types.

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

llvm-svn: 259497

8 years ago[X86][AVX512] Add support for AVX512 VMOVQ (load) shuffle decoding
Simon Pilgrim [Tue, 2 Feb 2016 13:32:56 +0000 (13:32 +0000)]
[X86][AVX512] Add support for AVX512 VMOVQ (load) shuffle decoding

llvm-svn: 259496

8 years agoScopInfo: Rename AccessType -> ElementType to unify naming with method declaration
Tobias Grosser [Tue, 2 Feb 2016 13:22:54 +0000 (13:22 +0000)]
ScopInfo: Rename AccessType -> ElementType to unify naming with method declaration

llvm-svn: 259495

8 years agoFix build after clang interface change in r259489
Pavel Labath [Tue, 2 Feb 2016 13:07:27 +0000 (13:07 +0000)]
Fix build after clang interface change in r259489

llvm-svn: 259494

8 years ago[compiler-rt] add_custom_libcxx should pass LLVM_PATH and a C++ compiler
Daniel Sanders [Tue, 2 Feb 2016 12:55:28 +0000 (12:55 +0000)]
[compiler-rt] add_custom_libcxx should pass LLVM_PATH and a C++ compiler

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 259493

8 years agoTest commit (NFC).
Denis Zobnin [Tue, 2 Feb 2016 12:39:08 +0000 (12:39 +0000)]
Test commit (NFC).

llvm-svn: 259492

8 years ago[OpenCL] Eliminate warning when declaring OpenCL builtin functions.
Anastasia Stulova [Tue, 2 Feb 2016 11:29:43 +0000 (11:29 +0000)]
[OpenCL] Eliminate warning when declaring OpenCL builtin functions.

OpenCL builtin functions are usually declared in header files.
Currently clang emits warning for OpenCL builtin functions
which have the same name as standard C library functions.

This commit eliminates such warnings by not adding the C standard
includes following the restriction from OpenCL v1.2 s6.9.f.

Patch by Liu Yaxun (Sam)!

Review: http://reviews.llvm.org/D16692
llvm-svn: 259491

8 years agoMake headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 11:06:57 +0000 (11:06 +0000)]
Make headers self-contained.

llvm-svn: 259490

8 years agoMove DebugInfoKind into its own header to cut the cyclic dependency edge from Driver...
Benjamin Kramer [Tue, 2 Feb 2016 11:06:51 +0000 (11:06 +0000)]
Move DebugInfoKind into its own header to cut the cyclic dependency edge from Driver to Frontend.

llvm-svn: 259489

8 years agoFix single-stepping onto a breakpoint
Pavel Labath [Tue, 2 Feb 2016 10:40:56 +0000 (10:40 +0000)]
Fix single-stepping onto a breakpoint

Summary:
r259344 introduced a bug, where we fail to perform a single step, when the instruction we are
stepping onto contains a breakpoint which is not valid for this thread. This fixes the problem
and add a test case.

Reviewers: tberghammer, emaste

Subscribers: abhishek.aggarwal, lldb-commits, emaste

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

llvm-svn: 259488

8 years agoclang-format: Make AlignAfterOpenBracket also affect angle brackets.
Daniel Jasper [Tue, 2 Feb 2016 10:28:11 +0000 (10:28 +0000)]
clang-format: Make AlignAfterOpenBracket also affect angle brackets.

Patch by Matthew Whitehead, thank you.

llvm-svn: 259487

8 years agowww: Mark full/partial tile separation for vectorization as 'done'
Tobias Grosser [Tue, 2 Feb 2016 09:55:59 +0000 (09:55 +0000)]
www: Mark full/partial tile separation for vectorization as 'done'

Roman contributed this

llvm-svn: 259486

8 years agowww: Update statistic code
Tobias Grosser [Tue, 2 Feb 2016 09:55:55 +0000 (09:55 +0000)]
www: Update statistic code

llvm-svn: 259485

8 years agoFix compiler lookup when specified without path
Pavel Labath [Tue, 2 Feb 2016 09:49:37 +0000 (09:49 +0000)]
Fix compiler lookup when specified without path

r259433 introduced a regression, where if a compiler is specified without a path (e.g., CC=clang,
relying on the fact that clang is in $PATH), then the test suite would fail (at the compiler
version detection step) because realpath would interpret this as a path relative to cwd). The fix
is to perform the $PATH expansion (via `which`) before the realpath step.

llvm-svn: 259484

8 years agowww: update formatting of polyhedral.info news
Tobias Grosser [Tue, 2 Feb 2016 09:30:01 +0000 (09:30 +0000)]
www: update formatting of polyhedral.info news

llvm-svn: 259483

8 years agoWebAssembly: add option to disable register coloring
JF Bastien [Tue, 2 Feb 2016 09:30:01 +0000 (09:30 +0000)]
WebAssembly: add option to disable register coloring

Having this hidden option makes it easier to debug other issues.

llvm-svn: 259482

8 years ago[ELF] Implemented -Bsymbolic-functions command line option
George Rimar [Tue, 2 Feb 2016 09:28:53 +0000 (09:28 +0000)]
[ELF] Implemented -Bsymbolic-functions command line option

-Bsymbolic-functions:
When creating a shared library, bind references to global
function symbols to the definition within the shared library, if any.

This patch also fixed behavior of already existent -Bsymbolic:
previously PLT entries were created even if -Bsymbolic was specified.

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

llvm-svn: 259481

8 years agoRemoved FeatureVFPOnlySP from the Cortex-R7 processor model
Sjoerd Meijer [Tue, 2 Feb 2016 09:28:20 +0000 (09:28 +0000)]
Removed FeatureVFPOnlySP from the Cortex-R7 processor model
description and changed the regression test accordingly.
The default configuration of a Cortex-R7 is to implement the
VFPv3-D16 architecture and the feature line as it was is too
restrictive.

llvm-svn: 259480

8 years ago[ELF] Remove redundant empty line. NFC
Simon Atanasyan [Tue, 2 Feb 2016 09:08:04 +0000 (09:08 +0000)]
[ELF] Remove redundant empty line. NFC

llvm-svn: 259479

8 years ago[ELF] Finalize .dynamic section at the end
Simon Atanasyan [Tue, 2 Feb 2016 09:07:47 +0000 (09:07 +0000)]
[ELF] Finalize .dynamic section at the end

Some dynamic table tags like RELSZ and PLTRELSZ depens on result of
finalizing corresponding relocation sections. Therefore we have to
finalize .dynamic section at the end.

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

llvm-svn: 259478

8 years agowww: Fix overlapping lines II
Tobias Grosser [Tue, 2 Feb 2016 08:49:34 +0000 (08:49 +0000)]
www: Fix overlapping lines II

llvm-svn: 259477

8 years agoAvoid overlapping lines
Tobias Grosser [Tue, 2 Feb 2016 08:47:56 +0000 (08:47 +0000)]
Avoid overlapping lines

llvm-svn: 259476

8 years agoELF: Include archive names in error messages.
Rui Ueyama [Tue, 2 Feb 2016 08:22:41 +0000 (08:22 +0000)]
ELF: Include archive names in error messages.

If object files are drawn from archive files, the error message should
be something like "conflict symbols in foo.a(bar.o) and baz.o" instead
of "conflict symbols in bar.o and baz.o". This patch implements that.

llvm-svn: 259475

8 years agoELF: Simplify and add comments.
Rui Ueyama [Tue, 2 Feb 2016 07:50:18 +0000 (07:50 +0000)]
ELF: Simplify and add comments.

llvm-svn: 259474

8 years ago[asan] Fix internal CHECK failure on double free in recovery mode.
Maxim Ostapenko [Tue, 2 Feb 2016 07:32:24 +0000 (07:32 +0000)]
[asan] Fix internal CHECK failure on double free in recovery mode.

This patches fixes https://github.com/google/sanitizers/issues/639

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

llvm-svn: 259473

8 years agoDo not use "No" prefix for boolean variables to make it simpler. NFC.
Rui Ueyama [Tue, 2 Feb 2016 07:18:15 +0000 (07:18 +0000)]
Do not use "No" prefix for boolean variables to make it simpler. NFC.

llvm-svn: 259472

8 years agoELF: Move GOT relocation handler code to one place. NFC.
Rui Ueyama [Tue, 2 Feb 2016 07:07:35 +0000 (07:07 +0000)]
ELF: Move GOT relocation handler code to one place. NFC.

llvm-svn: 259471

8 years agoELF: Move PLT relocation handler to one place. NFC.
Rui Ueyama [Tue, 2 Feb 2016 07:07:34 +0000 (07:07 +0000)]
ELF: Move PLT relocation handler to one place. NFC.

llvm-svn: 259470

8 years ago[RegisterCoalescer] Better DebugLoc for reMaterializeTrivialDef
David Majnemer [Tue, 2 Feb 2016 06:41:55 +0000 (06:41 +0000)]
[RegisterCoalescer] Better DebugLoc for reMaterializeTrivialDef

When rematerializing a computation by replacing the copy, use the copy's
location.  The location of the copy is more representative of the
original program.

This partially fixes PR10003.

llvm-svn: 259469

8 years agoELF: Move GNU_IFUNC relocation handler to one place. NFC.
Rui Ueyama [Tue, 2 Feb 2016 06:29:10 +0000 (06:29 +0000)]
ELF: Move GNU_IFUNC relocation handler to one place. NFC.

llvm-svn: 259468

8 years agoELF: Move copy relocation handler to one place. NFC.
Rui Ueyama [Tue, 2 Feb 2016 06:08:08 +0000 (06:08 +0000)]
ELF: Move copy relocation handler to one place. NFC.

llvm-svn: 259467

8 years agoELF: Move code for MIPS local GOT entries to one place. NFC.
Rui Ueyama [Tue, 2 Feb 2016 05:55:28 +0000 (05:55 +0000)]
ELF: Move code for MIPS local GOT entries to one place. NFC.

llvm-svn: 259466

8 years ago[OPENMP 4.0] Allow to use 'omp simd' directive inside other simd-regions.
Alexey Bataev [Tue, 2 Feb 2016 04:59:52 +0000 (04:59 +0000)]
[OPENMP 4.0] Allow to use 'omp simd' directive inside other simd-regions.

llvm-svn: 259465

8 years ago[OpenMP] Prevent nesting of target constructs within target code execution regions.
Arpith Chacko Jacob [Tue, 2 Feb 2016 04:00:47 +0000 (04:00 +0000)]
[OpenMP] Prevent nesting of target constructs within target code execution regions.

Summary:
This patch enhances Sema to check for the following restriction:

OpenMP 4.5 [2.17 Nesting of Regions]
If a target, target update, target data, target enter data, or
target exit data construct is encountered during execution of a
target region, the behavior is unspecified.

Reviewers: ABataev

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

llvm-svn: 259464

8 years ago[LCG] Build an edge abstraction for the LazyCallGraph and use it to
Chandler Carruth [Tue, 2 Feb 2016 03:57:13 +0000 (03:57 +0000)]
[LCG] Build an edge abstraction for the LazyCallGraph and use it to
differentiate between indirect references to functions an direct calls.

This doesn't do a whole lot yet other than change the print out produced
by the analysis, but it lays the groundwork for a very major change I'm
working on next: teaching the call graph to actually be a call graph,
modeling *both* the indirect reference graph and the call graph
simultaneously. More details on that in the next patch though.

The rest of this is essentially a bunch of over-engineering that won't
be interesting until the next patch. But this also isolates essentially
all of the churn necessary to introduce the edge abstraction from the
very important behavior change necessary in order to separately model
the two graphs. So it should make review of the subsequent patch a bit
easier at the cost of making this patch seem poorly motivated. ;]

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

llvm-svn: 259463

8 years agoNetBSD: Define initial RegisterContextNetBSD_x86_64
Kamil Rytarowski [Tue, 2 Feb 2016 03:47:44 +0000 (03:47 +0000)]
NetBSD: Define initial RegisterContextNetBSD_x86_64

Summary: Add basic support, i386 version will be added later.

Reviewers: emaste, joerg, clayborg, tfiala

Subscribers: lldb-commits

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

llvm-svn: 259462

8 years ago[LVI] Introduce an intersect operation on lattice values
Philip Reames [Tue, 2 Feb 2016 03:15:40 +0000 (03:15 +0000)]
[LVI] Introduce an intersect operation on lattice values

LVI has several separate sources of facts - edge local conditions, recursive queries, assumes, and control independent value facts - which all apply to the same value at the same location. The existing implementation was very conservative about exploiting all of these facts at once.

This change introduces an "intersect" function specifically to abstract the action of picking a good set of facts from all of the separate facts given. At the moment, this function is relatively simple (i.e. mostly just reuses the bits which were already there), but even the minor additions reveal the inherent power. For example, JumpThreading is now capable of doing an inductive proof that a particular value is always positive and removing a half range check.

I'm currently only using the new intersect function in one place. If folks are happy with the direction of the work, I plan on making a series of small changes without review to replace mergeIn with intersect at all the appropriate places.

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

llvm-svn: 259461

8 years agoAdd comments.
Rui Ueyama [Tue, 2 Feb 2016 03:11:27 +0000 (03:11 +0000)]
Add comments.

llvm-svn: 259460

8 years ago[libFuzzer] allow passing 1 or more files as individual inputs
Kostya Serebryany [Tue, 2 Feb 2016 03:03:47 +0000 (03:03 +0000)]
[libFuzzer] allow passing 1 or more files as individual inputs

llvm-svn: 259459

8 years agoUpdate a comment.
Rui Ueyama [Tue, 2 Feb 2016 02:53:58 +0000 (02:53 +0000)]
Update a comment.

llvm-svn: 259458

8 years agoMachineVerifier: Use report_context() instead of ad-hoc messages.
Matthias Braun [Tue, 2 Feb 2016 02:44:25 +0000 (02:44 +0000)]
MachineVerifier: Use report_context() instead of ad-hoc messages.

llvm-svn: 259457

8 years ago[X86] Fix a bug in getMemOpBaseRegImmOfs
Sanjoy Das [Tue, 2 Feb 2016 02:32:43 +0000 (02:32 +0000)]
[X86] Fix a bug in getMemOpBaseRegImmOfs

Fix a crash in `getMemOpBaseRegImmOfs` that happens if the base of
`MemOp` is a frame index memory operand.  The fix is to have
`getMemOpBaseRegImmOfs` bail out in such cases.  We can possibly be more
clever here, if needed.

llvm-svn: 259456

8 years agoReplace auto with the real type.
Rui Ueyama [Tue, 2 Feb 2016 02:29:03 +0000 (02:29 +0000)]
Replace auto with the real type.

llvm-svn: 259455

8 years ago[libFuzzer] fail if the corpus dir does not exist
Kostya Serebryany [Tue, 2 Feb 2016 02:07:26 +0000 (02:07 +0000)]
[libFuzzer] fail if the corpus dir does not exist

llvm-svn: 259454

8 years ago[asan] Add iOS support for Address Sanitizer
Anna Zaks [Tue, 2 Feb 2016 02:04:48 +0000 (02:04 +0000)]
[asan] Add iOS support for Address Sanitizer

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

llvm-svn: 259453

8 years ago[asan] Fixup r258849 by updating warning in the test
Anna Zaks [Tue, 2 Feb 2016 02:01:21 +0000 (02:01 +0000)]
[asan] Fixup r258849 by updating warning in the test

The error message has been changed in code as of r258849 (http://reviews.llvm.org/D16546). Update the test as well.

llvm-svn: 259452

8 years ago[asan] Add iOS support.
Anna Zaks [Tue, 2 Feb 2016 02:01:17 +0000 (02:01 +0000)]
[asan] Add iOS support.

llvm-svn: 259451

8 years agoSet ordinals of all File's created in MachO passes.
Pete Cooper [Tue, 2 Feb 2016 01:52:40 +0000 (01:52 +0000)]
Set ordinals of all File's created in MachO passes.

When we do debug printing of atoms, they expect their parent file
to have an ordinal.  Right now we trigger a bunch of asserts.

This doesn't actually manifest in differences in any real tests, but
even if the only thing it does is improve debuggability then its still
useful.

llvm-svn: 259450

8 years ago[X86][FastISel] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.
Ahmed Bougacha [Tue, 2 Feb 2016 01:44:03 +0000 (01:44 +0000)]
[X86][FastISel] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.

FastISel counterpart to r259448.

llvm-svn: 259449

8 years ago[X86] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.
Ahmed Bougacha [Tue, 2 Feb 2016 01:32:50 +0000 (01:32 +0000)]
[X86] Don't force Nearest-Even rounding for VCVTPS2PH, use MXCSR.

Officially, we don't acknowledge non-default configurations of MXCSR,
as getting there would require usage of the FENV_ACCESS pragma (at
least insofar as rounding mode is concerned).

We don't support the pragma, so we can assume that the default
rounding mode - round to nearest, ties to even - is always used.

However, it's inconsistent with the rest of the instruction set,
where MXCSR is always effective (unless otherwise specified).
Also, it's an unnecessary obstacle to the few brave souls that use
fenv.h with LLVM.

Avoid the hard-coded rounding mode for fp_to_f16; use MXCSR instead.

llvm-svn: 259448

8 years ago[safestack] Make sure the unsafe stack pointer is popped in all cases
Anna Zaks [Tue, 2 Feb 2016 01:03:11 +0000 (01:03 +0000)]
[safestack] Make sure the unsafe stack pointer is popped in all cases

The unsafe stack pointer is only popped in moveStaticAllocasToUnsafeStack so it won't happen if there are no static allocas.

Fixes https://llvm.org/bugs/show_bug.cgi?id=26122

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

llvm-svn: 259447

8 years ago[LVI] Fix a latent bug in getValueAt
Philip Reames [Tue, 2 Feb 2016 00:45:30 +0000 (00:45 +0000)]
[LVI] Fix a latent bug in getValueAt

This routine was returning Undefined for most queries.  This was utterly wrong.  Amusingly, we do not appear to have any callers of this which are actually trying to exploit unreachable code or this would have broken the world.

A better approach would be to explicit describe the intersection of facts.  That's blocked behind http://reviews.llvm.org/D14476 and I wanted to fix the current bug.

llvm-svn: 259446

8 years agoTemplate Type Diffing change
Richard Trieu [Tue, 2 Feb 2016 00:36:59 +0000 (00:36 +0000)]
Template Type Diffing change

When all the arguments of a template are elided, print "A<...>" instead of
"A<[2 * ...]>".  Also remove comment fragment that means nothing.

llvm-svn: 259445

8 years agoAlways initialize Out<ELFT> members.
Rui Ueyama [Tue, 2 Feb 2016 00:35:49 +0000 (00:35 +0000)]
Always initialize Out<ELFT> members.

Instead of leave unused fields as is, set them to nullptr.
Currnetly this is NFC, but if you call writeResults more than
once, you should be able to see the difference.

llvm-svn: 259444

8 years agoWe try to avoid static objects. These are on the error path for unsupported features
Jim Ingham [Tue, 2 Feb 2016 00:21:39 +0000 (00:21 +0000)]
We try to avoid static objects.  These are on the error path for unsupported features
in the socket, so just returning freshly constructed objects is fine.

llvm-svn: 259443

8 years agoFixed comment characters. NFC
Pete Cooper [Tue, 2 Feb 2016 00:05:47 +0000 (00:05 +0000)]
Fixed comment characters.  NFC

llvm-svn: 259442

8 years agoAdd pointerKind() method to the MachO ArchHandler's. NFC.
Pete Cooper [Tue, 2 Feb 2016 00:02:50 +0000 (00:02 +0000)]
Add pointerKind() method to the MachO ArchHandler's.  NFC.

The ObjCPass is going to need to create pointer sized relocations in
the ObjC sections.  This method will be used to give us a target independent
way of getting the correct kind for the refererence.

llvm-svn: 259441

8 years agoAdd ObjC method list atom type. NFC.
Pete Cooper [Mon, 1 Feb 2016 23:56:27 +0000 (23:56 +0000)]
Add ObjC method list atom type.  NFC.

An upcoming patch will use this to create lists of ObjC methods.

Adding it now to reduce the amount of code in that patch.

Test cases will follow in the other patch too.

llvm-svn: 259440

8 years agoAdd command line option to disable ObjC category merging.
Pete Cooper [Mon, 1 Feb 2016 23:56:23 +0000 (23:56 +0000)]
Add command line option to disable ObjC category merging.

This adds the no_objc_category_merging cmdline option which will
be used in an upcoming commit to disable the category optimizer.

It is on by default in ld64 so we match that here.

Test case will come soon with the patch to make use of this option.

llvm-svn: 259439

8 years agofix typos; NFC
Sanjay Patel [Mon, 1 Feb 2016 23:53:35 +0000 (23:53 +0000)]
fix typos; NFC

llvm-svn: 259438

8 years ago[LVI] Missing test case from 259432
Philip Reames [Mon, 1 Feb 2016 23:44:38 +0000 (23:44 +0000)]
[LVI] Missing test case from 259432

llvm-svn: 259437

8 years agoMove SimpleDefinedAtom::addReference to DefinedAtom.
Pete Cooper [Mon, 1 Feb 2016 23:42:10 +0000 (23:42 +0000)]
Move SimpleDefinedAtom::addReference to DefinedAtom.

Most of the other methods to access Reference's were on DefinedAtom so
this just keeps them all together.

This will be used in a future patch in ObjCPass which needs to add
new references.  The method is virtual because we may add references to
different data structures depending on whether we parsed a macho file or
yaml.

llvm-svn: 259436

8 years agoELF: Do not call fatal() if relocation contraints are not satisfied.
Rui Ueyama [Mon, 1 Feb 2016 23:28:21 +0000 (23:28 +0000)]
ELF: Do not call fatal() if relocation contraints are not satisfied.

http://reviews.llvm.org/D16648

llvm-svn: 259435

8 years agoAdd test for PR26419 (stable function summary ordering)
Teresa Johnson [Mon, 1 Feb 2016 23:26:30 +0000 (23:26 +0000)]
Add test for PR26419 (stable function summary ordering)

Enhance an existing test to also check that the ordering of the function
summary entries is stable.

llvm-svn: 259434

8 years agoFix getCompiler in unit testing framework on compiler symlinks
Stephane Sezer [Mon, 1 Feb 2016 23:21:27 +0000 (23:21 +0000)]
Fix getCompiler in unit testing framework on compiler symlinks

Summary:
Checks using the result of getCompiler() will fail to identify the compiler
correctly if CC is a symlink path (ie /usr/bin/cc).

Reviewers: zturner, emaste

Subscribers: llvm-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 259433

8 years ago[LVI] Remove overly tight assert from 259429
Philip Reames [Mon, 1 Feb 2016 23:21:11 +0000 (23:21 +0000)]
[LVI] Remove overly tight assert from 259429

I'll submit a test case shortly which covers this, but it's causing clang self host problems in the builders so I wanted to get it removed.

llvm-svn: 259432

8 years agoAdd operator== for DefinedAtom::reference_iterator. NFC.
Pete Cooper [Mon, 1 Feb 2016 23:05:20 +0000 (23:05 +0000)]
Add operator== for DefinedAtom::reference_iterator.  NFC.

This will be used by a future commit which wanted to compare iterators
for equality.

Also changed operator!= to be in terms of the new operator==

llvm-svn: 259431

8 years ago[X86][AVX512] Add support for AVX512 VMOVD (load) shuffle decoding
Simon Pilgrim [Mon, 1 Feb 2016 23:04:05 +0000 (23:04 +0000)]
[X86][AVX512] Add support for AVX512 VMOVD (load) shuffle decoding

llvm-svn: 259430

8 years ago[LVI] Add select handling
Philip Reames [Mon, 1 Feb 2016 22:57:53 +0000 (22:57 +0000)]
[LVI] Add select handling

Teach LVI to handle select instructions in the exact same way it handles PHI nodes.  This is useful since various parts of the optimizer convert PHI nodes into selects and we don't want these transformations to cause inferior optimization.

Note that this patch does nothing to exploit the implied constraint on the inputs represented by the select condition itself.  That will be a later patch and is blocked on http://reviews.llvm.org/D14476

llvm-svn: 259429

8 years agoAlways build a new TypeSourceInfo for function templates with parameters
Nico Weber [Mon, 1 Feb 2016 22:31:51 +0000 (22:31 +0000)]
Always build a new TypeSourceInfo for function templates with parameters

RecursiveASTVisitor::TraverseFunctionHelper() traverses a function's
ParmVarDecls by going to the function's getTypeSourceInfo if it exists, and
`DEF_TRAVERSE_TYPELOC(FunctionProtoType` then goes to the function's
ParmVarDecls.

For a function template that doesn't have parameters that explicitly depend on
the template parameter, we used to be clever and not build a new
TypeSourceInfo. That meant that when an instantiation of such a template is
visited, its TypeSourceInfo would point to the ParmVarDecls of the template,
not of the instantiation, which then confused clients of RecursiveASTVisitor.

So don't be clever for function templates that have parameters, even if none of
the parameters depend on the type.

Fixes PR26257.
http://reviews.llvm.org/D16478

llvm-svn: 259428

8 years ago[X86][AVX512] Add support for AVX512 VMOVSD/VMOVSS shuffle decoding
Simon Pilgrim [Mon, 1 Feb 2016 22:26:28 +0000 (22:26 +0000)]
[X86][AVX512] Add support for AVX512 VMOVSD/VMOVSS shuffle decoding

llvm-svn: 259427

8 years agoMachoFile should default to using subsections_via_symbols.
Pete Cooper [Mon, 1 Feb 2016 22:24:44 +0000 (22:24 +0000)]
MachoFile should default to using subsections_via_symbols.

When we parse a MachoFile, we set a number of members from the parsed
file, for example, subsectionsViaSymbols.

However, a number of passes, such as ObjCPass, create local copies of
MachoFile and don't get the benefit of setting flags and other fields in
the parser.  Instead we can just give a more sensible default as the parser
will definitely get the correct value from the file anyway.

llvm-svn: 259426

8 years agofunction names start with a lowercase letter; NFC
Sanjay Patel [Mon, 1 Feb 2016 22:23:39 +0000 (22:23 +0000)]
function names start with a lowercase letter; NFC

llvm-svn: 259425

8 years agoFix build problem by lower SmallSet<N> to a reasonable value
Matthias Braun [Mon, 1 Feb 2016 22:18:58 +0000 (22:18 +0000)]
Fix build problem by lower SmallSet<N> to a reasonable value

llvm-svn: 259424

8 years ago[InstCombine] simplify masked scatter/gather intrinsics with zero masks
Sanjay Patel [Mon, 1 Feb 2016 22:10:26 +0000 (22:10 +0000)]
[InstCombine] simplify masked scatter/gather intrinsics with zero masks

A masked scatter with a zero mask means there's no store.
A masked gather with a zero mask means the passthru arg is returned.

This is a continuation of:
http://reviews.llvm.org/rL259369
http://reviews.llvm.org/rL259392

llvm-svn: 259421

8 years ago[X86][AVX512] Add support for AVX512 VINSERTPS shuffle decoding
Simon Pilgrim [Mon, 1 Feb 2016 22:05:50 +0000 (22:05 +0000)]
[X86][AVX512] Add support for AVX512 VINSERTPS shuffle decoding

llvm-svn: 259420

8 years agoSmallSet/SmallPtrSet: Refuse huge Small numbers
Matthias Braun [Mon, 1 Feb 2016 22:05:16 +0000 (22:05 +0000)]
SmallSet/SmallPtrSet: Refuse huge Small numbers

These sets do linear searching in small mode; It is not a good idea to
use huge numbers as the small value here, save people from themselves by
adding a static_assert.

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

llvm-svn: 259419

8 years agoUndoing commit r259366 to debug buildbot failure.
Arpith Chacko Jacob [Mon, 1 Feb 2016 22:02:05 +0000 (22:02 +0000)]
Undoing commit r259366 to debug buildbot failure.
> http://reviews.llvm.org/D16758

llvm-svn: 259418

8 years agoSimplify.
Rafael Espindola [Mon, 1 Feb 2016 21:52:00 +0000 (21:52 +0000)]
Simplify.

Now that we remember the StringRefs when they are first added, we can
write the table in any order.

llvm-svn: 259417

8 years ago[X86][SSE] Regenerated load vector + element extraction tests.
Simon Pilgrim [Mon, 1 Feb 2016 21:46:12 +0000 (21:46 +0000)]
[X86][SSE] Regenerated load vector + element extraction tests.

llvm-svn: 259416

8 years agoUse dyn_cast instead of static_cast.
Pete Cooper [Mon, 1 Feb 2016 21:42:17 +0000 (21:42 +0000)]
Use dyn_cast instead of static_cast.

Now that MachoFile has classof(), we can use dyn_cast instead which
is actually the only safe way to handle this.

Turns out this actually manifests as a bug as we were incorrectly
casting instances which weren't MachoFile in to a MachoFile.

Unfortunately, there's no reliable way of checking for this as it
requires that the file we are looking for has a 0 at exactly the byte
we need for the load of subsectionsViaSymbols.

llvm-svn: 259413

8 years agoMove comments a bit closer to associated code. NFC.
Chad Rosier [Mon, 1 Feb 2016 21:38:31 +0000 (21:38 +0000)]
Move comments a bit closer to associated code. NFC.

llvm-svn: 259411

8 years ago[X86][SSE] Add AVX512 merge consecutive load tests
Simon Pilgrim [Mon, 1 Feb 2016 21:30:50 +0000 (21:30 +0000)]
[X86][SSE] Add AVX512 merge consecutive load tests

Add AVX512F/AVX512BW 512-bit tests.

Add AVX512F tests to existing 128/256-bit tests.

llvm-svn: 259410

8 years agoCode clean up; NFC.
Aaron Ballman [Mon, 1 Feb 2016 21:28:33 +0000 (21:28 +0000)]
Code clean up; NFC.

Patch by Alexander Riccio.

llvm-svn: 259409

8 years ago[CMake] Use LLVM_MAIN_SRC_DIR instead of LLVM_SOURCE_DIR.
Alexey Samsonov [Mon, 1 Feb 2016 21:08:16 +0000 (21:08 +0000)]
[CMake] Use LLVM_MAIN_SRC_DIR instead of LLVM_SOURCE_DIR.

The former will be properly initialized in standalone CMake build of
compiler-rt.

llvm-svn: 259407

8 years agoRegenerate vector blend tests.
Simon Pilgrim [Mon, 1 Feb 2016 21:06:32 +0000 (21:06 +0000)]
Regenerate vector blend tests.

llvm-svn: 259406

8 years agoRegenerate vector sext/zext constant folding tests.
Simon Pilgrim [Mon, 1 Feb 2016 21:01:29 +0000 (21:01 +0000)]
Regenerate vector sext/zext constant folding tests.

llvm-svn: 259405

8 years agoELF: Teach SymbolBody about how to get its addresses.
Rui Ueyama [Mon, 1 Feb 2016 21:00:35 +0000 (21:00 +0000)]
ELF: Teach SymbolBody about how to get its addresses.

Previously, the methods to get symbol addresses were somewhat scattered
in many places. You can use getEntryAddr returns the address of the symbol,
but if you want to get the GOT address for the symbol, you needed to call
Out<ELFT>::Got->getEntryAddr(Sym). This change adds new functions, getVA,
getGotVA, getGotPltVA, and getPltVA to SymbolBody, so that you can use
SymbolBody as the central place to ask about symbols.

http://reviews.llvm.org/D16710

llvm-svn: 259404

8 years agoAvoid inlining call sites in unreachable-terminated block
Jun Bum Lim [Mon, 1 Feb 2016 20:55:11 +0000 (20:55 +0000)]
Avoid inlining call sites in unreachable-terminated block

Summary:
If the normal destination of the invoke or the parent block of the call site is unreachable-terminated, there is little point in inlining the call site unless there is literally zero cost. Unlike my previous change (D15289), this change specifically handle the call sites followed by unreachable in the same basic block for call or in the normal destination for the invoke. This change could be a reasonable first step to conservatively inline call sites leading to an unreachable-terminated block while BFI / BPI is not yet available in inliner.

Reviewers: manmanren, majnemer, hfinkel, davidxl, mcrosier, dblaikie, eraman

Subscribers: dblaikie, davidxl, mcrosier, llvm-commits

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

llvm-svn: 259403