platform/upstream/llvm.git
9 years agotsan: fix a bug memory access handling
Dmitry Vyukov [Tue, 28 Apr 2015 18:08:42 +0000 (18:08 +0000)]
tsan: fix a bug memory access handling

We incorrectly replaced shadow slots
when the new value is not stronger than the old one.
The bug can lead to false negatives.
The bug was detected by Go race test suite:
https://github.com/golang/go/issues/10589

llvm-svn: 236008

9 years agoFix a [-Werror,-Winconsistent-missing-override] problem in the
Eric Christopher [Tue, 28 Apr 2015 18:06:27 +0000 (18:06 +0000)]
Fix a [-Werror,-Winconsistent-missing-override] problem in the
NVPTX overrides.

llvm-svn: 236007

9 years agoFix PR22047: ObjC: Method unavailability attribute doesn't work with overloaded methods
Jonathan Roelofs [Tue, 28 Apr 2015 18:04:44 +0000 (18:04 +0000)]
Fix PR22047: ObjC: Method unavailability attribute doesn't work with overloaded methods

http://reviews.llvm.org/D9261

llvm-svn: 236006

9 years agoCombine instantiation context of field initializer with context of class.
Serge Pavlov [Tue, 28 Apr 2015 17:58:47 +0000 (17:58 +0000)]
Combine instantiation context of field initializer with context of class.

Inclass initializer is instantiated in its own LocalInstantiationScope. It
causes problems when instantiating local classes - when instantiation scope
is searched for DeclContext of the field, the search fails. As a solution,
the instantiation scope of field initializer is combined with its outer
scope.

This patch fixes PR23194.

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

llvm-svn: 236005

9 years agoR600: Fix up for AsmPrinter's OutStreamer being a unique_ptr
Tom Stellard [Tue, 28 Apr 2015 17:37:03 +0000 (17:37 +0000)]
R600: Fix up for AsmPrinter's OutStreamer being a unique_ptr

Fixes a crash with basically any OpenGL application using the radeonsi
driver.

Patch by: Michel Dänzer

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90176
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 236004

9 years agoR600/SI: Add a lower case alias for subtarget feature: +DumpCode
Tom Stellard [Tue, 28 Apr 2015 17:37:00 +0000 (17:37 +0000)]
R600/SI: Add a lower case alias for subtarget feature: +DumpCode

llc converts all feature strings to lower case, while the LLVM C API
does not, so we need a lower case alias in order to test this with llc.

llvm-svn: 236003

9 years agoSilencing a -Wuninitialized warning in a different way. This replaces r235981, but...
Aaron Ballman [Tue, 28 Apr 2015 17:34:38 +0000 (17:34 +0000)]
Silencing a -Wuninitialized warning in a different way. This replaces r235981, but is still NFC.

llvm-svn: 236002

9 years agoDisable clang-tools-extra/test/pp-trace/pp-trace-modules.cpp on win32 for now. Invest...
NAKAMURA Takumi [Tue, 28 Apr 2015 17:31:36 +0000 (17:31 +0000)]
Disable clang-tools-extra/test/pp-trace/pp-trace-modules.cpp on win32 for now. Investigating.

llvm-svn: 236001

9 years ago[NVPTX] Handle addrspacecast constant expressions in aggregate initializers
Justin Holewinski [Tue, 28 Apr 2015 17:18:30 +0000 (17:18 +0000)]
[NVPTX] Handle addrspacecast constant expressions in aggregate initializers

We need to track if an AddrSpaceCast expression was seen when
generating an MCExpr for a ConstantExpr.  This change introduces a
custom lowerConstant method to the NVPTX asm printer that will create
NVPTXGenericMCSymbolRefExpr nodes at the appropriate places to encode
the information that a given symbol needs to be casted to a generic
address.

llvm-svn: 236000

9 years agoFix some preprocessor directives that were generating warnings in the test suite.
Marshall Clow [Tue, 28 Apr 2015 16:52:30 +0000 (16:52 +0000)]
Fix some preprocessor directives that were generating warnings in the test suite.

llvm-svn: 235999

9 years ago[opaque pointer type] Encode the allocated type of an alloca rather than its pointer...
David Blaikie [Tue, 28 Apr 2015 16:51:01 +0000 (16:51 +0000)]
[opaque pointer type] Encode the allocated type of an alloca rather than its pointer result type.

llvm-svn: 235998

9 years agomove IR-level optimization flags into their own struct
Sanjay Patel [Tue, 28 Apr 2015 16:39:12 +0000 (16:39 +0000)]
move IR-level optimization flags into their own struct

This is a preliminary step to using the IR-level floating-point fast-math-flags in the SDAG (D8900).

In this patch, we introduce the optimization flags as their own struct. As noted in the TODO comment,
we should eventually share this data between the IR passes and the backend.

We also switch the existing nsw / nuw / exact bit functionality of the BinaryWithFlagsSDNode class to
use the new struct.

The tradeoff is that instead of using the free but limited space of SDNode's SubclassData, we add a
data member to the subclass. This means we don't have to repeat all of the get/set methods per flag,
but we're potentially adding size to all nodes of this subclassi type.

In practice on 64-bit systems (measured on Linux and MacOS X), there is no size difference between an
SDNode and BinaryWithFlagsSDNode after this change: they're both 80 bytes. This means that we had at
least one free byte to play with due to struct alignment.

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

llvm-svn: 235997

9 years agoUse a std::vector to record the offsets of the sections. NFC.
Rafael Espindola [Tue, 28 Apr 2015 15:26:21 +0000 (15:26 +0000)]
Use a std::vector to record the offsets of the sections. NFC.

llvm-svn: 235995

9 years agoAvoid an extra loop for computing the section size. NFC.
Rafael Espindola [Tue, 28 Apr 2015 15:04:09 +0000 (15:04 +0000)]
Avoid an extra loop for computing the section size. NFC.

llvm-svn: 235994

9 years agoFixed crash of variable shift inst on AVX2
Elena Demikhovsky [Tue, 28 Apr 2015 14:46:35 +0000 (14:46 +0000)]
Fixed crash of variable shift inst on AVX2

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

llvm-svn: 235993

9 years agoUpdate C++17 status; mark issues 2170, 2377, and 2408 as complete. We already do...
Marshall Clow [Tue, 28 Apr 2015 14:26:29 +0000 (14:26 +0000)]
Update C++17 status; mark issues 2170, 2377, and 2408 as complete. We already do these; no code changes necessary.

llvm-svn: 235992

9 years agoReplace sprintf with snprintf to avoid a crash.
Hafiz Abid Qadeer [Tue, 28 Apr 2015 14:16:00 +0000 (14:16 +0000)]
Replace sprintf with snprintf to avoid a crash.
During testing -data-list-register-values, I saw a crash here due to buffer overflow.
This commit should fix the crash. There is still problem with printing 1-byte register
in some cases that I will fix separately.

No regression on MI test cases.

llvm-svn: 235991

9 years ago[mips] [IAS] Do not generate redundant ORi in createLShiftOri.
Toma Tabacu [Tue, 28 Apr 2015 14:06:35 +0000 (14:06 +0000)]
[mips] [IAS] Do not generate redundant ORi in createLShiftOri.

Summary: If the immediate is 0, the ORi is pointless.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235990

9 years agoReapply r235977 "[DebugInfo] Add debug locations to constant SD nodes"
Sergey Dmitrouk [Tue, 28 Apr 2015 14:05:47 +0000 (14:05 +0000)]
Reapply r235977 "[DebugInfo] Add debug locations to constant SD nodes"

[DebugInfo] Add debug locations to constant SD nodes

This adds debug location to constant nodes of Selection DAG and updates
all places that create constants to pass debug locations
(see PR13269).

Can't guarantee that all locations are correct, but in a lot of cases choice
is obvious, so most of them should be. At least all tests pass.

Tests for these changes do not cover everything, instead just check it for
SDNodes, ARM and AArch64 where it's easy to get incorrect locations on
constants.

This is not complete fix as FastISel contains workaround for wrong debug
locations, which drops locations from instructions on processing constants,
but there isn't currently a way to use debug locations from constants there
as llvm::Constant doesn't cache it (yet). Although this is a bit different
issue, not directly related to these changes.

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

llvm-svn: 235989

9 years agoUse CIE version 4 for dwarf4.
Rafael Espindola [Tue, 28 Apr 2015 13:55:31 +0000 (13:55 +0000)]
Use CIE version 4 for dwarf4.

According to http://www.dwarfstd.org/doc/DWARF4.pdf appendix F the CIE
version for dwarf 4 is 4.

llvm-svn: 235988

9 years agoRevert "[DebugInfo] Add debug locations to constant SD nodes"
Daniel Jasper [Tue, 28 Apr 2015 13:38:35 +0000 (13:38 +0000)]
Revert "[DebugInfo] Add debug locations to constant SD nodes"

This breaks a test:
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/23870

llvm-svn: 235987

9 years agoAVX-512: added intrinsics for KNL and SKX
Elena Demikhovsky [Tue, 28 Apr 2015 13:28:01 +0000 (13:28 +0000)]
AVX-512: added intrinsics for KNL and SKX
by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 235986

9 years ago[OPENMP] Fix crash on loop control vars explicitly marked as private.
Alexey Bataev [Tue, 28 Apr 2015 13:20:05 +0000 (13:20 +0000)]
[OPENMP] Fix crash on loop control vars explicitly marked as private.

It is allowed to mark loop control vars as private in 'private' or 'lastprivate' clause, so no need to assert here.

llvm-svn: 235985

9 years ago[mips] [IAS] Rename the createShiftOr function to createLShiftOri. NFC.
Toma Tabacu [Tue, 28 Apr 2015 13:16:06 +0000 (13:16 +0000)]
[mips] [IAS] Rename the createShiftOr function to createLShiftOri. NFC.

Summary: The new name is more accurate with regard to the functionality.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235984

9 years agoAdd language option in -gdb-show command (MI)
Ilia K [Tue, 28 Apr 2015 12:51:16 +0000 (12:51 +0000)]
Add language option in -gdb-show command (MI)

Summary:
Add language option in -gdb-show command + test:
```
$ bin/lldb-mi ~/p/hello
[...]
b main
[...]
r
[...]
(gdb)
-gdb-show language
^done,value="c++"
(gdb)
quit
```

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh, granata.enrico, jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, jingham, granata.enrico, clayborg, abidh

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

llvm-svn: 235983

9 years agoDon't print a type of variable in Address::Dump if it's unknown (i.e. nullptr)
Ilia K [Tue, 28 Apr 2015 12:45:57 +0000 (12:45 +0000)]
Don't print a type of variable in Address::Dump if it's unknown (i.e. nullptr)

Summary: This patch fixes dereferencing of nullptr in case when GetType() returns that.

Reviewers: jingham, granata.enrico, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, granata.enrico, clayborg, jingham

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

llvm-svn: 235982

9 years agoSilencing a spurious -Wuninitialized warning with this local; NFC.
Aaron Ballman [Tue, 28 Apr 2015 12:36:54 +0000 (12:36 +0000)]
Silencing a spurious -Wuninitialized warning with this local; NFC.

llvm-svn: 235981

9 years agotest commit
Ewan Crawford [Tue, 28 Apr 2015 12:34:19 +0000 (12:34 +0000)]
test commit

llvm-svn: 235980

9 years agoSkip TestProcessAttach.py on Linux
Pavel Labath [Tue, 28 Apr 2015 12:28:08 +0000 (12:28 +0000)]
Skip TestProcessAttach.py on Linux

The test was already XFAILed. Changing this to skip, because the test timeouts and gets flagged
as an error anyway.

llvm-svn: 235979

9 years ago[mips] [IAS] Store the expandLoadImm destination register in a variable. NFC.
Toma Tabacu [Tue, 28 Apr 2015 12:04:53 +0000 (12:04 +0000)]
[mips] [IAS] Store the expandLoadImm destination register in a variable. NFC.

Summary: This removes multiple calls to getReg() and saves us column space in the source file.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235978

9 years ago[DebugInfo] Add debug locations to constant SD nodes
Sergey Dmitrouk [Tue, 28 Apr 2015 11:56:37 +0000 (11:56 +0000)]
[DebugInfo] Add debug locations to constant SD nodes

This adds debug location to constant nodes of Selection DAG and updates
all places that create constants to pass debug locations
(see PR13269).

Can't guarantee that all locations are correct, but in a lot of cases choice
is obvious, so most of them should be. At least all tests pass.

Tests for these changes do not cover everything, instead just check it for
SDNodes, ARM and AArch64 where it's easy to get incorrect locations on
constants.

This is not complete fix as FastISel contains workaround for wrong debug
locations, which drops locations from instructions on processing constants,
but there isn't currently a way to use debug locations from constants there
as llvm::Constant doesn't cache it (yet). Although this is a bit different
issue, not directly related to these changes.

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

llvm-svn: 235977

9 years ago[ARM/AArch64] Enforce alignment for bitfielded structs
Bradley Smith [Tue, 28 Apr 2015 11:24:54 +0000 (11:24 +0000)]
[ARM/AArch64] Enforce alignment for bitfielded structs

When creating a global variable with a type of a struct with bitfields, we must
forcibly set the alignment of the global from the RecordDecl. We must do this so
that the proper bitfield alignment makes its way down to LLVM, since clang will
mangle the bitfields into one large type.

llvm-svn: 235976

9 years ago[Msan] Fix the getline.cc test to pass on FreeBSD
Viktor Kutuzov [Tue, 28 Apr 2015 10:23:52 +0000 (10:23 +0000)]
[Msan] Fix the getline.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9251

llvm-svn: 235975

9 years agoLLDB-MI: -var-list-children with no children doesn't need a children value in the...
Bruce Mitchener [Tue, 28 Apr 2015 10:03:55 +0000 (10:03 +0000)]
LLDB-MI: -var-list-children with no children doesn't need a children value in the response.

Summary:
When using GDB with MI, if there aren't children for a variable,
it doesn't include a "children" value in the response. LLDB does
and sets it to "[]" while variables with children have an unquoted
list: children=[...].

This removes the children value entirely when there are no children
making this match GDB in behavior.

Test Plan: Ran tests on Mac OS X and they passed.

Reviewers: abidh, domipheus

Subscribers: lldb-commits

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

llvm-svn: 235974

9 years agoAVX-512: Added "pandn" intrinsics set
Elena Demikhovsky [Tue, 28 Apr 2015 08:12:42 +0000 (08:12 +0000)]
AVX-512: Added "pandn" intrinsics set
by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 235971

9 years agoMasked gather and scatter: Added code for SelectionDAG.
Elena Demikhovsky [Tue, 28 Apr 2015 07:57:37 +0000 (07:57 +0000)]
Masked gather and scatter: Added code for SelectionDAG.
All other patches, including tests will follow.

http://reviews.llvm.org/D7665

llvm-svn: 235970

9 years ago[NativeProcessLinux] Add back synchronisation of thread create events
Pavel Labath [Tue, 28 Apr 2015 07:51:52 +0000 (07:51 +0000)]
[NativeProcessLinux] Add back synchronisation of thread create events

Summary:
Without the synchronisation between the two thread creation events the following case could
happen:
- threads A and B are running. A hits a breakpoint. We note that we want to stop B.
- before we could stop it, B creates a new thread C, we get the stop notification for B, but we
  don't record C's existence yet.
- we resume B
- before we get the C notification, B stops again (e.g. hits a breakpoint, gets our SIGSTOP,
  etc.)
- we see all known threads have stopped, and we notify LLDB
- C notification comes, we note it's existence and resume it
=> we have an inconsistent state (LLDB thinks we've stopped, but C is running)

I resolve this by doing a blocking wait for for the C notification when we get the creation
notification on the parent (B) thread. This way the two events are synchronised, but we don't
need to introduce the intermediate "launching" state which would complicate handling of thread
states as all code would need to be aware of the third possible state.

Test Plan:
This is an obscure corner case, which I had not observed in practise, so I have no
test for it. I have tested that this commit does not regress in existing tests though.

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 235969

9 years agoInstrProf: Match a bit less strictly - some targets may add signext
Justin Bogner [Tue, 28 Apr 2015 06:55:23 +0000 (06:55 +0000)]
InstrProf: Match a bit less strictly - some targets may add signext

Notably, this bot didn't like it:

  http://lab.llvm.org:8011/builders/clang-cmake-mips/builds/5117

llvm-svn: 235968

9 years agoInstrProf: Mark code regions after throw expressions as unreachable
Justin Bogner [Tue, 28 Apr 2015 06:31:55 +0000 (06:31 +0000)]
InstrProf: Mark code regions after throw expressions as unreachable

We weren't setting regions as being unreachable after C++ throw
expressions, leading to incorrect count propagations.

llvm-svn: 235967

9 years ago[opaque pointer type] Encode the pointee type in the bitcode for 'cmpxchg'
David Blaikie [Tue, 28 Apr 2015 04:30:29 +0000 (04:30 +0000)]
[opaque pointer type] Encode the pointee type in the bitcode for 'cmpxchg'

As a space optimization, this instruction would just encode the pointer
type of the first operand and use the knowledge that the second and
third operands would be of the pointee type of the first. When typed
pointers go away, this assumption will no longer be available - so
encode the type of the second operand explicitly and rely on that for
the third.

Test case added to demonstrate the backwards compatibility concern,
which only comes up when the definition of the second operand comes
after the use (hence the weird basic block sequence) - at which point
the type needs to be explicitly encoded in the bitcode and the record
length changes to accommodate this.

llvm-svn: 235966

9 years agolibc++abi: work around layering violation
Saleem Abdulrasool [Tue, 28 Apr 2015 02:52:47 +0000 (02:52 +0000)]
libc++abi: work around layering violation

This papers over a layering violation currently between libc++abi and libunwind.
It reaches into the sources to get the declaration of an ABI defined function.
This should allow the ARM buildbot to continue building libc++abi again.

llvm-svn: 235965

9 years agolibc++abi: try harder to force the LLVM unwinder on ARM
Saleem Abdulrasool [Tue, 28 Apr 2015 02:09:53 +0000 (02:09 +0000)]
libc++abi: try harder to force the LLVM unwinder on ARM

Attempting to default the option to ON for ARM doesnt seem to work.  Force the
check lower and perform the check at the two sites that matter: the CPPFLAGS
definition and the header search path setup.

llvm-svn: 235964

9 years ago[MC] Use LShr for constant evaluation of ">>" on ELF/arm64--darwin.
Ahmed Bougacha [Tue, 28 Apr 2015 01:37:11 +0000 (01:37 +0000)]
[MC] Use LShr for constant evaluation of ">>" on ELF/arm64--darwin.

This matches other assemblers and is less unexpected (e.g. PR23227).
On ELF, I tried binutils gas v2.24 and nasm 2.10.09, and they both
agree on LShr.  On COFF, I couldn't get my hands on an assembler yet,
so don't change the behavior.  For now, don't change it on non-AArch64
Darwin either, as the other assembler is gas v1.38, which does an AShr.

llvm-svn: 235963

9 years ago[UBSan] Fix CMake rules for tests after r235954.
Alexey Samsonov [Tue, 28 Apr 2015 01:33:56 +0000 (01:33 +0000)]
[UBSan] Fix CMake rules for tests after r235954.

Make sure we don't run tests under TSan and MSan if they are
unavailable.

llvm-svn: 235962

9 years agoAddress old FIXMEs in UBSan test cases.
Alexey Samsonov [Tue, 28 Apr 2015 01:29:36 +0000 (01:29 +0000)]
Address old FIXMEs in UBSan test cases.

llvm-svn: 235961

9 years ago[TSan] Attempt to fix old Makefile build.
Alexey Samsonov [Tue, 28 Apr 2015 01:27:17 +0000 (01:27 +0000)]
[TSan] Attempt to fix old Makefile build.

llvm-svn: 235960

9 years agoExport __ubsan_* symbols from MSan and TSan runtimes.
Alexey Samsonov [Tue, 28 Apr 2015 01:20:34 +0000 (01:20 +0000)]
Export __ubsan_* symbols from MSan and TSan runtimes.

llvm-svn: 235958

9 years agoFix memory leak found by asan buildbot.
Richard Smith [Tue, 28 Apr 2015 01:11:23 +0000 (01:11 +0000)]
Fix memory leak found by asan buildbot.

llvm-svn: 235957

9 years agoDebugInfo: Add a clang test for LLVM fix for PR23332
Duncan P. N. Exon Smith [Tue, 28 Apr 2015 01:09:20 +0000 (01:09 +0000)]
DebugInfo: Add a clang test for LLVM fix for PR23332

Add a clang test for LLVM r235955, which added support for up to 2^16
arguments.

llvm-svn: 235956

9 years agoDebugInfo: Support up to 2^16 arguments in a subprogram
Duncan P. N. Exon Smith [Tue, 28 Apr 2015 01:07:33 +0000 (01:07 +0000)]
DebugInfo: Support up to 2^16 arguments in a subprogram

Support up to 2^16 arguments to a function.  If we do hit the limit,
assert out rather than restarting at 0 as we've done historically.

This fixes PR23332.  A clang test will follow.

llvm-svn: 235955

9 years agoAllow UBSan+MSan and UBSan+TSan combinations (Clang part).
Alexey Samsonov [Tue, 28 Apr 2015 00:56:48 +0000 (00:56 +0000)]
Allow UBSan+MSan and UBSan+TSan combinations (Clang part).

Embed UBSan runtime into TSan and MSan runtimes in the same as we do
in ASan. Extend UBSan test suite to also run tests for these
combinations.

llvm-svn: 235954

9 years agoAllow UBSan+MSan and UBSan+TSan combinations (Clang part).
Alexey Samsonov [Tue, 28 Apr 2015 00:56:36 +0000 (00:56 +0000)]
Allow UBSan+MSan and UBSan+TSan combinations (Clang part).

Embed UBSan runtime into TSan and MSan runtimes in the same as we do
in ASan. Extend UBSan test suite to also run tests for these
combinations.

llvm-svn: 235953

9 years agoCleanup, remove unused return value
Matthias Braun [Tue, 28 Apr 2015 00:37:05 +0000 (00:37 +0000)]
Cleanup, remove unused return value

llvm-svn: 235952

9 years ago[MC] Split MCBinaryExpr::Shr into LShr and AShr.
Ahmed Bougacha [Tue, 28 Apr 2015 00:21:32 +0000 (00:21 +0000)]
[MC] Split MCBinaryExpr::Shr into LShr and AShr.

Defaulting to AShr without consulting the target MCAsmInfo isn't OK.
Add a flag to fix that.  Keep it off for now: target migrations will
follow in separate commits.

llvm-svn: 235951

9 years ago[MC] Move getBinOpPrecedence into AsmParser. NFC.
Ahmed Bougacha [Tue, 28 Apr 2015 00:17:39 +0000 (00:17 +0000)]
[MC] Move getBinOpPrecedence into AsmParser. NFC.

In preparation for a future patch.

llvm-svn: 235950

9 years agoms_struct does not imply the MS base-layout ABI; separate these
John McCall [Tue, 28 Apr 2015 00:17:18 +0000 (00:17 +0000)]
ms_struct does not imply the MS base-layout ABI; separate these
conditions in the IRGen struct layout code.

rdar://20636558

llvm-svn: 235949

9 years ago[TestProcessAttach] Decorate with expectedFailureLinux
Siva Chandra [Mon, 27 Apr 2015 23:56:23 +0000 (23:56 +0000)]
[TestProcessAttach] Decorate with expectedFailureLinux

Summary: Link to PR: llvm.org/pr23360

Test Plan: dotest.py -p TestProcessAttach

Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 235947

9 years agoRefactor: put these function declarations somewhere more appropriate.
Richard Smith [Mon, 27 Apr 2015 23:52:41 +0000 (23:52 +0000)]
Refactor: put these function declarations somewhere more appropriate.

llvm-svn: 235946

9 years agoSwitch lowering: use uint32_t for weights everywhere
Hans Wennborg [Mon, 27 Apr 2015 23:52:19 +0000 (23:52 +0000)]
Switch lowering: use uint32_t for weights everywhere

I previously thought switch clusters would need to use uint64_t in case
the weights of multiple cases overflowed a 32-bit int. It turns
out that the weights on a terminator instruction are capped to allow for
being added together, so using a uint32_t should be safe.

llvm-svn: 235945

9 years ago[asan] Fix ASan build on Android/AArch64.
Evgeniy Stepanov [Mon, 27 Apr 2015 23:49:39 +0000 (23:49 +0000)]
[asan] Fix ASan build on Android/AArch64.

The build for aarch64 is not enabled in cmake/config-ix.cmake yet.

llvm-svn: 235944

9 years agoLTO: Add API to choose whether to embed uselists
Duncan P. N. Exon Smith [Mon, 27 Apr 2015 23:38:54 +0000 (23:38 +0000)]
LTO: Add API to choose whether to embed uselists

Reverse libLTO's default behaviour for preserving use-list order in
bitcode, and add API for controlling it.  The default setting is now
`false` (don't preserve them), which is consistent with `clang`'s
default behaviour.

Users of libLTO should call `lto_codegen_should_embed_uselists(CG,true)`
prior to calling `lto_codegen_write_merged_modules()` whenever the
output file isn't part of the production workflow in order to reproduce
results with subsequent calls to `llc`.

(I haven't added tests since `llvm-lto` (the test tool for LTO) doesn't
support bitcode output, and even if it did: there isn't actually a good
way to test whether a tool has passed the flag.  If the order is already
"natural" (if the order will already round-trip) then no use-list
directives are emitted at all.  At some point I'll circle back to add
tests to `llvm-as` (etc.) that they actually respect the flag, at which
point I can somehow add a test here as well.)

llvm-svn: 235943

9 years agoSwitch lowering: Take branch weight into account when ordering for fall-through
Hans Wennborg [Mon, 27 Apr 2015 23:35:22 +0000 (23:35 +0000)]
Switch lowering: Take branch weight into account when ordering for fall-through

Previously, the code would try to put a fall-through case last,
even if that meant moving a case with much higher branch weight
further down the chain.

Ordering by branch weight is most important, putting a fall-through
block last is secondary.

llvm-svn: 235942

9 years ago[modules] Incrementally compute the list of overridden module macros based on
Richard Smith [Mon, 27 Apr 2015 23:21:38 +0000 (23:21 +0000)]
[modules] Incrementally compute the list of overridden module macros based on
the active module macros at the point of definition, rather than reconstructing
it from the macro history. No functionality change intended.

llvm-svn: 235941

9 years agoAdd an unnamed pipe fail-safe to launching lldb-gdbserver.
Chaoren Lin [Mon, 27 Apr 2015 23:20:30 +0000 (23:20 +0000)]
Add an unnamed pipe fail-safe to launching lldb-gdbserver.

Summary:
Currently, launching lldb-gdbserver from platform on Android requires root for
mkfifo() and an explicit TMPDIR variable. This should remove both requirements.

Test Plan: Successfully launched lldb-gdbserver on a non-rooted Android device.

Reviewers: tberghammer, vharron, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 235940

9 years agoLTO: Simplify code generator initialization
Duncan P. N. Exon Smith [Mon, 27 Apr 2015 23:19:26 +0000 (23:19 +0000)]
LTO: Simplify code generator initialization

Simplify `LTOCodeGenerator` initialization by initializing simple fields
at their definition.

llvm-svn: 235939

9 years agoRemove stale FIXMEs from test case
Reid Kleckner [Mon, 27 Apr 2015 23:14:24 +0000 (23:14 +0000)]
Remove stale FIXMEs from test case

llvm-svn: 235937

9 years agoAlways add the target-cpu and target-features sets if they're non-null.
Eric Christopher [Mon, 27 Apr 2015 23:11:34 +0000 (23:11 +0000)]
Always add the target-cpu and target-features sets if they're non-null.
This makes sure that the front end is specific about what they're expecting
the backend to produce. Update a FIXME with the idea that the target-features
could be more precise using backend knowledge.

llvm-svn: 235936

9 years ago[Windows] Add a RegisterContextWindows_x64.
Zachary Turner [Mon, 27 Apr 2015 22:58:57 +0000 (22:58 +0000)]
[Windows] Add a RegisterContextWindows_x64.

With this patch, LLDB can debug x64 executables on Windows with
the same level of functionality as for x86 executables.

llvm-svn: 235935

9 years ago[docs] Fix the link to SanitizerCoverage docs.
Alexey Samsonov [Mon, 27 Apr 2015 22:50:06 +0000 (22:50 +0000)]
[docs] Fix the link to SanitizerCoverage docs.

llvm-svn: 235934

9 years agoUse MemoryBufferRef instead of MemoryBuffer&. NFC.
Rafael Espindola [Mon, 27 Apr 2015 22:48:51 +0000 (22:48 +0000)]
Use MemoryBufferRef instead of MemoryBuffer&. NFC.

This just reduces the noise from another patch.

llvm-svn: 235933

9 years agoclang-tidy: [readability-else-after-return] Fix false positive. This
Daniel Jasper [Mon, 27 Apr 2015 22:42:20 +0000 (22:42 +0000)]
clang-tidy: [readability-else-after-return] Fix false positive. This
might be a little too strict now, but better be too strict than do the
wrong thing.

llvm-svn: 235932

9 years agoCheck whether the operand to a noexcept expression is valid or not. Fixes PR15842.
Aaron Ballman [Mon, 27 Apr 2015 22:31:12 +0000 (22:31 +0000)]
Check whether the operand to a noexcept expression is valid or not. Fixes PR15842.

llvm-svn: 235931

9 years agoremove obsolete pattern matches for scalar SSE ops
Sanjay Patel [Mon, 27 Apr 2015 22:23:17 +0000 (22:23 +0000)]
remove obsolete pattern matches for scalar SSE ops

The blendi pattern should always replace the insertps pattern after:
http://reviews.llvm.org/rL232850
http://reviews.llvm.org/rL235124

llvm-svn: 235930

9 years ago[UBSan] Reenable ASan+UBSan tests on Darwin now that PR21112 is fixed.
Alexey Samsonov [Mon, 27 Apr 2015 22:09:27 +0000 (22:09 +0000)]
[UBSan] Reenable ASan+UBSan tests on Darwin now that PR21112 is fixed.

llvm-svn: 235929

9 years agoIntroduce tsan_cxx and msan_cxx libraries (compiler-rt part).
Alexey Samsonov [Mon, 27 Apr 2015 22:08:09 +0000 (22:08 +0000)]
Introduce tsan_cxx and msan_cxx libraries (compiler-rt part).

For now tsan_cxx and msan_cxx contain only operator new/delete
replacements. In the future, when we add support for running UBSan+TSan
and UBSan+MSan, they will also contain bits ubsan_cxx runtime.

llvm-svn: 235928

9 years ago[TSan] Prepare TSan tests for splitting tsan_cxx library.
Alexey Samsonov [Mon, 27 Apr 2015 22:08:08 +0000 (22:08 +0000)]
[TSan] Prepare TSan tests for splitting tsan_cxx library.

llvm-svn: 235927

9 years ago[MSan] Prepare for splitting msan_new_delete.cc into a separate library. NFC.
Alexey Samsonov [Mon, 27 Apr 2015 22:08:04 +0000 (22:08 +0000)]
[MSan] Prepare for splitting msan_new_delete.cc into a separate library. NFC.

llvm-svn: 235926

9 years agoLTO: Correct some doxygen comments about API availability
Duncan P. N. Exon Smith [Mon, 27 Apr 2015 22:08:01 +0000 (22:08 +0000)]
LTO: Correct some doxygen comments about API availability

These look like copy/paste errors, and shouldn't have the "prior to"
qualifier.  Each API was introduced at the given values of
`LTO_API_VERSION`.  The "prior to" in other doxygen comments is because
I couldn't easily differentiate between versions 1 and 2 when I added
these comments.

llvm-svn: 235925

9 years agoIntroduce tsan_cxx and msan_cxx libraries (Clang part).
Alexey Samsonov [Mon, 27 Apr 2015 22:07:50 +0000 (22:07 +0000)]
Introduce tsan_cxx and msan_cxx libraries (Clang part).

For now tsan_cxx and msan_cxx contain only operator new/delete
replacements. In the future, when we add support for running UBSan+TSan
and UBSan+MSan, they will also contain bits ubsan_cxx runtime.

llvm-svn: 235924

9 years agoUse CIE version 1 for .eh_frame.
Rafael Espindola [Mon, 27 Apr 2015 22:04:24 +0000 (22:04 +0000)]
Use CIE version 1 for .eh_frame.

According to

http://www.linuxbase.org/betaspecs/lsb/LSB-Core-generic/LSB-Core-generic/ehframechpt.html

we should always use 1.

llvm-svn: 235923

9 years ago[AArch64] Also combine vector selects fed by non-i1 SETCCs.
Ahmed Bougacha [Mon, 27 Apr 2015 21:43:12 +0000 (21:43 +0000)]
[AArch64] Also combine vector selects fed by non-i1 SETCCs.

After legalization, scalar SETCC has an i32 result type on AArch64.
The i1 requirement seems too conservative, replace it with an assert.

This also means that we now can run after legalization. That should also
be fine, since the ops legalizer runs again after each combine, and
all types created all have the same sizes as the (legal) inputs.

Exposed by r235917; while there, robustize its tests (bsl also uses the
register it defines).

llvm-svn: 235922

9 years agoPR23334: Perform semantic checking of lambda capture initialization in the right...
Richard Smith [Mon, 27 Apr 2015 21:27:54 +0000 (21:27 +0000)]
PR23334: Perform semantic checking of lambda capture initialization in the right context.

Previously we'd try to perform checks on the captures from the middle of
parsing the lambda's body, at the point where we detected that a variable
needed to be captured. This was wrong in a number of subtle ways. In
PR23334, we couldn't correctly handle the list of potential odr-uses
resulting from the capture, and our attempt to recover from that resulted
in a use-after-free.

We now defer building the initialization expression until we leave the lambda
body and return to the enclosing context, where the initialization does the
right thing. This patch only covers lambda-expressions, but we should apply
the same change to blocks and captured statements too.

llvm-svn: 235921

9 years agoAdd missing library dependency in libPDB.
Pete Cooper [Mon, 27 Apr 2015 21:23:12 +0000 (21:23 +0000)]
Add missing library dependency in libPDB.

PDB uses COFFObjectFile::getPE32Header which lives in libObject.

Make sure that LLVMBuild.txt reflects this dependency.

llvm-svn: 235920

9 years agoRevert "PR21000: pass -I options to assembler" as the test was failing on hexagon.
Artem Belevich [Mon, 27 Apr 2015 21:11:08 +0000 (21:11 +0000)]
Revert "PR21000: pass -I options to assembler" as the test was failing on hexagon.

llvm-svn: 235919

9 years agoAllow building the gold plugin even if the gold binary is not found.
Rafael Espindola [Mon, 27 Apr 2015 21:08:47 +0000 (21:08 +0000)]
Allow building the gold plugin even if the gold binary is not found.

The gold binary is not required to build the plugin. All that is
needed is for LLVM_BINUTILS_INCDIR to point to the directory
containing plugin-api.h.

llvm-svn: 235918

9 years ago[AArch64] Don't assert when combining (v3f32 select (setcc f64)).
Ahmed Bougacha [Mon, 27 Apr 2015 21:01:20 +0000 (21:01 +0000)]
[AArch64] Don't assert when combining (v3f32 select (setcc f64)).

When the setcc has f64 operands, we can't build a vector setcc mask
to feed a vselect, because f64 doesn't divide v3f32 evenly.
Just bail out when that happens.

llvm-svn: 235917

9 years agoXFail flakey test.
Chaoren Lin [Mon, 27 Apr 2015 20:57:24 +0000 (20:57 +0000)]
XFail flakey test.

llvm-svn: 235916

9 years agoPR21000: pass -I options to assembler
Artem Belevich [Mon, 27 Apr 2015 20:51:44 +0000 (20:51 +0000)]
PR21000: pass -I options to assembler

Pass -I options to assembly so it can find files included with
.include.

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

llvm-svn: 235915

9 years agoFixes a hang that can occur if a signal comes in during malloc calls.
Chris Bieneman [Mon, 27 Apr 2015 20:45:35 +0000 (20:45 +0000)]
Fixes a hang that can occur if a signal comes in during malloc calls.

We need to dereference the signals mutex during handler registration so that we force its construction. This is to prevent the first use being during handling an actual signal because you can't safely allocate memory in a signal handler.

llvm-svn: 235914

9 years agoSilence unused variable errors for no-asserts builds
Bill Schmidt [Mon, 27 Apr 2015 20:22:35 +0000 (20:22 +0000)]
Silence unused variable errors for no-asserts builds

llvm-svn: 235913

9 years agoSwitch lowering: order bit tests by branch weight.
Hans Wennborg [Mon, 27 Apr 2015 20:21:17 +0000 (20:21 +0000)]
Switch lowering: order bit tests by branch weight.

llvm-svn: 235912

9 years ago[opaque pointer type] encode the pointee type of global variables
David Blaikie [Mon, 27 Apr 2015 19:58:56 +0000 (19:58 +0000)]
[opaque pointer type] encode the pointee type of global variables

Use a few extra bits in the const field (after widening it from a fixed
single bit) to stash the address space which is no longer provided by
the type (and an extra bit in there to specify that we're using that new
encoding).

llvm-svn: 235911

9 years ago[PPC64LE] Remove unnecessary swaps from lane-insensitive vector computations
Bill Schmidt [Mon, 27 Apr 2015 19:57:34 +0000 (19:57 +0000)]
[PPC64LE] Remove unnecessary swaps from lane-insensitive vector computations

This patch adds a new SSA MI pass that runs on little-endian PPC64
code with VSX enabled. Loads and stores of 4x32 and 2x64 vectors
without alignment constraints are accomplished for little-endian using
lxvd2x/xxswapd and xxswapd/stxvd2x. The existence of the additional
xxswapd instructions hurts performance in comparison with big-endian
code, but they are necessary in the general case to support correct
semantics.

However, the general case does not apply to most vector code. Many
vector instructions are lane-insensitive; they do not "care" which
lanes the parallel computations are performed within, provided that
the resulting data is stored into the correct locations. Thus this
pass looks for computations that perform only lane-insensitive
operations, and remove the unnecessary swaps from loads and stores in
such computations.

Future improvements will allow computations using certain
lane-sensitive operations to also be optimized in this manner, by
modifying the lane-sensitive operations to account for the permuted
order of the lanes. However, this patch only adds the infrastructure
to permit this; no lane-sensitive operations are optimized at this
time.

This code is heavily exercised by the various vectorizing applications
in the projects/test-suite tree. For the time being, I have only added
one simple test case to demonstrate what the pass is doing. Although
it is quite simple, it provides coverage for much of the code,
including the special case handling of copies and subreg-to-reg
operations feeding the swaps. I plan to add additional tests in the
future as I fill in more of the "special handling" code.

Two existing tests were affected, because they expected the swaps to
be present, but they are now removed.

llvm-svn: 235910

9 years ago[llvm-symbolizer] Link DebugInfoPDB for the autoconf build
Zachary Turner [Mon, 27 Apr 2015 19:41:40 +0000 (19:41 +0000)]
[llvm-symbolizer] Link DebugInfoPDB for the autoconf build

llvm-svn: 235909

9 years agoSimplify depfile quoting test.
Paul Robinson [Mon, 27 Apr 2015 19:40:04 +0000 (19:40 +0000)]
Simplify depfile quoting test.

With -MG we don't actually need to create the files with funky names.
Also use a more sensible check-prefix for the NMAKE case.

llvm-svn: 235908

9 years ago[cuda] Ignore "TLS unsupported by target" errors for host variables during device...
Artem Belevich [Mon, 27 Apr 2015 19:37:53 +0000 (19:37 +0000)]
[cuda] Ignore "TLS unsupported by target" errors for host variables during device compilation.

During device-side CUDA compilation clang currently complains about
all TLS variables, regardless of whether they are __host__ or
__device__.

This patch suppresses "TLS unsupported" errors for host variables
during device compilation and for device variables during host
compilation.

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

llvm-svn: 235907

9 years ago[TSan] Move new/delete interceptors into a separate source file. NFC.
Alexey Samsonov [Mon, 27 Apr 2015 19:33:55 +0000 (19:33 +0000)]
[TSan] Move new/delete interceptors into a separate source file. NFC.

llvm-svn: 235906

9 years ago[cuda] treat file scope __asm as __host__ and ignore it during device-side compilation.
Artem Belevich [Mon, 27 Apr 2015 18:52:00 +0000 (18:52 +0000)]
[cuda] treat file scope __asm as __host__ and ignore it during device-side compilation.

Currently clang emits file-scope asm during *both* host and device
compilation modes which is usually a wrong thing to do.

There's no way to attach any attribute to an __asm statement, so
there's no way to differentiate between host-side and device-side
file-scope asm.  This patch makes clang to match nvcc behavior and
emit file-scope-asm only during host-side compilation.

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

llvm-svn: 235905

9 years agolibc++abi: enable LLVM unwinder by default for ARM
Saleem Abdulrasool [Mon, 27 Apr 2015 18:19:33 +0000 (18:19 +0000)]
libc++abi: enable LLVM unwinder by default for ARM

libc++abi uses EHABI extensions, which are only part of the LLVM unwinder.  When
targeting ARM by default, enable the use of the LLVM unwinder.  Hopefully this
will fix the ARM native bot

llvm-svn: 235904

9 years agoSupport generating NMake/Jom-style depfiles.
Paul Robinson [Mon, 27 Apr 2015 18:14:32 +0000 (18:14 +0000)]
Support generating NMake/Jom-style depfiles.

NMake is a Make-like builder that comes with Microsoft Visual Studio.
Jom (https://wiki.qt.io/Jom) is an NMake-compatible build tool.
Dependency files for NMake/Jom need to use double-quotes to wrap
filespecs containing special characters, instead of the backslash
escapes that GNU Make wants.

Adds the -MV option, which specifies to use double-quotes as needed
instead of backslash escapes when writing the dependency file.

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

llvm-svn: 235903