platform/upstream/llvm.git
8 years ago[OpenCL] Pipe builtin functions
Xiuli Pan [Tue, 26 Jan 2016 02:06:04 +0000 (02:06 +0000)]
[OpenCL] Pipe builtin functions

Summary:
Support for the pipe built-in functions for OpenCL 2.0.
The pipe builtin functions may have infinite kinds of element types, one approach
would be to just generate calls that would always use generic types such as void*.
This patch is based on bader's opencl support patch on SPIR-V branch.

Reviewers: Anastasia, pekka.jaaskelainen

Subscribers: keryell, bader, cfe-commits

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

llvm-svn: 258773

8 years agoRevert the test for r258720 temporarily
Ehsan Akhgari [Tue, 26 Jan 2016 01:51:47 +0000 (01:51 +0000)]
Revert the test for r258720 temporarily

This test is failing on a bot for reasons that are unclear to me.
Reverting for now...

llvm-svn: 258772

8 years agoLiveIntervalAnalysis: Improve some comments
Matthias Braun [Tue, 26 Jan 2016 01:40:48 +0000 (01:40 +0000)]
LiveIntervalAnalysis: Improve some comments

As recommended by Justin.

llvm-svn: 258771

8 years ago[Sema] Remove stray semicolons.
David Majnemer [Tue, 26 Jan 2016 01:39:17 +0000 (01:39 +0000)]
[Sema] Remove stray semicolons.

No functional change is intended.

llvm-svn: 258769

8 years ago[Sema] Incomplete types are OK for covariant returns
David Majnemer [Tue, 26 Jan 2016 01:37:01 +0000 (01:37 +0000)]
[Sema] Incomplete types are OK for covariant returns

Per C++14 [class.virtual]p8, it is OK for the return type's class type
to be incomplete so long as the return type is the same between the base
and complete classes.

This fixes PR26297.

llvm-svn: 258768

8 years agoAdd missing template instantiations.
Rui Ueyama [Tue, 26 Jan 2016 01:32:00 +0000 (01:32 +0000)]
Add missing template instantiations.

llvm-svn: 258767

8 years agoFix MSVC build.
Rafael Espindola [Tue, 26 Jan 2016 01:30:07 +0000 (01:30 +0000)]
Fix MSVC build.

llvm-svn: 258766

8 years agoFix TestRerun.py on Windows.
Zachary Turner [Tue, 26 Jan 2016 01:19:50 +0000 (01:19 +0000)]
Fix TestRerun.py on Windows.

This is another example of a test that was looking for the thread
at index 0 instead of requesting the thread that was stopped at
the created breakpoint.  This assumption isn't true on Windows 10.

llvm-svn: 258764

8 years agoFix the lldbinline tests so they make well-formed Makefiles.
Sean Callanan [Tue, 26 Jan 2016 01:15:57 +0000 (01:15 +0000)]
Fix the lldbinline tests so they make well-formed Makefiles.

lldbinline tests previously did not run correctly unless there was already a
Makefile for them.  This was because the syntax of the emitted Makefile made the
default make rule be the "cleanup" rule, which is pretty unhelpful.  Now the
default rule is the one included from Makefile.rules, which is much better.

llvm-svn: 258763

8 years ago[MS Compat] Don't crash if __GetExceptionInfo is in global scope
David Majnemer [Tue, 26 Jan 2016 01:12:17 +0000 (01:12 +0000)]
[MS Compat] Don't crash if __GetExceptionInfo is in global scope

__GetExceptionInfo triggered Sema::LazilyCreateBuiltin which tries to
create a non-templated function decl.  This is unnecessary and
ill-advised, there is no need for us to create a declaration for such a
builtin.

This fixes PR26298.

llvm-svn: 258762

8 years agoRemove XFAIL Windows from a test that was fixed by r258758.
Zachary Turner [Tue, 26 Jan 2016 01:09:38 +0000 (01:09 +0000)]
Remove XFAIL Windows from a test that was fixed by r258758.

llvm-svn: 258761

8 years agoMove code to create RELATIVE reloc for TLS_IE to one place.
Rui Ueyama [Tue, 26 Jan 2016 01:03:21 +0000 (01:03 +0000)]
Move code to create RELATIVE reloc for TLS_IE to one place.

llvm-svn: 258760

8 years agoWrite the session log file in UTF-8.
Zachary Turner [Tue, 26 Jan 2016 00:59:42 +0000 (00:59 +0000)]
Write the session log file in UTF-8.

Previously we were writing in the default encoding, which depends
on the operating system and is not guaranteed to be unicode aware.
On Python 3, this would lead to a situation where writing unicode
text to the log file generates an exception.  The fix here is to
write session logs using the proper encoding, which incidentally
fixes another test, so xfail is removed from that.

llvm-svn: 258759

8 years agoSet symbol types for function symbols loaded from PE/COFF
Adrian McCarthy [Tue, 26 Jan 2016 00:58:09 +0000 (00:58 +0000)]
Set symbol types for function symbols loaded from PE/COFF

This fixes the regression of several tests on Windows after rL258621.

The root problem is that ObjectFilePECOFF was not setting type information for the symbols, and the new CL rejects symbols without type information, breaking functionality like thread step-over.

The fix sets the type information for functions (and creates a TODO for other types).

Along the way, I fixed some typos and formatting that made the code I was debugging harder to understand.

In the long run, we should consider replacing most of ObjectFilePECOFF with the COFF parsing code from LLVM.

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

llvm-svn: 258758

8 years agoSort intrinsics by LLVM intrinsic name, rather than tablegen def name
Reid Kleckner [Tue, 26 Jan 2016 00:55:00 +0000 (00:55 +0000)]
Sort intrinsics by LLVM intrinsic name, rather than tablegen def name

Step one towards using a simple binary search to lookup intrinsic IDs
instead of our crazy table generated switch+memcmp+startswith code that
makes Function.cpp take about a minute to compile.  See PR24785 and
PR11951 for why we should do this.

The X86 backend contains tables that need to be sorted on intrinsic ID,
so reorder those.

llvm-svn: 258757

8 years agoLiveIntervalAnalysis: Cleanup handleMove{Down|Up}() functions, NFC
Matthias Braun [Tue, 26 Jan 2016 00:43:50 +0000 (00:43 +0000)]
LiveIntervalAnalysis: Cleanup handleMove{Down|Up}() functions, NFC

These two functions are hard to reason about. This commit makes the code
more comprehensible:

- Use four distinct variables (OldIdxIn, OldIdxOut, NewIdxIn, NewIdxOut)
  with a fixed value instead of a changing iterator I that points to
  different things during the function.
- Remove the early explanation before the function in favor of more
  detailed comments inside the function. Should have more/clearer comments now
  stating which conditions are tested and which invariants hold at
  different points in the functions.

The behaviour of the code was not changed.

I hope that this will make it easier to review the changes in
http://reviews.llvm.org/D9067 which I will adapt next.

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

llvm-svn: 258756

8 years agoFollowup to 258750; update more tests to use .p2align .
Dan Gohman [Tue, 26 Jan 2016 00:35:07 +0000 (00:35 +0000)]
Followup to 258750; update more tests to use .p2align .

llvm-svn: 258755

8 years agoFollowup to 258750; update all MC tests to use .p2align .
Dan Gohman [Tue, 26 Jan 2016 00:27:59 +0000 (00:27 +0000)]
Followup to 258750; update all MC tests to use .p2align .

llvm-svn: 258754

8 years agoELF: Move code for GNU_IFUNC to one place. NFC.
Rui Ueyama [Tue, 26 Jan 2016 00:24:57 +0000 (00:24 +0000)]
ELF: Move code for GNU_IFUNC to one place. NFC.

This does not solve the problem that we call isGnuIFunc function
both from RelocationSection and from the Writer::scanRelocs, but
this at least should improve readability. I'm taking an incremental
approach to reduce complexity.

llvm-svn: 258753

8 years agoFollowup to 258750; update this test to use .p2align .
Dan Gohman [Tue, 26 Jan 2016 00:17:24 +0000 (00:17 +0000)]
Followup to 258750; update this test to use .p2align .

llvm-svn: 258752

8 years agoFix TestSyntheticCapping for Python 3.
Zachary Turner [Tue, 26 Jan 2016 00:07:09 +0000 (00:07 +0000)]
Fix TestSyntheticCapping for Python 3.

In Python 3, whitespace inconsistences are errors.  This synthetic
provider had mixed tabs and spaces, as well as inconsistent
indentation widths.  This led to the file not being imported,
and naturally the test failing.  No functional change here, just
whitespace.

llvm-svn: 258751

8 years ago[MC] Use .p2align instead of .align
Dan Gohman [Tue, 26 Jan 2016 00:03:25 +0000 (00:03 +0000)]
[MC] Use .p2align instead of .align

For historic reasons, the behavior of .align differs between targets.
Fortunately, there are alternatives, .p2align and .balign, which make the
interpretation of the parameter explicit, and which behave consistently across
targets.

This patch teaches MC to use .p2align instead of .align, so that people reading
code for multiple architectures don't have to remember which way each platform
does its .align directive.

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

llvm-svn: 258750

8 years agoFix use of constexpr std::pair that's not in C++11.
Evgeniy Stepanov [Mon, 25 Jan 2016 23:45:37 +0000 (23:45 +0000)]
Fix use of constexpr std::pair that's not in C++11.

llvm-svn: 258749

8 years agoDefine a helper function to make it visually shorter. NFC.
Rui Ueyama [Mon, 25 Jan 2016 23:38:34 +0000 (23:38 +0000)]
Define a helper function to make it visually shorter. NFC.

llvm-svn: 258748

8 years ago[GVN] Rearrange code to make local vs non-local cases more obvious [NFCI]
Philip Reames [Mon, 25 Jan 2016 23:37:53 +0000 (23:37 +0000)]
[GVN] Rearrange code to make local vs non-local cases more obvious [NFCI]

llvm-svn: 258747

8 years ago[cfi] Cross-DSO CFI diagnostic mode (LLVM part).
Evgeniy Stepanov [Mon, 25 Jan 2016 23:35:03 +0000 (23:35 +0000)]
[cfi] Cross-DSO CFI diagnostic mode (LLVM part).

* __cfi_check gets a 3rd argument: ubsan handler data
* Instead of trapping on failure, call __cfi_check_fail which must be
  present in the module (generated in the frontend).

llvm-svn: 258746

8 years ago[cfi] Cross-DSO CFI diagnostic mode (clang part)
Evgeniy Stepanov [Mon, 25 Jan 2016 23:34:52 +0000 (23:34 +0000)]
[cfi] Cross-DSO CFI diagnostic mode (clang part)

* Runtime diagnostic data for cfi-icall changed to match the rest of
  cfi checks
* Layout of all CFI diagnostic data changed to put Kind at the
  beginning. There is no ABI stability promise yet.
* Call cfi_slowpath_diag instead of cfi_slowpath when needed.
* Emit __cfi_check_fail function, which dispatches a CFI check
  faliure according to trap/recover settings of the current module.
* A tiny driver change to match the way the new handlers are done in
  compiler-rt.

llvm-svn: 258745

8 years ago[cfi] Cross-DSO CFI diagnostic mode (compiler-rt part)
Evgeniy Stepanov [Mon, 25 Jan 2016 23:34:38 +0000 (23:34 +0000)]
[cfi] Cross-DSO CFI diagnostic mode (compiler-rt part)

* add __cfi_slowpath_diag with a 3rd parameter which is a pointer to
  the diagnostic info for the ubsan handlers.
*__cfi_check gets a 3rd parameter as well.
* unify vcall/cast/etc and icall diagnostic info format, and merge
  the handlers to have a single entry point (actually two points due
  to abort/noabort variants).
* tests

Note that this comes with a tiny overhead in the non-diag mode:
cfi_slowpath must pass 0 as the 3rd argument to cfi_check.

llvm-svn: 258744

8 years agoFix some issues with bytes and strings in Python 3.
Zachary Turner [Mon, 25 Jan 2016 23:21:18 +0000 (23:21 +0000)]
Fix some issues with bytes and strings in Python 3.

SBProcess::ReadMemory and other related functions such as
WriteMemory are returning Python string() objects.  This means
that in Python 3 that are returning Unicode objects.  In reality
they should be returning bytes objects which is the same as a string
in Python 2, but different in Python 3.  This patch updates the
generated SWIG code to return Python bytes objects for all
memory related functions.

One quirk of this patch is that the C++ signature of ReadCStringFromMemory
has it writing c-string data into a void*.  This confuses our swig
typemaps which expect that a void* means byte data.  So I hacked up
a custom typemap which maps this specific function to treat the
void* as string data instead of byte data.

llvm-svn: 258743

8 years agoFix more occurrences of string/bytes/bytearray in swig typemaps.
Zachary Turner [Mon, 25 Jan 2016 23:21:13 +0000 (23:21 +0000)]
Fix more occurrences of string/bytes/bytearray in swig typemaps.

llvm-svn: 258742

8 years agoFix swig typemap for SBEvent.
Zachary Turner [Mon, 25 Jan 2016 23:21:09 +0000 (23:21 +0000)]
Fix swig typemap for SBEvent.

This needs to be able to handle bytes, strings, and bytearray objects.
In Python 2 this was easy because bytes and strings are the same thing,
but in Python 3 the 2 cases need to be handled separately.  So as not
to mix raw Python C API code with PythonDataObjects code, I've also
introduced a PythonByteArray class to PythonDataObjects to make the
paradigm used here consistent.

llvm-svn: 258741

8 years ago[GVN] Factor out common code [NFCI]
Philip Reames [Mon, 25 Jan 2016 23:19:12 +0000 (23:19 +0000)]
[GVN] Factor out common code [NFCI]

We had the same code duplicated for each type of Def.  We also have the entire block duplicated between the local and non-local case, but let's start with local cleanup.

llvm-svn: 258740

8 years ago[powerpc] make test case as xfail
Bill Seurer [Mon, 25 Jan 2016 23:03:04 +0000 (23:03 +0000)]
[powerpc] make test case as xfail

This test case which worked for a while is now failing again.  I was unable to
trace the change in status to any particular revision.

llvm-svn: 258739

8 years ago[CUDA] Add -target to cuda-constructor-alias.cu test so it doesn't fail on Mac.
Justin Lebar [Mon, 25 Jan 2016 22:52:31 +0000 (22:52 +0000)]
[CUDA] Add -target to cuda-constructor-alias.cu test so it doesn't fail on Mac.

The test was checking that we passed -mconstructor-alias to host
compilation, but that explicitly shouldn't happen on Mac.

llvm-svn: 258737

8 years ago[docs] Document how to merge patches into release branches
Vedant Kumar [Mon, 25 Jan 2016 22:47:54 +0000 (22:47 +0000)]
[docs] Document how to merge patches into release branches

llvm-svn: 258736

8 years agoUpdate comments to match the implementation.
Manman Ren [Mon, 25 Jan 2016 22:37:47 +0000 (22:37 +0000)]
Update comments to match the implementation.

llvm-svn: 258735

8 years ago[CUDA] Don't generate aliases for static extern "C" functions.
Justin Lebar [Mon, 25 Jan 2016 22:36:37 +0000 (22:36 +0000)]
[CUDA] Don't generate aliases for static extern "C" functions.

Summary:
These aliases are done to support inline asm, but there's nothing we can
do: NVPTX doesn't support aliases.

Reviewers: tra

Subscribers: cfe-commits, jhen, echristo

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

llvm-svn: 258734

8 years ago[CUDA] Disable ctor/dtor aliases in device code.
Justin Lebar [Mon, 25 Jan 2016 22:36:35 +0000 (22:36 +0000)]
[CUDA] Disable ctor/dtor aliases in device code.

Summary: NVPTX doesn't support aliases, so don't generate them.

Reviewers: tra

Subscribers: cfe-commits, jhen, echristo

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

llvm-svn: 258733

8 years ago[PGO] Add a test case covering IR based VP instrumentation
Xinliang David Li [Mon, 25 Jan 2016 22:33:29 +0000 (22:33 +0000)]
[PGO] Add a test case covering IR based VP instrumentation

llvm-svn: 258732

8 years ago[PGO] Add test case covering clang FE based VP instrumentation
Xinliang David Li [Mon, 25 Jan 2016 22:09:30 +0000 (22:09 +0000)]
[PGO] Add test case covering clang FE based VP instrumentation

llvm-svn: 258730

8 years agoX86ISelLowering: Fix cmov(cmov) special lowering bug
Matthias Braun [Mon, 25 Jan 2016 22:08:25 +0000 (22:08 +0000)]
X86ISelLowering: Fix cmov(cmov) special lowering bug

There's a special case in EmitLoweredSelect() that produces an improved
lowering for cmov(cmov) patterns. However this special lowering is
currently broken if the inner cmov has multiple users so this patch
stops using it in this case.

If you wonder why this wasn't fixed by continuing to use the special
lowering and inserting a 2nd PHI for the inner cmov: I believe this
would incur additional copies/register pressure so the special lowering
does not improve upon the normal one anymore in this case.

This fixes http://llvm.org/PR26256 (= rdar://24329747)

llvm-svn: 258729

8 years ago[ThinLTO] Find all needed metadata when linking metadata as postpass
Teresa Johnson [Mon, 25 Jan 2016 22:04:56 +0000 (22:04 +0000)]
[ThinLTO] Find all needed metadata when linking metadata as postpass

For metadata postpass linking, after importing all functions, we need
to recursively walk through any nodes reached via imported functions to
locate needed subprogram metadata. Some might only be reached indirectly
via the variable list for an inlined function.

llvm-svn: 258728

8 years agoMove ObjCPropertyDecl to before ObjCContainerDecl.
Manman Ren [Mon, 25 Jan 2016 21:52:26 +0000 (21:52 +0000)]
Move ObjCPropertyDecl to before ObjCContainerDecl.

After we add ObjCPropertyDecl::isClassProperty, we can use it in
ObjCContainerDecl to define filter to iterate over instance properties
and class properties.

This is the first patch in a series of patches to support class properties
in addition to instance properties in objective-c.

rdar://23891898

llvm-svn: 258727

8 years ago[X86][AVX] Add commutation support for VPERM2X128 instructions
Simon Pilgrim [Mon, 25 Jan 2016 21:51:34 +0000 (21:51 +0000)]
[X86][AVX] Add commutation support for VPERM2X128 instructions

Its main use is to allow memory folding of the 1st operand

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

llvm-svn: 258726

8 years agoUse an ilist instead of std::list. NFC.
Pete Cooper [Mon, 25 Jan 2016 21:50:54 +0000 (21:50 +0000)]
Use an ilist instead of std::list.  NFC.

The TrieNode/TrieEdge data structures here are allocated in a bumpptrallocator.

Unfortunately, TrieNode contained a std::list<TrieEdge> and as the allocator doesn't
call the TrieNode destructor, we ended up leaking the memory allocated by the std::list
itself.

Instead we can use an intrusive list as then we save the extra allocations anyway.

llvm-svn: 258725

8 years agoUse Symtab.find() instead of Symtab.getSymbols().lookup().
Rui Ueyama [Mon, 25 Jan 2016 21:47:25 +0000 (21:47 +0000)]
Use Symtab.find() instead of Symtab.getSymbols().lookup().

This was the only place we directly called lookup on the internal table
of the symbol table.

llvm-svn: 258724

8 years agoAvoid almost duplication in .dynamic finalize and write.
Rafael Espindola [Mon, 25 Jan 2016 21:32:04 +0000 (21:32 +0000)]
Avoid almost duplication in .dynamic finalize and write.

There are a few cases where we have almost duplicated code.

This patches fixes the simplest: the finalize and write of dynamic
section. Right now they have to have exactly the same structure to
decide if a DT_* entry is needed and then to actually write it.

We cannot just write it to a std::vector in the first pass since
addresses have not been computed yet.

llvm-svn: 258723

8 years ago[ThinLTO] Handle DISubprogram reached indirectly from DIImportedEntity
Teresa Johnson [Mon, 25 Jan 2016 21:29:55 +0000 (21:29 +0000)]
[ThinLTO] Handle DISubprogram reached indirectly from DIImportedEntity

Extend fix for PR26037 to identify DISubprogram reached from a
DIImportedEntity via a DILexicalBlock.

llvm-svn: 258722

8 years ago[MSVC Compat] Only warn for unknown clang-cl arguments
Ehsan Akhgari [Mon, 25 Jan 2016 21:14:52 +0000 (21:14 +0000)]
[MSVC Compat] Only warn for unknown clang-cl arguments

Summary:
MSVC's driver accepts all unknown arguments but warns about them.  clang
by default rejects all unknown arguments.  This causes issues
specifically with build systems such as autoconf which liberally pass
things such as $LDFLAGS to the compiler and expect everything to work.
This patch teaches clang-cl to ignore unknown driver arguments.

Reviewers: rnk

Subscribers: cfe-commits

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

llvm-svn: 258720

8 years agoInitialize member variable.
Pete Cooper [Mon, 25 Jan 2016 20:41:48 +0000 (20:41 +0000)]
Initialize member variable.

Found by Rafael using valgrind in https://llvm.org/bugs/show_bug.cgi?id=21466.

llvm-svn: 258718

8 years agosync up InstrProfData.h -- typo fix
Xinliang David Li [Mon, 25 Jan 2016 20:38:40 +0000 (20:38 +0000)]
sync up InstrProfData.h -- typo fix

llvm-svn: 258717

8 years agoFix a typo
Xinliang David Li [Mon, 25 Jan 2016 20:38:13 +0000 (20:38 +0000)]
Fix a typo

llvm-svn: 258716

8 years agoAdd support to the misc-assert-side-effect check for MSVC-style assert macros, which...
Aaron Ballman [Mon, 25 Jan 2016 20:00:53 +0000 (20:00 +0000)]
Add support to the misc-assert-side-effect check for MSVC-style assert macros, which use !! instead of an if statement or a conditional operator.

llvm-svn: 258714

8 years agoRevert "[sanitizers] extracted process management functions"
Mike Aizatsky [Mon, 25 Jan 2016 19:52:25 +0000 (19:52 +0000)]
Revert "[sanitizers] extracted process management functions"

This reverts commit e5b34d5a2bf4c882bc647dd26a8cea2adc76f63c.

llvm-svn: 258713

8 years agoLTO via the gold plugin needs to be told about debugger tuning.
Paul Robinson [Mon, 25 Jan 2016 19:46:40 +0000 (19:46 +0000)]
LTO via the gold plugin needs to be told about debugger tuning.

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

llvm-svn: 258712

8 years agofixed clang-tidy config
Mike Aizatsky [Mon, 25 Jan 2016 19:43:55 +0000 (19:43 +0000)]
fixed clang-tidy config

llvm-svn: 258711

8 years ago[sanitizers] extracted process management functions
Mike Aizatsky [Mon, 25 Jan 2016 19:43:52 +0000 (19:43 +0000)]
[sanitizers] extracted process management functions

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

llvm-svn: 258710

8 years agoEnable loopreroll to rerool loop with pointer induction variable.
Lawrence Hu [Mon, 25 Jan 2016 19:43:45 +0000 (19:43 +0000)]
Enable loopreroll to rerool loop with pointer induction variable.

Example:

while (buf !=end ) {
   S += buf[0];
   S += buf[1];
   buf +=2;
};

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

llvm-svn: 258709

8 years ago Undo commit 258700 due to missing commit message
Lawrence Hu [Mon, 25 Jan 2016 19:36:30 +0000 (19:36 +0000)]
 Undo commit 258700 due to missing commit message

llvm-svn: 258708

8 years agoFix: added assert condition to EhFrameHeader<ELFT>::assignEhFrame().
George Rimar [Mon, 25 Jan 2016 19:27:50 +0000 (19:27 +0000)]
Fix: added assert condition to EhFrameHeader<ELFT>::assignEhFrame().
Thanks to David Blaikie who found that issue.

llvm-svn: 258707

8 years ago[asan] Don't use sysconf(_SC_PAGESIZE) on Android.
Evgeniy Stepanov [Mon, 25 Jan 2016 19:25:20 +0000 (19:25 +0000)]
[asan] Don't use sysconf(_SC_PAGESIZE) on Android.

This is broken in the current (post-MNC) master branch.
Use EXEC_PAGESIZE instead, the same as on x86 Linux.

This change fixes startup crashes in the existing tests on AOSP
master.

llvm-svn: 258706

8 years agoReapply commit r25804 with fix
Matthew Simpson [Mon, 25 Jan 2016 19:24:29 +0000 (19:24 +0000)]
Reapply commit r25804 with fix

We were hitting an assertion because we were computing smaller type sizes for
instructions that cannot be demoted. The fix first determines the instructions
that will be demoted, and then applies the smaller type size to only those
instructions.

This should fix PR26239.

llvm-svn: 258705

8 years agoFix TestSourceManager.py on Windows.
Adrian McCarthy [Mon, 25 Jan 2016 19:13:35 +0000 (19:13 +0000)]
Fix TestSourceManager.py on Windows.

Python 3.5 is picky about writing strings to binary files, so we now open the
file in text mode, and we explicitly set the newline mode to avoid re-writing
it with CR+LF on Windows (which causes git to think the file had changed).

llvm-svn: 258704

8 years agoSpeculatively revert r258620 as it is the likely culprid of PR26293.
Quentin Colombet [Mon, 25 Jan 2016 19:12:49 +0000 (19:12 +0000)]
Speculatively revert r258620 as it is the likely culprid of PR26293.

llvm-svn: 258703

8 years agoTemporary disable broken fuzzer/timeout tests.
Ivan Krasin [Mon, 25 Jan 2016 19:05:45 +0000 (19:05 +0000)]
Temporary disable broken fuzzer/timeout tests.

Reviewers: kcc

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

llvm-svn: 258702

8 years agoAdd a test showing we can write a vector of floats.
Rafael Espindola [Mon, 25 Jan 2016 19:02:20 +0000 (19:02 +0000)]
Add a test showing we can write a vector of floats.

llvm-svn: 258701

8 years agoDifferential Revision: http://reviews.llvm.org/D13151
Lawrence Hu [Mon, 25 Jan 2016 18:53:39 +0000 (18:53 +0000)]
Differential Revision: reviews.llvm.org/D13151

llvm-svn: 258700

8 years agodon't repeat function names in documentation comments; NFC
Sanjay Patel [Mon, 25 Jan 2016 18:38:38 +0000 (18:38 +0000)]
don't repeat function names in documentation comments; NFC

llvm-svn: 258699

8 years agoPass --wrap=pthread_create to linker for -fsplit-stack.
Rafael Espindola [Mon, 25 Jan 2016 18:29:16 +0000 (18:29 +0000)]
Pass --wrap=pthread_create to linker for -fsplit-stack.

From

https://gcc.gnu.org/ml/gcc-patches/2010-09/msg01807.html

-fsplit-stack should pass --wrap=pthread_create to linker for -fsplit-stack
It is needed to initialize the stack guard.  This fixes PR 20148.

Patch by H.J Lu!

llvm-svn: 258698

8 years agoImplement LWG#2385; remove the allocator-aware std::function::assign call. It was...
Marshall Clow [Mon, 25 Jan 2016 17:29:55 +0000 (17:29 +0000)]
Implement LWG#2385; remove the allocator-aware std::function::assign call. It was useless, and didn't actually *do anything* with the allocator. Now it's gone.  On the off chance that someone is mistakenly calling it, it's only gone in C++1z

llvm-svn: 258697

8 years agoomp_barrier.c test fixed in order to reliably and faster run on any number of processors
Andrey Churbanov [Mon, 25 Jan 2016 16:52:10 +0000 (16:52 +0000)]
omp_barrier.c test fixed in order to reliably and faster run on any number of processors

llvm-svn: 258695

8 years ago[WebAssembly] Fix unbalanced register stack code in the case of late DCE.
Dan Gohman [Mon, 25 Jan 2016 16:48:44 +0000 (16:48 +0000)]
[WebAssembly] Fix unbalanced register stack code in the case of late DCE.

Instructions can be DCE'd after the RegStackify pass. If the instruction which
would be the pop for what would be a push is removed, don't use a push.

llvm-svn: 258694

8 years ago[WebAssembly] Add tests for negative offsets with global variable addresses.
Dan Gohman [Mon, 25 Jan 2016 15:19:39 +0000 (15:19 +0000)]
[WebAssembly] Add tests for negative offsets with global variable addresses.

llvm-svn: 258693

8 years ago[WebAssembly] Minor code formatting cleanups. NFC.
Dan Gohman [Mon, 25 Jan 2016 15:12:05 +0000 (15:12 +0000)]
[WebAssembly] Minor code formatting cleanups. NFC.

llvm-svn: 258692

8 years ago[SelectionDAG] Use the correct return type for memcpy, memmove, and memset.
Dan Gohman [Mon, 25 Jan 2016 15:05:56 +0000 (15:05 +0000)]
[SelectionDAG] Use the correct return type for memcpy, memmove, and memset.

When generating calls to memcpy, memmove, and memset, use void* as the return
type rather than void, to match the standard signatures for these functions.

This has no practical effect for most targets, since the return values of
these calls aren't being used anyway, and most calling conventions tolerate
this kind of mismatch. However, this change will help support future
optimizations to utilize the return value to avoid holding the argument
value live across a call.

llvm-svn: 258691

8 years ago[DemandedBits] Fix computation of demanded bits for ICmps
James Molloy [Mon, 25 Jan 2016 14:49:36 +0000 (14:49 +0000)]
[DemandedBits] Fix computation of demanded bits for ICmps

The computation of ICmp demanded bits is independent of the individual operand being evaluated. We simply return a mask consisting of the minimum leading zeroes of both operands.

We were incorrectly passing "I" to ComputeKnownBits - this should be "UserI->getOperand(0)". In cases where we were evaluating the 1th operand, we were taking the minimum leading zeroes of it and itself.

This should fix PR26266.

llvm-svn: 258690

8 years ago[AVX512] Adding PTESTNMB/D/W/Q instruction
Michael Zuckerman [Mon, 25 Jan 2016 14:43:23 +0000 (14:43 +0000)]
[AVX512] Adding PTESTNMB/D/W/Q instruction

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

llvm-svn: 258688

8 years agoReapplying r256836 with a fix for MSVC 14 support.
Aaron Ballman [Mon, 25 Jan 2016 14:17:39 +0000 (14:17 +0000)]
Reapplying r256836 with a fix for MSVC 14 support.

Enable more strict standards conformance in MSVC for rvalue casting and string literal type conversion to non-const types. Also enables generation of intrinsics for more functions.

Patch by Alexander Riccio

llvm-svn: 258687

8 years ago[AVX512] Adding PTESTMB/W/D/Q instruction
Michael Zuckerman [Mon, 25 Jan 2016 13:27:32 +0000 (13:27 +0000)]
[AVX512] Adding PTESTMB/W/D/Q instruction

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

llvm-svn: 258686

8 years ago[LLDB][MIPS] Fix TestPrintStackTraces.py
Sagar Thakur [Mon, 25 Jan 2016 12:33:03 +0000 (12:33 +0000)]
[LLDB][MIPS] Fix TestPrintStackTraces.py

Patch by Nitesh Jain.

Summary: The thread_start function in libc doesn't contain any epilogue and prologue instructions. Hence unwinding fail when we are stopped in thread_start.

Reviewers: ovyalov, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: reviews.llvm.org/D16136
llvm-svn: 258685

8 years ago[LLDB][MIPS] Fix TestExprsChar.py
Sagar Thakur [Mon, 25 Jan 2016 12:27:46 +0000 (12:27 +0000)]
[LLDB][MIPS] Fix TestExprsChar.py

Patch by Nitesh Jain.

Summary: When incorrect type used for 'char' then (at least) one of the expression evaluates to incorrect value. Please refer to bug llvm.org/pr23069

Reviewers: ovyalov, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: reviews.llvm.org/D16132
llvm-svn: 258684

8 years ago[ARM] Add DSP build attribute and extension targeting
Bradley Smith [Mon, 25 Jan 2016 11:26:11 +0000 (11:26 +0000)]
[ARM] Add DSP build attribute and extension targeting

This patch was originally committed as r257885, but was reverted due to windows
failures. The cause of these failures has been fixed under r258677, hence
re-committing the original patch.

llvm-svn: 258683

8 years ago[ARM] Add new system registers to ARMv8-M Baseline/Mainline
Bradley Smith [Mon, 25 Jan 2016 11:25:36 +0000 (11:25 +0000)]
[ARM] Add new system registers to ARMv8-M Baseline/Mainline

This patch was originally committed as r257884, but was reverted due to windows
failures. The cause of these failures has been fixed under r258677, hence
re-committing the original patch.

llvm-svn: 258682

8 years ago[ARM] Add ARMv8-M security extension instructions to ARMv8-M Baseline/Mainline
Bradley Smith [Mon, 25 Jan 2016 11:24:47 +0000 (11:24 +0000)]
[ARM] Add ARMv8-M security extension instructions to ARMv8-M Baseline/Mainline

This patch was originally committed as r257883, but was reverted due to windows
failures. The cause of these failures has been fixed under r258677, hence
re-committing the original patch.

llvm-svn: 258681

8 years ago[X86][IFMA] adding intrinsics and encoding for multiply and add of unsigned 52bit...
Asaf Badouh [Mon, 25 Jan 2016 11:14:24 +0000 (11:14 +0000)]
[X86][IFMA] adding intrinsics and encoding for multiply and add of unsigned 52bit integer

VPMADD52LUQ - Packed Multiply of Unsigned 52-bit Integers and Add the Low 52-bit Products to Qword Accumulators
 VPMADD52HUQ - Packed Multiply of Unsigned 52-bit Unsigned Integers and Add High 52-bit Products to 64-bit Accumulators

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

llvm-svn: 258680

8 years agoFix printing of types in initializers with suppressed tags.
Benjamin Kramer [Mon, 25 Jan 2016 10:34:06 +0000 (10:34 +0000)]
Fix printing of types in initializers with suppressed tags.

Tag and specifier printing can be suppressed in Decl::printGroup, but these suppressions leak into the initializers. Thus
    int *x = ((void *)0), *y = ((void *)0);
gets printed as
    int *x = ((void *)0), *y = ((*)0);
And
    struct { struct Z z; } z = {(struct Z){}};
gets printed as
    struct { struct Z z; } z = {(){}};
The stops the suppressions from leaking into the initializers.

Patch by Nick Sumner!

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

llvm-svn: 258679

8 years ago[ARM] Add ARMv8.2-A FP16 scalar instructions
Oliver Stannard [Mon, 25 Jan 2016 10:26:26 +0000 (10:26 +0000)]
[ARM] Add ARMv8.2-A FP16 scalar instructions

This was originally committed as r255762, but reverted as it broke windows
bots. Re-commitiing the exact same patch, as the underlying cause was fixed by
r258677.

ARMv8.2-A adds 16-bit floating point versions of all existing VFP
floating-point instructions. This is an optional extension, so all of
these instructions require the FeatureFullFP16 subtarget feature.

The assembly for these instructions uses S registers (AArch32 does not
have H registers), but the instructions have ".f16" type specifiers
rather than ".f32" or ".f64". The top 16 bits of each source register
are ignored, and the top 16 bits of the destination register are set to
zero.

These instructions are mostly the same as the 32- and 64-bit versions,
but they use coprocessor 9 rather than 10 and 11.

Two new instructions, VMOVX and VINS, have been added to allow packing
and extracting two 16-bit floats stored in the top and bottom halves of
an S register.

New fixup kinds have been added for the PC-relative load and store
instructions, but no ELF relocations have been added as they have a
range of 512 bytes.

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

llvm-svn: 258678

8 years ago[TableGen] Fix sort order of asm operand classes
Oliver Stannard [Mon, 25 Jan 2016 10:20:19 +0000 (10:20 +0000)]
[TableGen] Fix sort order of asm operand classes

This is a fix for https://llvm.org/bugs/show_bug.cgi?id=22796.

The previous implementation of ClassInfo::operator< allowed cycles of classes
such that x < y < z < x, meaning that a list of them cannot be correctly
sorted, and the sort order could differ with different standard libraries.

The original implementation sorted classes by ValueName if they were otherwise
equal. This isn't strictly necessary, but some backends seem to accidentally
rely on it. If I reverse this comparison I get 8 test failures spread across
the AArch64, Mips and X86 backends, so I have left it in until those backends
can be fixed.

There was one case in the X86 backend where the observable behaviour of the
assembler is changed by this patch. This was because some of the memory asm
operands were not marked as children of X86MemAsmOperand.

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

llvm-svn: 258677

8 years agoSilence a -Wparentheses warning; NFC.
Junmo Park [Mon, 25 Jan 2016 10:17:17 +0000 (10:17 +0000)]
Silence a -Wparentheses warning; NFC.

llvm-svn: 258676

8 years agoAVX1 : Enable vector masked_load/store to AVX1.
Igor Breger [Mon, 25 Jan 2016 10:17:11 +0000 (10:17 +0000)]
AVX1 : Enable vector masked_load/store to AVX1.
Use AVX1 FP instructions (vmaskmovps/pd) in place of the AVX2 int instructions (vpmaskmovd/q).

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

llvm-svn: 258675

8 years ago[Sema] Improve constness
Daniel Marjamaki [Mon, 25 Jan 2016 09:29:38 +0000 (09:29 +0000)]
[Sema] Improve constness

llvm-svn: 258673

8 years ago[ELF] - Symbols from object files that override symbols in DSO are added to .dynsym...
George Rimar [Mon, 25 Jan 2016 08:44:38 +0000 (08:44 +0000)]
[ELF] - Symbols from object files that override symbols in DSO are added to .dynsym table.

Main executable did not export symbols that exist both in the main executable and in DSOs before this patch.
Symbols from object files that override symbols in DSO should be added to .dynsym table.

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

llvm-svn: 258672

8 years ago[AVX512] [CMPPS ][ CMPPD ] Adding full Comparison Predicate names
Michael Zuckerman [Mon, 25 Jan 2016 08:43:26 +0000 (08:43 +0000)]
[AVX512] [CMPPS ][ CMPPD ] Adding full Comparison Predicate names

X86AsmParser.cpp is missing full comparison predicate names for CMPPD and CMPPS Instructions.
X86AsmParser.cpp defines only the short names of the Comparison predicate that you can find in the following pdf:
https://software.intel.com/sites/default/files/managed/07/b7/319433-023.pdf
Page 5-61 table 5-3

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

llvm-svn: 258671

8 years agoUse of assert instead of llvm_unreachable in EhFrameHeader<ELFT>::assignEhFrame().
George Rimar [Mon, 25 Jan 2016 08:20:16 +0000 (08:20 +0000)]
Use of assert instead of llvm_unreachable in EhFrameHeader<ELFT>::assignEhFrame().

llvm-svn: 258670

8 years agoAllow capture typedefs/type aliases for VLAs in lambdas/captured statements chain.
Alexey Bataev [Mon, 25 Jan 2016 07:06:23 +0000 (07:06 +0000)]
Allow capture typedefs/type aliases for VLAs in lambdas/captured statements chain.
Previous it was allowed to capture VLAs/types with arrays of runtime bounds only inside the first lambda/capture statement in stack. Patch allows to capture these typedefs implicitly in chains of lambdas/captured statements.

llvm-svn: 258669

8 years agoFixed processing of GNU extensions to C99 designated initializers
Alexey Bataev [Mon, 25 Jan 2016 05:14:03 +0000 (05:14 +0000)]
Fixed processing of GNU extensions to C99 designated initializers
Clang did not handles correctly inner parts of arrays/structures initializers in GNU extensions to C99 designated initializers.

llvm-svn: 258668

8 years ago[llvm-size] Use stderr instead of stdout for error messages.
Davide Italiano [Mon, 25 Jan 2016 01:24:15 +0000 (01:24 +0000)]
[llvm-size] Use stderr instead of stdout for error messages.

This matches the behavior of other tools: objdump, readobj etc..

llvm-svn: 258667

8 years ago[Object][COFF] Revert r258665 - It doesn't do what I had intended.
Lang Hames [Mon, 25 Jan 2016 01:21:45 +0000 (01:21 +0000)]
[Object][COFF] Revert r258665 - It doesn't do what I had intended.

I'm discussing the right approach for tracking visibility for COFF symbols on
the llvm-dev list.

llvm-svn: 258666

8 years ago[Object][COFF] Set the generic SF_Exported flag on COFF exported symbols.
Lang Hames [Sun, 24 Jan 2016 21:56:40 +0000 (21:56 +0000)]
[Object][COFF] Set the generic SF_Exported flag on COFF exported symbols.

The ORC ObjectLinkingLayer uses this flag during symbol lookup. Failure to set
it causes all symbols to behave as if they were non-exported, which has caused
failures in the kaleidoscope tutorials on Windows. Raising the flag should
un-break the tutorials.

No test case yet - none of the existing command line tools for printing symbol
tables (llvm-nm, llvm-objdump) show the status of this flag, and I don't want to
change the format from these tools without consulting their owners. I'll send an
email to the dev-list to figure out the right way forward.

llvm-svn: 258665

8 years ago[COFF] Simplify SetSectionName
David Majnemer [Sun, 24 Jan 2016 20:46:11 +0000 (20:46 +0000)]
[COFF] Simplify SetSectionName

Consolidate the code which handles string table offsets less than 999999
with the code for offsets less than 9999999.  While we are here,
simplify the code by not using sprintf to generate the string.

llvm-svn: 258664