platform/upstream/llvm.git
7 years ago[libFuzzer] move common parts of shell scripts into a separate file
Kostya Serebryany [Fri, 30 Sep 2016 21:12:30 +0000 (21:12 +0000)]
[libFuzzer] move common parts of shell scripts into a separate file

llvm-svn: 282954

7 years ago[libfuzzer] sancov documentation update
Mike Aizatsky [Fri, 30 Sep 2016 21:07:04 +0000 (21:07 +0000)]
[libfuzzer] sancov documentation update

llvm-svn: 282953

7 years agoNFC Add const
Piotr Padlewski [Fri, 30 Sep 2016 21:05:55 +0000 (21:05 +0000)]
NFC Add const

llvm-svn: 282952

7 years agoNFC fix class members initialization
Piotr Padlewski [Fri, 30 Sep 2016 21:05:52 +0000 (21:05 +0000)]
NFC fix class members initialization

llvm-svn: 282951

7 years agoNFC fix doxygen comments
Piotr Padlewski [Fri, 30 Sep 2016 21:05:49 +0000 (21:05 +0000)]
NFC fix doxygen comments

llvm-svn: 282950

7 years agoAdd missing std::move in Replacements::add
Alexander Shaposhnikov [Fri, 30 Sep 2016 21:05:45 +0000 (21:05 +0000)]
Add missing std::move in Replacements::add

This diff adds std::move to avoid copying of
the Replacement NewR in the method Replacements::add.

Test plan: make -j8 check-all

Differential revision: https://reviews.llvm.org/D25049

llvm-svn: 282949

7 years ago[sancov] -symbolize documentation update
Mike Aizatsky [Fri, 30 Sep 2016 21:02:56 +0000 (21:02 +0000)]
[sancov] -symbolize documentation update

llvm-svn: 282948

7 years agoInsert missing checks for KMP_AFFINITY_CAPABLE() in affinity API.
Jonathan Peyton [Fri, 30 Sep 2016 20:56:44 +0000 (20:56 +0000)]
Insert missing checks for KMP_AFFINITY_CAPABLE() in affinity API.

If affinity is not capable, then these API functions will perform the stubs
version.

llvm-svn: 282947

7 years agoChange for LLVM upstream change r282944.
Rui Ueyama [Fri, 30 Sep 2016 20:53:45 +0000 (20:53 +0000)]
Change for LLVM upstream change r282944.

llvm-svn: 282945

7 years agoDo not pass a superblock to PDBFileBuilder.
Rui Ueyama [Fri, 30 Sep 2016 20:52:12 +0000 (20:52 +0000)]
Do not pass a superblock to PDBFileBuilder.

When we create a PDB file using PDBFileBuilder, the information
in the superblock, such as the size of the resulting file, is not
available.

Previously, PDBFileBuilder::initialize took a superblock assuming
that all the members of the struct are correct. That is useful when
you want to restore the exact information from a YAML file, but
that's probably the only use case in which that is useful.
When we are creating a PDB file on the fly, we have to backfill the
members.

This patch redefines PDBFileBuilder::initialize to take only a
block size. Now all the other members are left as default values,
so that they'll be updated when commit() is called.

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

llvm-svn: 282944

7 years agoAdding ivars in class extensions isn't supported on i386; skip a test.
Sean Callanan [Fri, 30 Sep 2016 20:46:09 +0000 (20:46 +0000)]
Adding ivars in class extensions isn't supported on i386; skip a test.

llvm-svn: 282943

7 years agoChange for LLVM change r282940.
Rui Ueyama [Fri, 30 Sep 2016 20:39:04 +0000 (20:39 +0000)]
Change for LLVM change r282940.

llvm-svn: 282942

7 years agoFix comment - Module::PrepareForFunctionNameLookup should be Module::LookupInfo:...
Dawn Perchik [Fri, 30 Sep 2016 20:38:33 +0000 (20:38 +0000)]
Fix comment - Module::PrepareForFunctionNameLookup should be Module::LookupInfo::LookupInfo.

llvm-svn: 282941

7 years agoPass a filename instead of a msf::WritableStream to PDBFileBuilder::commit.
Rui Ueyama [Fri, 30 Sep 2016 20:34:44 +0000 (20:34 +0000)]
Pass a filename instead of a msf::WritableStream to PDBFileBuilder::commit.

WritableStream needs the exact file size to open a file, but
until we fix the final layout of a PDB file, we don't know the
size of the file.

This patch changes the parameter type of PDBFileBuilder::commit
to solve that chiecken-and-egg problem. Now the function opens
a file after fixing the layout, so it can create a file with the
exact size.

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

llvm-svn: 282940

7 years agoSort LLVM_VERSION_INFO
Joerg Sonnenberger [Fri, 30 Sep 2016 20:34:02 +0000 (20:34 +0000)]
Sort LLVM_VERSION_INFO

llvm-svn: 282939

7 years agoGC left-over from workarounds for missing pid_t and size_t
Joerg Sonnenberger [Fri, 30 Sep 2016 20:32:42 +0000 (20:32 +0000)]
GC left-over from workarounds for missing pid_t and size_t

llvm-svn: 282938

7 years agoGC ENABLE_PIC
Joerg Sonnenberger [Fri, 30 Sep 2016 20:30:25 +0000 (20:30 +0000)]
GC ENABLE_PIC

llvm-svn: 282936

7 years agoGC HAVE___DSO_HANDLE
Joerg Sonnenberger [Fri, 30 Sep 2016 20:29:19 +0000 (20:29 +0000)]
GC HAVE___DSO_HANDLE

llvm-svn: 282935

7 years agoCorrectly expand HOST_LINK_VERSION.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:28:42 +0000 (20:28 +0000)]
Correctly expand HOST_LINK_VERSION.

llvm-svn: 282934

7 years agoFix expansion of HAVE_SYS_MMAN_H
Joerg Sonnenberger [Fri, 30 Sep 2016 20:27:41 +0000 (20:27 +0000)]
Fix expansion of HAVE_SYS_MMAN_H

llvm-svn: 282933

7 years agoGC HAVE_LINK_EXPORT_DYNAMIC.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:26:31 +0000 (20:26 +0000)]
GC HAVE_LINK_EXPORT_DYNAMIC.

llvm-svn: 282932

7 years agoGC HAVE_MMAP and HAVE_MMAP_FILE
Joerg Sonnenberger [Fri, 30 Sep 2016 20:24:54 +0000 (20:24 +0000)]
GC HAVE_MMAP and HAVE_MMAP_FILE

llvm-svn: 282931

7 years agoSpell comment consistently with other library comments.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:24:21 +0000 (20:24 +0000)]
Spell comment consistently with other library comments.

llvm-svn: 282930

7 years agoSort LINK_POLLY_INTO_TOOLS.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:21:35 +0000 (20:21 +0000)]
Sort LINK_POLLY_INTO_TOOLS.

llvm-svn: 282929

7 years agoGC STDC_HEADERS.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:19:02 +0000 (20:19 +0000)]
GC STDC_HEADERS.

llvm-svn: 282928

7 years ago[CUDA] Fix implicit-device-lambda.cu after r282911.
Justin Lebar [Fri, 30 Sep 2016 20:17:37 +0000 (20:17 +0000)]
[CUDA] Fix implicit-device-lambda.cu after r282911.

This commit added a warning that we're (correctly) hitting in this test.
Just ignore it.

llvm-svn: 282927

7 years agoRemoved a test that should've been removed with r282916.
Rui Ueyama [Fri, 30 Sep 2016 20:17:26 +0000 (20:17 +0000)]
Removed a test that should've been removed with r282916.

llvm-svn: 282926

7 years agoDeal with the (historic) MAP_ANONYMOUS vs MAP_ANON directly by using CPP
Joerg Sonnenberger [Fri, 30 Sep 2016 20:17:23 +0000 (20:17 +0000)]
Deal with the (historic) MAP_ANONYMOUS vs MAP_ANON directly by using CPP
to check for the former, don't depend on (dangling) HAVE_MMAP_ANONYMOUS.

llvm-svn: 282925

7 years agoRetire NEED_DEV_ZERO_FOR_MMAP. It should be needed only on outdated
Joerg Sonnenberger [Fri, 30 Sep 2016 20:16:01 +0000 (20:16 +0000)]
Retire NEED_DEV_ZERO_FOR_MMAP. It should be needed only on outdated
systems. It wasn't even hooked up in cmake, so problems on such systems
would be visible with 3.9 release already.

llvm-svn: 282924

7 years agoHAVE_LINK_R is not the only reason why this needs config.h.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:11:21 +0000 (20:11 +0000)]
HAVE_LINK_R is not the only reason why this needs config.h.

llvm-svn: 282923

7 years agoGC HAVE_LIBDL, HAVE_LIBM and HAVE_LIBOLE32
Joerg Sonnenberger [Fri, 30 Sep 2016 20:09:45 +0000 (20:09 +0000)]
GC HAVE_LIBDL, HAVE_LIBM and HAVE_LIBOLE32

llvm-svn: 282922

7 years agoSort HAVE_LIBEDIT.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:08:36 +0000 (20:08 +0000)]
Sort HAVE_LIBEDIT.

llvm-svn: 282921

7 years agoX86: Allow conditional tail calls in Win64 "leaf" functions (PR26302)
Hans Wennborg [Fri, 30 Sep 2016 20:07:35 +0000 (20:07 +0000)]
X86: Allow conditional tail calls in Win64 "leaf" functions (PR26302)

We can't use Jcc to leave a Win64 function in general, because that
confuses the unwinder. However, for "leaf" functions, that is, functions
where the return address is always on top of the stack and which don't
have unwind info, it's OK.

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

llvm-svn: 282920

7 years agoTurn ENABLE_CRASH_OVERRIDES into a 0/1 definition.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:06:19 +0000 (20:06 +0000)]
Turn ENABLE_CRASH_OVERRIDES into a 0/1 definition.

llvm-svn: 282919

7 years agoConvert ENABLE_BACKTRACES into a 0/1 definition.
Joerg Sonnenberger [Fri, 30 Sep 2016 20:04:24 +0000 (20:04 +0000)]
Convert ENABLE_BACKTRACES into a 0/1 definition.

llvm-svn: 282918

7 years agoGC TIME_WITH_SYS_TIME and TM_IN_SYS_TIME
Joerg Sonnenberger [Fri, 30 Sep 2016 19:59:58 +0000 (19:59 +0000)]
GC TIME_WITH_SYS_TIME and TM_IN_SYS_TIME

llvm-svn: 282917

7 years agoRemove an warning message that can be spammy.
Rui Ueyama [Fri, 30 Sep 2016 19:59:25 +0000 (19:59 +0000)]
Remove an warning message that can be spammy.

This was intended to warn on a usage error of an ar command.
I was thinking that false positive would be rare because it
has two guards: it warns only when an archive file has no symbols
and contains at least one file.

Turned out that false positive would probably be not that rare.
You wouldn't intentionally create an object file that contains no
exported symbols, but with conditional compile guards, you could
create such file. If it is for a LTO build, you could create an
archive file containing such file. That means there's no way to
detect the usage error in a reliable manner.

This patch simply removes the warning.

llvm-svn: 282916

7 years agoGC STAT_MACROS_BROKEN.
Joerg Sonnenberger [Fri, 30 Sep 2016 19:58:44 +0000 (19:58 +0000)]
GC STAT_MACROS_BROKEN.

llvm-svn: 282915

7 years agoGC NEED_USCORE.
Joerg Sonnenberger [Fri, 30 Sep 2016 19:57:54 +0000 (19:57 +0000)]
GC NEED_USCORE.

llvm-svn: 282914

7 years ago[scudo] Fix an edge case in the secondary allocator
Kostya Kortchinsky [Fri, 30 Sep 2016 19:57:21 +0000 (19:57 +0000)]
[scudo] Fix an edge case in the secondary allocator

Summary:
s/CHECK_LT/CHECK_LE/ in the secondary allocator, as under certain circumstances
Ptr + Size can be equal to MapEnd. This edge case was not found by the current
tests, so those were extended to be able to catch that.

Reviewers: kcc

Subscribers: llvm-commits

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

llvm-svn: 282913

7 years ago[CUDA] Remove incorrect comment in CUDASetLambdaAttrs.
Justin Lebar [Fri, 30 Sep 2016 19:55:59 +0000 (19:55 +0000)]
[CUDA] Remove incorrect comment in CUDASetLambdaAttrs.

I'd said that nvcc doesn't allow you to add __host__ or __device__
attributes on lambdas in all circumstances, but I believe this was user
error on my part.  I can't reproduce these warnings/errors if I pass
--expt-extended-lambda to nvcc.

llvm-svn: 282912

7 years ago[CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(....
Justin Lebar [Fri, 30 Sep 2016 19:55:55 +0000 (19:55 +0000)]
[CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

Summary:
This is probably the sane place for the attribute to go, but nvcc
specifically rejects it.  Other GNU-style attributes are allowed in this
position (although judging from the warning it emits for
host/device/global, those attributes are applied to the lambda's
anonymous struct, not to the function itself).

It would be nice to have a FixIt message here, but doing so, or even
just getting the correct range for the attribute, including its '((' and
'))'s, is apparently Hard.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

llvm-svn: 282911

7 years ago[CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA...
Justin Lebar [Fri, 30 Sep 2016 19:55:48 +0000 (19:55 +0000)]
[CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.

Summary: There's an overload that we can use to make this a bit cleaner.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

llvm-svn: 282910

7 years agoTurn LLVM_USE_OPROFILE into a 0/1 definition.
Joerg Sonnenberger [Fri, 30 Sep 2016 19:55:37 +0000 (19:55 +0000)]
Turn LLVM_USE_OPROFILE into a 0/1 definition.

llvm-svn: 282909

7 years agoTurn LLVM_USE_INTEL_JITEVENTS into a 0/1 definition.
Joerg Sonnenberger [Fri, 30 Sep 2016 19:54:25 +0000 (19:54 +0000)]
Turn LLVM_USE_INTEL_JITEVENTS into a 0/1 definition.

llvm-svn: 282908

7 years agoTurn LLVM_ENABLE_ABI_BREAKING_CHECKS into a 0/1 definition like
Joerg Sonnenberger [Fri, 30 Sep 2016 19:52:27 +0000 (19:52 +0000)]
Turn LLVM_ENABLE_ABI_BREAKING_CHECKS into a 0/1 definition like
LLVM_ENABLE_THREADS. Include llvm-config.h explicitly in headers to make
sure that the definition is available.

llvm-svn: 282907

7 years ago[InstCombine] allow non-splat folds of select cond (ext X), C
Sanjay Patel [Fri, 30 Sep 2016 19:49:22 +0000 (19:49 +0000)]
[InstCombine] allow non-splat folds of select cond (ext X), C

llvm-svn: 282906

7 years ago[compiler-rt] Fix interception of crt atoll on win10 CRT.
Etienne Bergeron [Fri, 30 Sep 2016 19:37:11 +0000 (19:37 +0000)]
[compiler-rt] Fix interception of crt atoll on win10 CRT.

Summary:
The check-asan-dynamic tests were broken on win10 because the interception
library was not able to hook on some functions.

credits: thanks sebastian marchand to help debugging this on win10.

Reviewers: rnk

Subscribers: chrisha, llvm-commits, dberris

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

llvm-svn: 282904

7 years agoRevert test change in r282894 as it's broken in some platforms.
Dehao Chen [Fri, 30 Sep 2016 19:25:23 +0000 (19:25 +0000)]
Revert test change in r282894 as it's broken in some platforms.

llvm-svn: 282903

7 years ago[Coroutines] Part15c: Fix coro-split to correctly handle definitions between coro...
Gor Nishanov [Fri, 30 Sep 2016 19:24:19 +0000 (19:24 +0000)]
[Coroutines] Part15c: Fix coro-split to correctly handle definitions between coro.save and coro.suspend

Summary:
In the case below, %Result.i19 is defined between coro.save and coro.suspend and used after coro.suspend. We need to correctly place such a value into the coroutine frame.

```
  %save = call token @llvm.coro.save(i8* null)
  %Result.i19 = getelementptr inbounds %"struct.lean_future<int>::Awaiter", %"struct.lean_future<int>::Awaiter"* %ref.tmp7, i64 0, i32 0
  %suspend = call i8 @llvm.coro.suspend(token %save, i1 false)
  switch i8 %suspend, label %exit [
    i8 0, label %await.ready
    i8 1, label %exit
  ]
await.ready:
  %val = load i32, i32* %Result.i19

```

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 282902

7 years ago[InstCombine] add tests for non-splat select(ext)
Sanjay Patel [Fri, 30 Sep 2016 19:15:41 +0000 (19:15 +0000)]
[InstCombine] add tests for non-splat select(ext)

llvm-svn: 282901

7 years ago[MS] Implement __iso_volatile loads/stores as builtins
Martin Storsjo [Fri, 30 Sep 2016 19:13:46 +0000 (19:13 +0000)]
[MS] Implement __iso_volatile loads/stores as builtins

These are supposed to produce the same as normal volatile
pointer loads/stores. When -volatile:ms is specified,
normal volatile pointers are forced to have atomic semantics
(as is the default on x86 in MSVC mode). In that case,
these builtins should still produce non-atomic volatile
loads/stores without acquire/release semantics, which
the new test verifies.

These are only available on ARM (and on AArch64,
although clang doesn't support AArch64/Windows yet).

This implements what is missing for PR30394, making it possible
to compile C++ for ARM in MSVC mode with MSVC headers.

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

llvm-svn: 282900

7 years ago[Coroutines] Part15b: Fix dbg information handling in coro-split.
Gor Nishanov [Fri, 30 Sep 2016 19:05:06 +0000 (19:05 +0000)]
[Coroutines] Part15b: Fix dbg information handling in coro-split.

Summary:
Without the fix, if there was a function inlined into the coroutine with debug information, CloneFunctionInto(NewF, &F, VMap, /*ModuleLevelChanges=*/true, Returns); would duplicate all of the debug information including the DICompileUnit.

We know use VMap to indicate that debug metadata for a File, Unit and FunctionType should not be duplicated when we creating clones that will become f.resume, f.destroy and f.cleanup.

Reviewers: majnemer

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 282899

7 years agoFixed several i386 Objective-C tests by completing objects, not their pointers.
Sean Callanan [Fri, 30 Sep 2016 18:44:43 +0000 (18:44 +0000)]
Fixed several i386 Objective-C tests by completing objects, not their pointers.

llvm-svn: 282898

7 years ago[Coroutines] Part 15a: Lower coro.subfn.addr in CoroCleanup
Gor Nishanov [Fri, 30 Sep 2016 18:41:35 +0000 (18:41 +0000)]
[Coroutines] Part 15a: Lower coro.subfn.addr in CoroCleanup

Summary: Not all coro.subfn.addr intrinsics can be eliminated in CoroElide through devirtualization. Those that remain need to be lowered in CoroCleanup.

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 282897

7 years agoclean up tests and auto-generate checks
Sanjay Patel [Fri, 30 Sep 2016 18:37:34 +0000 (18:37 +0000)]
clean up tests and auto-generate checks

llvm-svn: 282896

7 years agocmake: Install the OCaml libraries into a more correct path
Michal Gorny [Fri, 30 Sep 2016 18:34:23 +0000 (18:34 +0000)]
cmake: Install the OCaml libraries into a more correct path

Add a OCAML_INSTALL_PATH variable that can be used to control
the install path for OCaml libraries. The new variable defaults to
${OCAML_STDLIB_PATH}, i.e. the OCaml library path obtained from
the OCaml compiler. Install libraries into "llvm" subdirectory.

This fixes two issues:

1. OCaml library directories differ between systems, and 'lib/ocaml' is
incorrect e.g. on amd64 Gentoo where OCaml is installed
in 'lib64/ocaml'. Therefore, obtain the library path from the OCaml
compiler using 'ocamlc -where' (which is already used to set
OCAML_STDLIB_PATH), which is the method used commonly in OCaml packages.

2. The top-level directory is reserved for the standard library, and has
precedence over local directory in search path. As a result, OCaml
preferred the files installed along with previous LLVM version over the
source tree when building a new version, resulting in two versions being
mixed during the build. The new layout is used commonly by other OCaml
packages, and findlib is able to find the LLVM libraries successfully.

Bug: https://bugs.gentoo.org/559134
Bug: https://bugs.gentoo.org/559624

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

llvm-svn: 282895

7 years agoUpdate loop unroller cost model to make sure debug info does not affect optimization...
Dehao Chen [Fri, 30 Sep 2016 18:30:04 +0000 (18:30 +0000)]
Update loop unroller cost model to make sure debug info does not affect optimization decisions.

Summary: Debug info should *not* affect optimization decisions. This patch updates loop unroller cost model to make it not affected by debug info.

Reviewers: davidxl, mzolotukhin

Subscribers: haicheng, llvm-commits, mzolotukhin

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

llvm-svn: 282894

7 years ago[CodeGen] Add assertion for indirect array index expression generation. NFC.
Michael Kruse [Fri, 30 Sep 2016 18:29:37 +0000 (18:29 +0000)]
[CodeGen] Add assertion for indirect array index expression generation. NFC.

Currently Polly cannot generate code for index expressions if the base pointer
is computed within the scop. The base pointer must be generated as well, but
there is no code that triggers that.

Add an assertion to detect when this would occur and miscompile. The IR verifier
should catch it as well.

llvm-svn: 282893

7 years ago[libFuzzer] add a fuzzer test that finds CVE-2015-3193
Kostya Serebryany [Fri, 30 Sep 2016 18:16:16 +0000 (18:16 +0000)]
[libFuzzer] add a fuzzer test that finds CVE-2015-3193

llvm-svn: 282892

7 years ago[InstCombine] add tests for select X, (ext X), C
Sanjay Patel [Fri, 30 Sep 2016 18:10:14 +0000 (18:10 +0000)]
[InstCombine] add tests for select X, (ext X), C

llvm-svn: 282891

7 years ago[WebAssembly] Make register stackification more conservative
Derek Schuff [Fri, 30 Sep 2016 18:02:54 +0000 (18:02 +0000)]
[WebAssembly] Make register stackification more conservative

Register stackification currently checks VNInfo for changes. Make that
more accurate by testing each intervening instruction for any other defs
to the same virtual register.

Patch by Jacob Gravelle

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

llvm-svn: 282886

7 years agoImprove error check for an empty archive.
Rui Ueyama [Fri, 30 Sep 2016 17:56:20 +0000 (17:56 +0000)]
Improve error check for an empty archive.

Previously, it warned on any archive file that has no symbol.
It turned out that that is too noisy.

With this patch, it warns on such archive file that contains no file.

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

llvm-svn: 282885

7 years ago[Object] Define Archive::isEmpty().
Rui Ueyama [Fri, 30 Sep 2016 17:54:31 +0000 (17:54 +0000)]
[Object] Define Archive::isEmpty().

llvm-svn: 282884

7 years ago[Support] Complete ISL annotations to IslPtr<>. NFC.
Michael Kruse [Fri, 30 Sep 2016 17:47:39 +0000 (17:47 +0000)]
[Support] Complete ISL annotations to IslPtr<>. NFC.

Add missing __isl_(give/take/keep) annotations to IslPtr<> and NonowningIslPtr<>
methods.

Because IslPtr's constructor's annotation would depend on the TakeOwnership
parameter, the parameter has been removed. Caller must copy the object
themselves if the do not want to take ownership.

llvm-svn: 282883

7 years ago[compiler-rt] Add support for the dynamic shadow allocation
Etienne Bergeron [Fri, 30 Sep 2016 17:47:34 +0000 (17:47 +0000)]
[compiler-rt] Add support for the dynamic shadow allocation

Summary:
This patch is adding support for dynamic shadow allocation.

This is a merge and re-commit of the following patches.

```
[compiler-rt] Fix Asan build on Android
  https://reviews.llvm.org/D24768
[compiler-rt] Add support for the dynamic shadow allocation
  https://reviews.llvm.org/D23363
```

This patch needed to re-land at the same time:
```
[asan] Support dynamic shadow address instrumentation
  https://reviews.llvm.org/D23354
```

Reviewers: rnk, zaks.anna

Subscribers: tberghammer, danalbert, kubabrecka, dberris, chrisha, llvm-commits

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

llvm-svn: 282882

7 years ago[asan] Support dynamic shadow address instrumentation
Etienne Bergeron [Fri, 30 Sep 2016 17:46:32 +0000 (17:46 +0000)]
[asan] Support dynamic shadow address instrumentation

Summary:
This patch is adding the support for a shadow memory with
dynamically allocated address range.

The compiler-rt needs to export a symbol containing the shadow
memory range.

This is required to support ASAN on windows 64-bits.

Reviewers: kcc, rnk, vitalybuka

Subscribers: zaks.anna, kubabrecka, dberris, llvm-commits, chrisha

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

llvm-svn: 282881

7 years ago[CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in...
Justin Lebar [Fri, 30 Sep 2016 17:14:53 +0000 (17:14 +0000)]
[CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created.

Summary: NVCC compat.  Fixes bug 30567.

Reviewers: tra

Subscribers: cfe-commits, rnk

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

llvm-svn: 282880

7 years ago[CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).
Justin Lebar [Fri, 30 Sep 2016 17:14:48 +0000 (17:14 +0000)]
[CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

Summary: This is ugh, but it makes us compatible with NVCC.  Fixes bug 26341.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

llvm-svn: 282879

7 years ago[CUDA] Add missing comment on Sema::CheckCUDAVLA.
Justin Lebar [Fri, 30 Sep 2016 17:14:44 +0000 (17:14 +0000)]
[CUDA] Add missing comment on Sema::CheckCUDAVLA.

llvm-svn: 282878

7 years ago[AMDGPU] Choose VMCNT, EXPCNT, LGKMCNT masks and shifts based on the isa version
Konstantin Zhuravlyov [Fri, 30 Sep 2016 17:01:40 +0000 (17:01 +0000)]
[AMDGPU] Choose VMCNT, EXPCNT, LGKMCNT masks and shifts based on the isa version

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

llvm-svn: 282877

7 years ago[test] Support 'lit' executable name
Michal Gorny [Fri, 30 Sep 2016 16:56:16 +0000 (16:56 +0000)]
[test] Support 'lit' executable name

Support finding lit as plain 'lit', which is the name used by setup.py
in LLVM's utils/lit.

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

llvm-svn: 282876

7 years ago[AMDGPU] Ask subtarget if waitcnt instruction is needed before barrier instruction
Konstantin Zhuravlyov [Fri, 30 Sep 2016 16:50:36 +0000 (16:50 +0000)]
[AMDGPU] Ask subtarget if waitcnt instruction is needed before barrier instruction

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

llvm-svn: 282875

7 years ago[Support] Compile fix for gcc. NFC.
Michael Kruse [Fri, 30 Sep 2016 16:47:43 +0000 (16:47 +0000)]
[Support] Compile fix for gcc. NFC.

gcc 5.4 insists on template specialization to be in a namespace polly { ... }
block, instead of being prefixed with 'polly::'. Error message:

root/src/llvm/tools/polly/lib/Support/GICHelper.cpp:203:54: error: specialization of â€˜template<class T> void polly::IslPtr<T>::dump() const’ in different namespace [-fpermissive]
   template <> void polly::IslPtr<isl_##TYPE>::dump() const {                   \
                                                      ^
msvc14 and clang 3.8 did not complain.

llvm-svn: 282874

7 years ago[AMDGPU] Do not run scalar optimization passes at "-O0"
Konstantin Zhuravlyov [Fri, 30 Sep 2016 16:39:24 +0000 (16:39 +0000)]
[AMDGPU] Do not run scalar optimization passes at "-O0"

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

llvm-svn: 282873

7 years agoCVP. Turn marking adds as no wrap on by default (was turned off by 279082)
Artur Pilipenko [Fri, 30 Sep 2016 16:20:08 +0000 (16:20 +0000)]
CVP. Turn marking adds as no wrap on by default (was turned off by 279082)

With 282650 in tree extra no wrap on adds doesn't cause regressions anymore. Reenable the optimzation.

llvm-svn: 282872

7 years agoAdd namespace qualifiers for UTF functions that just moved.
Adrian McCarthy [Fri, 30 Sep 2016 16:11:42 +0000 (16:11 +0000)]
Add namespace qualifiers for UTF functions that just moved.

llvm-svn: 282871

7 years ago[Support] Add (Nonowning-)IslPtr::dump(). NFC.
Michael Kruse [Fri, 30 Sep 2016 16:10:19 +0000 (16:10 +0000)]
[Support] Add (Nonowning-)IslPtr::dump(). NFC.

The dump() methods can be called from a debugger instead of e.g.

    isl_*_dump(Var.Obj)

where Var is a variable of type IslPtr/NonowningIslPtr. To ensure that the
existence of the function pointers do not depdend on whether the methods are
used somwhere, they are declared with external linkage.

llvm-svn: 282870

7 years agoSkip TestRuntimeIvars on i386; the Objective-C V1 runtime doesn't list ivars.
Sean Callanan [Fri, 30 Sep 2016 16:02:28 +0000 (16:02 +0000)]
Skip TestRuntimeIvars on i386; the Objective-C V1 runtime doesn't list ivars.

llvm-svn: 282869

7 years agoFix incorrect OpenMP version in Fortran module.
Jonathan Peyton [Fri, 30 Sep 2016 15:50:14 +0000 (15:50 +0000)]
Fix incorrect OpenMP version in Fortran module.

Add check for "45" version to use "201511" string for OpenMP 4.5,
otherwise "200505" is used in Fortran module. Also, fix kmp_openmp_version
variable (used for the debugger, e.g.) and kmp_version_omp_api that is used
in KMP_VERSION=1 output.

Patch by Olga Malysheva

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

llvm-svn: 282868

7 years agoResubmit "Add llvm::enumerate() to STLExtras."
Zachary Turner [Fri, 30 Sep 2016 15:43:59 +0000 (15:43 +0000)]
Resubmit "Add llvm::enumerate() to STLExtras."

The CL was originally failing due to the use of some C++14
specific features, so I've removed those.  Hopefully this will
satisfy the bots.

llvm-svn: 282867

7 years agoAgain fixing windows build breakage like in rL282862
Dimitar Vlahovski [Fri, 30 Sep 2016 15:41:33 +0000 (15:41 +0000)]
Again fixing windows build breakage like in rL282862

llvm-svn: 282866

7 years ago[CUDA][OpenMP] Add a generic offload action builder
Samuel Antao [Fri, 30 Sep 2016 15:34:19 +0000 (15:34 +0000)]
[CUDA][OpenMP] Add a generic offload action builder

Summary:
This patch proposes a new class to generate and record action dependences related with offloading. The builder provides three main functionalities:
- Add device dependences to host actions.
- Add host dependence to device actions.
- Register device top-level actions.

The constructor of the builder detect the programming models that should be supported, and generates a specialized builder for each. If a new programming model is to be added in the future, only a new specialized builder has to be implemented.

When the specialized builder is generated, it produces programming-model-specific diagnostics.

A CUDA specialized builder is proposed in the patch that mostly consists of the partition of the current  `buildCudaAction` by the three different functionalities.

Reviewers: tra, echristo, ABataev, jlebar, hfinkel

Subscribers: Hahnfeld, whchung, guansong, jlebar, mehdi_amini, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 282865

7 years ago[Support] Call isl_*_free() only on non-null pointers. NFC.
Michael Kruse [Fri, 30 Sep 2016 15:29:43 +0000 (15:29 +0000)]
[Support] Call isl_*_free() only on non-null pointers. NFC.

Add a non-NULL check before calling the free function into functions that are
supposed to be inlined. First, this is a form of partial inlining of the free
function, namely the nullptr test that free has to do. Secondly, and more
importantly, it allows the compiler to remove the call to isl_*_free() when it
knows that the object is nullptr, for instance because the last call is a
take(). "Consuming" the last use of an ISL object using take()
(instead of copy()) is a common pattern.

llvm-svn: 282864

7 years ago[LV] Build all scalar steps for non-uniform induction variables
Matthew Simpson [Fri, 30 Sep 2016 15:13:52 +0000 (15:13 +0000)]
[LV] Build all scalar steps for non-uniform induction variables

When building the steps for scalar induction variables, we previously attempted
to determine if all the scalar users of the induction variable were uniform. If
they were, we would only emit the step corresponding to vector lane zero. This
optimization was too aggressive. We generally don't know the entire set of
induction variable users that will be scalar. We have
isScalarAfterVectorization, but this is only a conservative estimate of the
instructions that will be scalarized. Thus, an induction variable may have
scalar users that aren't already known to be scalar. To avoid emitting unused
steps, we can only check that the induction variable is uniform. This should
fix PR30542.

Reference: https://llvm.org/bugs/show_bug.cgi?id=30542
llvm-svn: 282863

7 years agoFixing windows build breakage caused by rL282822
Dimitar Vlahovski [Fri, 30 Sep 2016 14:36:17 +0000 (14:36 +0000)]
Fixing windows build breakage caused by rL282822

The breakage was because of the moving of the UTF functions to the llvm
namespace

llvm-svn: 282862

7 years ago[CodeGen] Change 'Scalar' to 'Array' in method names. NFC.
Michael Kruse [Fri, 30 Sep 2016 14:34:05 +0000 (14:34 +0000)]
[CodeGen] Change 'Scalar' to 'Array' in method names. NFC.

generateScalarLoad() and generateScalarStore() are used for explicit (MK_Array)
memory accesses, therefore the method names were misleading. The names also
were similar to generateScalarLoads() and generateScalarStores() (plural forms)
which indeed handle scalar accesses. Presumbly, they were originally named to
contrast VectorBlockGenerator::generateLoad().

Rename the two methods to generateArrayLoad(),
respectively generateArrayStore().

llvm-svn: 282861

7 years ago[compiler-rt][asan] Disable a broken test on windows 64-bits
Etienne Bergeron [Fri, 30 Sep 2016 14:31:39 +0000 (14:31 +0000)]
[compiler-rt][asan] Disable a broken test on windows 64-bits

Summary:
This test is broken on wndows 64-bit.

The interception library is not able to hook on the memchr functions.

Snippet of the function that is not hookable:
```
--- No source file -------------------------------------------------------------
000007FEFA1A18CD CC                   int         3
000007FEFA1A18CE CC                   int         3
000007FEFA1A18CF CC                   int         3
--- f:\dd\vctools\crt\vcruntime\src\string\amd64_arm_arm64\memchr.c ------------
        while ( cnt && (*(unsigned char *)buf != (unsigned char)chr) ) {
000007FEFA1A18D0 4D 85 C0             test        r8,r8
000007FEFA1A18D3 74 0D                je          memchr+12h (07FEFA1A18E2h)
000007FEFA1A18D5 38 11                cmp         byte ptr [rcx],dl
000007FEFA1A18D7 74 09                je          memchr+12h (07FEFA1A18E2h)
                buf = (unsigned char *)buf + 1;
000007FEFA1A18D9 48 FF C1             inc         rcx
                cnt--;
000007FEFA1A18DC 49 83 E8 01          sub         r8,1
000007FEFA1A18E0 75 F3                jne         memchr+5h (07FEFA1A18D5h)
        }
```

Reviewers: rnk

Subscribers: kubabrecka, dberris, llvm-commits, chrisha

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

llvm-svn: 282860

7 years ago[compiler-rt][asan] Fix incorrect regexp breaking an asan unittest on win64
Etienne Bergeron [Fri, 30 Sep 2016 14:29:43 +0000 (14:29 +0000)]
[compiler-rt][asan] Fix incorrect regexp breaking an asan unittest on win64

Summary:
On windows, the memcpy and memmove function can be the same.
This is correcly detected when hooking, but it's not possible
to report the right function name when doing symbolisation.

The same fix was applied for the static asan unittest.
We forgot to apply the fix for the dynamic asan tests.
```
lvm\projects\compiler-rt\test\asan/TestCases/Windows/.svn/text-base/intercept_memcpy.cc.svn-base:// CHECK-NEXT:  __asan_{{.*}}mem{{.*}}
```

This patch is fixing this test (win64):
```
ddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memcpy_indirect.cc
```

Reviewers: rnk, vitalybuka

Subscribers: llvm-commits, kubabrecka, chrisha, dberris

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

llvm-svn: 282859

7 years agoStrip trailing whitespace (NFCI)
Simon Pilgrim [Fri, 30 Sep 2016 14:25:09 +0000 (14:25 +0000)]
Strip trailing whitespace (NFCI)

llvm-svn: 282858

7 years agoFix int <= bool comparison warning on MSVC
Simon Pilgrim [Fri, 30 Sep 2016 14:18:06 +0000 (14:18 +0000)]
Fix int <= bool comparison warning on MSVC

llvm-svn: 282857

7 years ago[AVR] Add the ELF object file writer
Dylan McKay [Fri, 30 Sep 2016 14:09:20 +0000 (14:09 +0000)]
[AVR] Add the ELF object file writer

Summary: This adds the ELF32 writer for AVR.

Reviewers: kparzysz

Subscribers: beanz, mgorny

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

llvm-svn: 282856

7 years agoRevert "[RegAllocGreedy] Attempt to split unspillable live intervals"
Dylan McKay [Fri, 30 Sep 2016 14:05:15 +0000 (14:05 +0000)]
Revert "[RegAllocGreedy] Attempt to split unspillable live intervals"

It was accidentally committed.

llvm-svn: 282855

7 years ago[AVR] Add the assembly instruction printer
Dylan McKay [Fri, 30 Sep 2016 14:01:50 +0000 (14:01 +0000)]
[AVR] Add the assembly instruction printer

Summary:
This change adds the AVR assembly instruction printer.

No tests are included in this patch. I have left them downstream so we can
add them once `llc` successfully runs (there's very few components left
to upstream until this).

Reviewers: arsenm, kparzysz

Subscribers: wdng, beanz, mgorny

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

llvm-svn: 282854

7 years ago[CodeGen] Add assertion for partial scalar accesses. NFC.
Michael Kruse [Fri, 30 Sep 2016 14:01:46 +0000 (14:01 +0000)]
[CodeGen] Add assertion for partial scalar accesses. NFC.

The code generator always adds unconditional LoadInst and StoreInst, hence the
MemoryAccess must be defined over all statement instances.

llvm-svn: 282853

7 years ago[RegAllocGreedy] Attempt to split unspillable live intervals
Dylan McKay [Fri, 30 Sep 2016 13:59:20 +0000 (13:59 +0000)]
[RegAllocGreedy] Attempt to split unspillable live intervals

Summary:
Previously, when allocating unspillable live ranges, we would never
attempt to split. We would always bail out and try last ditch graph
recoloring.

This patch changes this by attempting to split all live intervals before
performing recoloring.

This fixes LLVM bug PR14879.

I can't add test cases for any backends other than AVR because none of
them have small enough register classes to trigger the bug.

Reviewers: qcolombet

Subscribers: MatzeB

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

llvm-svn: 282852

7 years ago[ELF] - Inlined template argument variable. NFC.
George Rimar [Fri, 30 Sep 2016 13:46:34 +0000 (13:46 +0000)]
[ELF] - Inlined template argument variable. NFC.

llvm-svn: 282851

7 years ago[ELF] - Removed excessive variables. NFC.
George Rimar [Fri, 30 Sep 2016 13:44:02 +0000 (13:44 +0000)]
[ELF] - Removed excessive variables. NFC.

llvm-svn: 282850

7 years agoXFAIL TestSBData for gcc-4.9 i386
Pavel Labath [Fri, 30 Sep 2016 12:12:15 +0000 (12:12 +0000)]
XFAIL TestSBData for gcc-4.9 i386

test broken in r282659.

llvm-svn: 282849

7 years agoFix PDB unittests on non-windows platforms
Pavel Labath [Fri, 30 Sep 2016 11:47:54 +0000 (11:47 +0000)]
Fix PDB unittests on non-windows platforms

llvm r282788 changed how the presence of windows DIA SDK is signalled. Adjust to
that.

llvm-svn: 282848