138956 Commits

Author SHA1 Message Date
Rui Ueyama
9d24c09035 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:34:44 +00:00
Joerg Sonnenberger
e68f1f14f3 Sort LLVM_VERSION_INFO
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:34:02 +00:00
Joerg Sonnenberger
d79cc3deb4 GC left-over from workarounds for missing pid_t and size_t
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:32:42 +00:00
Joerg Sonnenberger
be24edeca0 GC ENABLE_PIC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:30:25 +00:00
Joerg Sonnenberger
dd9e07b78a GC HAVE___DSO_HANDLE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282935 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:29:19 +00:00
Joerg Sonnenberger
11c0597db0 Correctly expand HOST_LINK_VERSION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:28:42 +00:00
Joerg Sonnenberger
37e039ee13 Fix expansion of HAVE_SYS_MMAN_H
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:27:41 +00:00
Joerg Sonnenberger
93ae5d5aab GC HAVE_LINK_EXPORT_DYNAMIC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:26:31 +00:00
Joerg Sonnenberger
051cae622f GC HAVE_MMAP and HAVE_MMAP_FILE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:24:54 +00:00
Joerg Sonnenberger
513fcd69de Spell comment consistently with other library comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:24:21 +00:00
Joerg Sonnenberger
e3674fa34c Sort LINK_POLLY_INTO_TOOLS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:21:35 +00:00
Joerg Sonnenberger
d851cd598a GC STDC_HEADERS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:19:02 +00:00
Joerg Sonnenberger
593505d39e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:17:23 +00:00
Joerg Sonnenberger
f1086ea04d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:16:01 +00:00
Joerg Sonnenberger
4c3dd49f1c HAVE_LINK_R is not the only reason why this needs config.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282923 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:11:21 +00:00
Joerg Sonnenberger
b540020e6b GC HAVE_LIBDL, HAVE_LIBM and HAVE_LIBOLE32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:09:45 +00:00
Joerg Sonnenberger
c4ff9fbd85 Sort HAVE_LIBEDIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:08:36 +00:00
Hans Wennborg
68604c21e7 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:07:35 +00:00
Joerg Sonnenberger
d8588ac73f Turn ENABLE_CRASH_OVERRIDES into a 0/1 definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:06:19 +00:00
Joerg Sonnenberger
2bf78b4d6c Convert ENABLE_BACKTRACES into a 0/1 definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 20:04:24 +00:00
Joerg Sonnenberger
2e683f12dc GC TIME_WITH_SYS_TIME and TM_IN_SYS_TIME
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:59:58 +00:00
Joerg Sonnenberger
f39b9e0db5 GC STAT_MACROS_BROKEN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:58:44 +00:00
Joerg Sonnenberger
8a2343b89e GC NEED_USCORE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282914 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:57:54 +00:00
Joerg Sonnenberger
9172a948f1 Turn LLVM_USE_OPROFILE into a 0/1 definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:55:37 +00:00
Joerg Sonnenberger
9ca7d0850f Turn LLVM_USE_INTEL_JITEVENTS into a 0/1 definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:54:25 +00:00
Joerg Sonnenberger
189d5c4135 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:52:27 +00:00
Sanjay Patel
59fe6b08fa [InstCombine] allow non-splat folds of select cond (ext X), C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:49:22 +00:00
Dehao Chen
f12f0e69a2 Revert test change in r282894 as it's broken in some platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:25:23 +00:00
Gor Nishanov
40fec41b24 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:24:19 +00:00
Sanjay Patel
32d667e940 [InstCombine] add tests for non-splat select(ext)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:15:41 +00:00
Gor Nishanov
b76c0e472e [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:05:06 +00:00
Gor Nishanov
a7eae488f2 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 18:41:35 +00:00
Sanjay Patel
baccf617c8 clean up tests and auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 18:37:34 +00:00
Michal Gorny
a7d748bbd3 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 18:34:23 +00:00
Dehao Chen
9faad5871f 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 18:30:04 +00:00
Kostya Serebryany
b035d535c3 [libFuzzer] add a fuzzer test that finds CVE-2015-3193
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 18:16:16 +00:00
Sanjay Patel
976632d9a2 [InstCombine] add tests for select X, (ext X), C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 18:10:14 +00:00
Derek Schuff
c61677f9d9 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 18:02:54 +00:00
Rui Ueyama
eabc8ab76f [Object] Define Archive::isEmpty().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 17:54:31 +00:00
Etienne Bergeron
937044fdd2 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 17:46:32 +00:00
Konstantin Zhuravlyov
69560a642c [AMDGPU] Choose VMCNT, EXPCNT, LGKMCNT masks and shifts based on the isa version
Differential Revision: https://reviews.llvm.org/D24973


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 17:01:40 +00:00
Konstantin Zhuravlyov
07f122bad7 [AMDGPU] Ask subtarget if waitcnt instruction is needed before barrier instruction
Differential Revision: https://reviews.llvm.org/D24985


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 16:50:36 +00:00
Konstantin Zhuravlyov
dc91c2fed3 [AMDGPU] Do not run scalar optimization passes at "-O0"
Differential Revision: https://reviews.llvm.org/D25055


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 16:39:24 +00:00
Artur Pilipenko
04c171a0c9 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 16:20:08 +00:00
Zachary Turner
f216a86852 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 15:43:59 +00:00
Matthew Simpson
1f0ef7442e [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 15:13:52 +00:00
Dylan McKay
6f7cc3863c [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 14:09:20 +00:00
Dylan McKay
eabad28062 Revert "[RegAllocGreedy] Attempt to split unspillable live intervals"
It was accidentally committed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 14:05:15 +00:00
Dylan McKay
cb9627faf5 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 14:01:50 +00:00
Dylan McKay
ea9ff22768 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 13:59:20 +00:00