Commit Graph

255888 Commits

Author SHA1 Message Date
Petr Hosek 9a2bba7251 Revert "[ELF] Make __ehdr_start point to ELF file headers"
This reverts commit r296079.

llvm-svn: 296083
2017-02-24 03:18:59 +00:00
Petr Hosek 162540ec1d [Driver] Enable SafeStack for Fuchsia targets
The runtime support is provided directly by the Fuchsia system C
library.

Patch by Roland McGrath

Differential Revision: https://reviews.llvm.org/D30238

llvm-svn: 296082
2017-02-24 03:17:41 +00:00
Petr Hosek a7d5916308 [Fuchsia] Use thread-pointer ABI slots for stack-protector and safe-stack
The Fuchsia ABI defines slots from the thread pointer where the
stack-guard value for stack-protector, and the unsafe stack pointer
for safe-stack, are stored. This parallels the Android ABI support.

Patch by Roland McGrath

Differential Revision: https://reviews.llvm.org/D30237

llvm-svn: 296081
2017-02-24 03:10:10 +00:00
Eli Friedman 7e0ce82c4a Add some testcases for bitfields with illegal widths.
clang will generate IR like this for input using packed bitfields;
very simple semantically, but it's a bit tricky to actually
generate good code.

llvm-svn: 296080
2017-02-24 03:04:11 +00:00
Petr Hosek 701ad3fbf9 [ELF] Make __ehdr_start point to ELF file headers
__ehdr_start should be pointing to ELF file headers, not program
headers.

Differential Revision: https://reviews.llvm.org/D30319

llvm-svn: 296079
2017-02-24 03:00:52 +00:00
Richard Trieu 8459ddf12a [ODRHash] Add handling of TypedefType and DeclarationName
Differential Revision: https://reviews.llvm.org/D21675

llvm-svn: 296078
2017-02-24 02:59:12 +00:00
Eli Friedman 8f34746c72 Fix old testcase for dead store to match the original intent.
The x86 backend has a special case for load+xor+store, which isn't really
what this is trying to test.

llvm-svn: 296077
2017-02-24 02:58:49 +00:00
George Burgess IV b7760210d3 Represent pass_object_size attrs in ExtParameterInfo
The goal of this is to fix a bug in modules where we'd merge
FunctionDecls that differed in their pass_object_size attributes. Since
we can overload on the presence of pass_object_size attributes, this
behavior is incorrect.

We don't represent `N` in `pass_object_size(N)` as part of
ExtParameterInfo, since it's an error to overload solely on the value of
N. This means that we have a bug if we have two modules that declare
functions that differ only in their pass_object_size attrs, like so:

// In module A, from a.h
void foo(char *__attribute__((pass_object_size(0))));

// In module B, from b.h
void foo(char *__attribute__((pass_object_size(1))));

// In module C, in main.c
#include "a.h"
#include "b.h"

At the moment, we'll merge the foo decls, when we should instead emit a
diagnostic about an invalid overload. We seem to have similar (silent)
behavior if we overload only on the return type of `foo` instead; I'll
try to find a good place to put a FIXME (or I'll just file a bug) soon.

This patch also fixes a bug where we'd not output the proper extended
parameter info for declarations with pass_object_size attrs.

llvm-svn: 296076
2017-02-24 02:49:47 +00:00
Rui Ueyama 741cc4be7e Add documents to a doctree.
Looks like all documents must be in a doctree.

llvm-svn: 296075
2017-02-24 02:46:03 +00:00
Rui Ueyama fca2a110ed Attempt to fix lld-sphinx-docs bot.
llvm-svn: 296074
2017-02-24 02:07:54 +00:00
Richard Smith 8bae1be0fa Factor out some common code between SpecialMemberExceptionSpecInfo and SpecialMemberDeletionInfo.
To simplify this, convert SpecialMemberOverloadResult to a value type.

llvm-svn: 296073
2017-02-24 02:07:20 +00:00
Rui Ueyama 2698ab4b62 Update the main document of LLD for those who are not familiar with the project.
llvm-svn: 296072
2017-02-24 01:55:50 +00:00
Kamil Rytarowski 7a8ac3a639 Introduce support for Debug Registers in RegisterContextNetBSD_x86_64
Summary:
NetBSD 7.99.62 introduced Debug Registers interface similar to the FreeBSD one.
This interface will land NetBSD-8.0.

Introduce support for this interface in Register Context NetBSD x86_64 unconditionally as older versions of NetBSD will not be supported.

This change allows to reduce diff with other ports and remove local copy of the RegisterInfos_x86_64.h content.

NetBSD Register Context for 32-bit x86 support will be added later.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, joerg, emaste, clayborg

Reviewed By: labath, clayborg

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D30287

llvm-svn: 296071
2017-02-24 01:53:45 +00:00
Kamil Rytarowski 8fbf3b04ae Switch NetBSD from paccept(2) to accept4(2)
Summary:
NetBSD 8.0 will ship with accept4(2) in libc wrapping paccept(2).

This change reduces needless difference with other platforms.

Older versions of NetBSD will not be supported.

No functional change.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, emaste, labath, clayborg

Reviewed By: emaste, labath, clayborg

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D30288

llvm-svn: 296070
2017-02-24 01:51:38 +00:00
Xin Tong f51d804a9f Fix an iterator invalidation bug when simplifying LIC user.
LoopUnswitch/simplify-with-nonvalness.ll is the test case for this.
The LIC has 2 users and deleting the 1st user when it can be simplified
invalidated the iterator for the 2nd user.

llvm-svn: 296069
2017-02-24 01:43:36 +00:00
Richard Smith 5511800bb0 Simplify and pass a more useful source location when computing an exception
specification for an implicit special member.

llvm-svn: 296068
2017-02-24 01:36:58 +00:00
Richard Smith 2246c83369 Refactor computation of exception specification for special members to remove
some of the repetition.

llvm-svn: 296067
2017-02-24 01:29:42 +00:00
Douglas Yung 1db609f882 Recently a change was made to this test in r294639 which fails when the
compiler is run in a mode where the default C++ standard is newer than C++03.
The reason is because one of the warnings checked is only produced when the
compiler is using C++03 or lower.

This change fixes this problem as well as adds explicit run lines to run the
test in C++03 and C++11 modes.

llvm-svn: 296066
2017-02-24 01:25:02 +00:00
Adam Nemet f373e68bfc [LazyMachineBFI] Add testcase
This is based on Justin's testcase and checking whether BFI is not populated
in case hotness is off.

This is a patch meant on top of Justin's patch to enable Machine opt-remarks
in the
AsmPrinter (http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170130/426595.html)

Differential Revision: https://reviews.llvm.org/D29837

llvm-svn: 296065
2017-02-24 01:22:55 +00:00
Michael Kuperstein 581c9f4b20 Revert r269060 to pacify bots.
llvm-svn: 296064
2017-02-24 01:22:19 +00:00
Hans Wennborg 260c6d4555 Revert r291477 "[Frontend] Correct values of ATOMIC_*_LOCK_FREE to match builtin"
It caused PR31864. There is a patch in progress to fix that, but let's
revert in the meantime.

llvm-svn: 296063
2017-02-24 01:16:34 +00:00
Vedant Kumar 7f809b2fbd [profiling] PR31992: Don't skip interesting non-base constructors
Fix the fact that we don't assign profile counters to constructors in
classes with virtual bases, or constructors with variadic parameters.

Differential Revision: https://reviews.llvm.org/D30131

llvm-svn: 296062
2017-02-24 01:15:19 +00:00
Justin Bogner d75fd0988d OptDiag: Add test for r296053
Forgot to commit this with the change.

llvm-svn: 296061
2017-02-24 01:13:09 +00:00
Michael Kuperstein 12e79d5002 [CGP] Split some critical edges coming out of indirect branches
Splitting critical edges when one of the source edges is an indirectbr
is hard in general (because it requires changing the memory the indirectbr
reads). But if a block only has a single indirectbr predecessor (which is
the common case), we can simulate splitting that edge by splitting
the destination block, and retargeting the *direct* branches.

This is motivated by the use of computed gotos in python 2.7: PyEval_EvalFrame()
ends up using an indirect branch with ~100 successors, and passing a constant to
each of those. Since MachineSink can't break indirect critical edges on demand
(and doing this in MIR doesn't look feasible), this causes us to emit about ~100
defs of registers containing constants, which we in the predecessor block, where
only one of those constants is used in each successor. So, at each computed goto,
we needlessly spill about a 100 constants to stack. The end result is that a
clang-compiled python interpreter can be about ~2.5x slower on a simple python
reduction loop than a gcc-compiled interpreter.

Differential Revision: https://reviews.llvm.org/D29916

llvm-svn: 296060
2017-02-24 00:56:21 +00:00
Ahmed Bougacha 7daaf88c70 [GlobalISel] Use the same name for all remarks.
While there, switch to the explicit ctor.

llvm-svn: 296059
2017-02-24 00:34:47 +00:00
Ahmed Bougacha 7c88a4e12b [GlobalISel] Use the DISubprogram for translation failure remarks.
Justin added support for DISubprogram locs in r295531 and r296052.
Use that instead of no-loc for constants and arguments.

llvm-svn: 296058
2017-02-24 00:34:44 +00:00
Ahmed Bougacha 8f9e99bcb6 [GlobalISel] Remove now-unnecessary variable. NFC.
Since r296047, we're able to return early on failures.
Don't track whether we succeeded.

llvm-svn: 296057
2017-02-24 00:34:41 +00:00
David L. Jones ecc6de35fb [Driver] Move architecture-specific free helper functions to their own files.
This patch moves helper functions that are CPU-specific out of Driver.cpp and to
separate implementation files. The new files are named for the architecture,
e.g. ARMArch.cpp.

The next step after this will be to move OS-specific code, which I expect will
include many of the tool implementations, to similarly separate files.

Some CPU-specific functions are not being moved just yet. In cases where the
only caller is the platform-specific tools, I plan to move them together. An
example is Hexagon, where the only caller of the architecture-specific functions
are the tools themselves. (I'm happy to revise this choice, it just seems like
less churn to me.)

This does mean that some functions which were previously static are now exposed
through the library header Driver.h.

Reviewers: rsmith, javed.absar

Subscribers: aemerson, danalbert, srhines, dschuff, jyknight, nemanjai, mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D30315

llvm-svn: 296056
2017-02-24 00:28:01 +00:00
Adrian McCarthy 3e0c0688e9 Fix unit tests after r296049.
llvm-svn: 296055
2017-02-24 00:25:17 +00:00
Alex Lorenz 8da15b501a NFC, Remove commented out block of code from CGBlocks.cpp
This is a preparation clean-up commit around the code that emits
block copy/dispose routines.

llvm-svn: 296054
2017-02-24 00:21:20 +00:00
Justin Bogner 369ba753aa OptDiag: Summarize the instruction count in asm-printer
Add an optimization remark to asm-printer that summarizes the number
of instructions emitted per function.

llvm-svn: 296053
2017-02-24 00:19:22 +00:00
Justin Bogner 0bb740540b OptDiag: Use DiagnosticLocation in MachineOptimizationRemarks
DiagnosticInfo switched from DebugLoc to DiagnosticLocation in
r295519, update these subclasses to match.

llvm-svn: 296052
2017-02-24 00:19:18 +00:00
Evgeniy Stepanov acc8ebb8e3 [msan] Test for alloca handling.
llvm-svn: 296051
2017-02-24 00:13:28 +00:00
Evgeniy Stepanov d1daf631f4 [msan] Fix instrumentation of array allocas.
Before this, MSan poisoned exactly one element of any array alloca,
even if the number of elements was zero.

llvm-svn: 296050
2017-02-24 00:13:17 +00:00
Adrian McCarthy 649b8e0c45 Implement some methods for NativeRawSymbol
This allows the ability to call IPDBSession::getGlobalScope with a NativeSession and
to then query it for some basic fields from the PDB's InfoStream.
Note that the symbols now have non-const references back to the Session so that
NativeRawSymbol can access the PDBFile through the Session.

Differential Revision: https://reviews.llvm.org/D30314

llvm-svn: 296049
2017-02-24 00:10:47 +00:00
Alex Lorenz 95cb2fbd89 NFC, Add a test that ensures that we don't emit helper code in copy/dispose
routines for objects that are captured with the __unsafe_unretained
ownership qualifier

This is a preparation commit that improves code-coverage in code that emits
block copy/dispose routines.

llvm-svn: 296048
2017-02-24 00:09:30 +00:00
Ahmed Bougacha 4f8dd0202d [GlobalISel] Don't translate other blocks when one failed.
We were stopping the translation of the parent block when the
translation of an instruction failed, but we were still trying to
translate the other blocks of the parent function.

Don't do that.

llvm-svn: 296047
2017-02-23 23:57:36 +00:00
Ahmed Bougacha eceabddcfd [GlobalISel] Finalize translated function on scope exit. NFC.
This is the compromise between having a per-function IRTranslator
and manually managing the per-function state.

llvm-svn: 296046
2017-02-23 23:57:28 +00:00
Adrian Prantl fd37e79ae6 fix 80-column violation
llvm-svn: 296045
2017-02-23 23:54:29 +00:00
Xin Tong df4dff3928 Delete outdated comment. NFC
llvm-svn: 296043
2017-02-23 23:47:10 +00:00
Bob Haarman 851b1f866b [COFF] added test for thinlto
Summary: Creates bitcode files suitable for use with ThinLTO, then checks that the linker can build an executable from them.

Reviewers: ruiu, pcc

Reviewed By: pcc

Subscribers: mehdi_amini, Prazek, llvm-commits

Differential Revision: https://reviews.llvm.org/D30277

llvm-svn: 296042
2017-02-23 23:42:24 +00:00
Xin Tong ec6f90bec9 LoopUnswitch - Simplify based on known not to a be constant.
Summary: In case we do not know what the condition is in an unswitched loop, but we know its definitely NOT a known constant. We can perform simplifcations based on this information.

Reviewers: sanjoy, hfinkel, chenli, efriedma

Reviewed By: efriedma

Subscribers: david2050, llvm-commits, mzolotukhin

Differential Revision: https://reviews.llvm.org/D28968

llvm-svn: 296041
2017-02-23 23:42:19 +00:00
Alex Lorenz e3e8131460 NFC, Add a test that ensure that we don't emit helper code in copy/dispose
routines for variables that are const-captured

This is a preparation commit that improves code-coverage in code that emits
block copy/dispose routines.

llvm-svn: 296040
2017-02-23 23:41:50 +00:00
Adam Nemet 25e92e29ba [OptDiag] Comment about the legacy status of emitOptimizationRemark*
functions

llvm-svn: 296039
2017-02-23 23:11:23 +00:00
Adam Nemet ca8f40f27a [OptDiag] Remove hotness parameter from legacy remark ctors
Anything using hotness should be using ORE.

llvm-svn: 296038
2017-02-23 23:11:21 +00:00
Adam Nemet de53bfb94d [OptDiag] Hide legacy remark ctors
These are only used when emitting remarks without ORE directly using the free
functions emitOptimizationRemark*.

llvm-svn: 296037
2017-02-23 23:11:11 +00:00
Bryant Wong 332e6e5ae5 [ADT] Fix zip iterator interface.
This commit provides `zip_{first,shortest}` with the standard member types and
methods expected of iterators (e.g., `difference_type`), in order for zip to be
used with other adaptors, such as `make_filter_range`.

Support for reverse iteration has also been added.

Differential Revision: https://reviews.llvm.org/D30246

llvm-svn: 296036
2017-02-23 23:00:46 +00:00
Sanjoy Das aa722ae84c [IR] Add a Instruction::dropPoisonGeneratingFlags helper
Summary:
The helper will be used in a later change.  This change itself is NFC
since the only user of this new function is its unit test.

Reviewers: majnemer, efriedma

Reviewed By: efriedma

Subscribers: efriedma, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D30184

llvm-svn: 296035
2017-02-23 22:50:52 +00:00
Benjamin Kramer d12317ef90 [CodeGen] Silence unused variable warning in Release builds.
llvm-svn: 296034
2017-02-23 22:47:56 +00:00
Richard Smith 382bc51fdd PR32044: Fix some cases where we would confuse a transparent init-list expression with an aggregate init.
llvm-svn: 296033
2017-02-23 22:41:47 +00:00