platform/upstream/llvm.git
7 years agoTurn -Wmicrosoft-enum-value off by default.
Nico Weber [Thu, 4 May 2017 19:36:26 +0000 (19:36 +0000)]
Turn -Wmicrosoft-enum-value off by default.

The warning is currently way too noisy to be useful. The plan is
to make it warn when an MS enum that's negative is compared to
something, but until that's done the warning shouldn't default
to on.

llvm-svn: 302187

7 years agoSimplify the header allocation.
Rafael Espindola [Thu, 4 May 2017 19:34:17 +0000 (19:34 +0000)]
Simplify the header allocation.

In the non linker script case we would try very early to find out if
we could allocate the headers. Failing to do that would add extra
alignment to the first ro section, since we would set PageAlign
thinking it was the first section in the PT_LOAD.

In the linker script case the header allocation must be done in the
end, causing some duplication.

We now tentatively add the headers to the first PT_LOAD and if it
turns out they don't fit, remove them. With this we only need to
allocate the headers in one place in the code.

llvm-svn: 302186

7 years ago[WebAssembly] Add wasm symbol table support to llvm-objdump
Sam Clegg [Thu, 4 May 2017 19:32:43 +0000 (19:32 +0000)]
[WebAssembly] Add wasm symbol table support to llvm-objdump

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

llvm-svn: 302185

7 years agoDriver: only inject libstdc++ paths when needed on CrossWindows
Saleem Abdulrasool [Thu, 4 May 2017 19:18:21 +0000 (19:18 +0000)]
Driver: only inject libstdc++ paths when needed on CrossWindows

When building with libc++ don't bother with injecting the libstdc++
search paths into the linker search path.  This will make it easier to
switch between ld and lld.

llvm-svn: 302184

7 years ago[PPC] When restoring R30 (PIC base pointer), mark it as <def>
Krzysztof Parzyszek [Thu, 4 May 2017 19:14:54 +0000 (19:14 +0000)]
[PPC] When restoring R30 (PIC base pointer), mark it as <def>

This happened on the PPC32/SVR4 path and was discovered when building
FreeBSD on PPC32. It was a typo-class error in the frame lowering code.

This fixes PR26519.

llvm-svn: 302183

7 years agoFix test failure with GCC 4.9
Eric Fiselier [Thu, 4 May 2017 19:13:28 +0000 (19:13 +0000)]
Fix test failure with GCC 4.9

llvm-svn: 302182

7 years agoChange Appveyor to download Clang from llvm.org instead of my private server
Eric Fiselier [Thu, 4 May 2017 19:04:50 +0000 (19:04 +0000)]
Change Appveyor to download Clang from llvm.org instead of my private server

llvm-svn: 302181

7 years agoDon't return an invalid line table if the DW_AT_stmt_list value is not in the .debug_...
Greg Clayton [Thu, 4 May 2017 18:29:44 +0000 (18:29 +0000)]
Don't return an invalid line table if the DW_AT_stmt_list value is not in the .debug_line section.

llvm-svn: 302180

7 years ago[ms-inline-asm] Use the frontend size only for ambiguous instructions
Reid Kleckner [Thu, 4 May 2017 18:19:52 +0000 (18:19 +0000)]
[ms-inline-asm] Use the frontend size only for ambiguous instructions

This avoids problems on code like this:
  char buf[16];
  __asm {
    movups xmm0, [buf]
    mov [buf], eax
  }

The frontend size in this case (1) is wrong, and the register makes the
instruction matching unambiguous. There are also enough bytes available
that we shouldn't complain to the user that they are potentially using
an incorrectly sized instruction to access the variable.

Supersedes D32636 and D26586 and fixes PR28266

llvm-svn: 302179

7 years ago[InstSimplify] move logic-of-icmps helper functions; NFC
Sanjay Patel [Thu, 4 May 2017 18:19:17 +0000 (18:19 +0000)]
[InstSimplify] move logic-of-icmps helper functions; NFC

Putting these next to each other should make it easier to see
what's missing from each side. Patch to plug one of those holes
should be posted soon.

llvm-svn: 302178

7 years agoRe-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in the module...
Peter Collingbourne [Thu, 4 May 2017 18:03:25 +0000 (18:03 +0000)]
Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
with a fix for the clang backend.

llvm-svn: 302176

7 years agoFix a typo.
Michael Zolotukhin [Thu, 4 May 2017 17:42:34 +0000 (17:42 +0000)]
Fix a typo.

llvm-svn: 302175

7 years ago[InstSimplify] add tests for or-of-casted-icmps; NFC
Sanjay Patel [Thu, 4 May 2017 17:36:53 +0000 (17:36 +0000)]
[InstSimplify] add tests for or-of-casted-icmps; NFC

llvm-svn: 302174

7 years ago[NewGVN] Remove unneeded newline and format assertions. NFCI.
Davide Italiano [Thu, 4 May 2017 17:26:15 +0000 (17:26 +0000)]
[NewGVN] Remove unneeded newline and format assertions. NFCI.

llvm-svn: 302173

7 years agoAdd markup for libc++ dylib availability
Mehdi Amini [Thu, 4 May 2017 17:08:54 +0000 (17:08 +0000)]
Add markup for libc++ dylib availability

Libc++ is used as a system library on macOS and iOS (amongst others). In order
for users to be able to compile a binary that is intended to be deployed to an
older version of the platform, clang provides the
availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>_
that can be placed on declarations to describe the lifecycle of a symbol in the
library.

See docs/DesignDocs/AvailabilityMarkup.rst for more information.

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

llvm-svn: 302172

7 years ago[APInt] Reduce number of allocations involved in multiplying. Reduce worst case multi...
Craig Topper [Thu, 4 May 2017 17:00:41 +0000 (17:00 +0000)]
[APInt] Reduce number of allocations involved in multiplying. Reduce worst case multiply size

Currently multiply is implemented in operator*=. Operator* makes a copy and uses operator*= to modify the copy.

Operator*= itself allocates a temporary buffer to hold the multiply result as it computes it. Then copies it to the buffer in *this.

Operator*= attempts to bound the size of the result based on the number of active bits in its inputs. It also has a couple special cases to handle 0 inputs without any memory allocations or multiply operations. The best case is that it calculates a single word regardless of input bit width. The worst case is that it calculates the a 2x input width result and drop the upper bits.

Since operator* uses operator*= it incurs two allocations, one for a copy of *this and one for the temporary allocation. Neither of these allocations are kept after the method operation is done.

The main usage in the backend appears to be ConstantRange::multiply which uses operator* rather than operator*=.

This patch moves the multiply operation to operator* and implements operator*= using it. This avoids the copy in operator*. operator* now allocates a result buffer sized the same width as its inputs no matter what. This buffer will be used as the buffer for the returned APInt. Finally, we reuse tcMultiply to implement the multiply operation. This function is capable of not calculating additional upper words that will be discarded.

This change does lose the special optimizations for the inputs using less words than their size implies. But it also removed the getActiveBits calls from all multiplies. If we think those optimizations are important we could look at providing additional bounds to tcMultiply to limit the computations.

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

llvm-svn: 302171

7 years ago[PM] Add ProfileSummaryAnalysis as a required pass in the new pipeline.
Easwaran Raman [Thu, 4 May 2017 16:58:45 +0000 (16:58 +0000)]
[PM] Add ProfileSummaryAnalysis as a required pass in the new pipeline.

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

llvm-svn: 302170

7 years ago[Lexicon] Add BDCE
Brian Gesiak [Thu, 4 May 2017 16:50:37 +0000 (16:50 +0000)]
[Lexicon] Add BDCE

Summary: Add an entry to the Lexicon for "BDCE."

Reviewers: jmolloy, hfinkel

Reviewed By: jmolloy

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

llvm-svn: 302169

7 years agoUse lgamma_r instead of lgamma in binomial_distribution, because freakin' POSIX took...
Marshall Clow [Thu, 4 May 2017 16:36:39 +0000 (16:36 +0000)]
Use lgamma_r instead of lgamma in binomial_distribution, because freakin' POSIX took a perfectly fine call and made it not thread safe.

llvm-svn: 302168

7 years agoAdd accidentally deleted testcase back.
Adrian Prantl [Thu, 4 May 2017 16:26:07 +0000 (16:26 +0000)]
Add accidentally deleted testcase back.

llvm-svn: 302167

7 years agoCleanup tests to not share a DISubprogram between multiple Functions.
Adrian Prantl [Thu, 4 May 2017 16:24:31 +0000 (16:24 +0000)]
Cleanup tests to not share a DISubprogram between multiple Functions.

rdar://problem/31926379

llvm-svn: 302166

7 years ago[test-release] Status update *before* long gzip
Renato Golin [Thu, 4 May 2017 16:21:30 +0000 (16:21 +0000)]
[test-release] Status update *before* long gzip

llvm-svn: 302165

7 years ago[clang-tidy] fix readability-implicit-bool-cast false positive with xor
Alexander Kornienko [Thu, 4 May 2017 16:06:08 +0000 (16:06 +0000)]
[clang-tidy] fix readability-implicit-bool-cast false positive with xor

llvm-svn: 302164

7 years ago[ScopBuilder] Add missing semicolon after LLVM_FALLTHROUGH.
Michael Kruse [Thu, 4 May 2017 15:55:54 +0000 (15:55 +0000)]
[ScopBuilder] Add missing semicolon after LLVM_FALLTHROUGH.

It was forgotten in r302157.

llvm-svn: 302163

7 years ago[test] Name the local variable in the C1XX implementation of DoNotOptmize
Casey Carter [Thu, 4 May 2017 15:54:09 +0000 (15:54 +0000)]
[test] Name the local variable in the C1XX implementation of DoNotOptmize

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

llvm-svn: 302162

7 years ago[clang-tidy] fix readability-implicit-bool-cast false alarm on |=, &=
Alexander Kornienko [Thu, 4 May 2017 15:34:31 +0000 (15:34 +0000)]
[clang-tidy] fix readability-implicit-bool-cast false alarm on |=, &=

llvm-svn: 302161

7 years ago[clang-tidy] Code cleanup, (almost) NFC (*).
Alexander Kornienko [Thu, 4 May 2017 15:34:23 +0000 (15:34 +0000)]
[clang-tidy] Code cleanup, (almost) NFC (*).

(*) Printed types of member pointers don't use elaborated type specifiers
(`int struct S::*` -> `int S::*`).

llvm-svn: 302160

7 years ago[Tooling] add a createReplacement overload for StringRef
Alexander Kornienko [Thu, 4 May 2017 15:34:06 +0000 (15:34 +0000)]
[Tooling] add a createReplacement overload for StringRef

llvm-svn: 302159

7 years ago[test] variant: enable constexpr construction tests on MSVC STL
Casey Carter [Thu, 4 May 2017 15:32:54 +0000 (15:32 +0000)]
[test] variant: enable constexpr construction tests on MSVC STL

* Add a new macro _MSVC_STL_VER to detect when the MSVC STL is being tested
* Workaround C1XX __is_trivially_copyable bug

llvm-svn: 302158

7 years agoIntroduce VirtualUse. NFC.
Michael Kruse [Thu, 4 May 2017 15:22:57 +0000 (15:22 +0000)]
Introduce VirtualUse. NFC.

If a ScopStmt references a (scalar) value, there are multiple
possibilities where this value can come. The decision about what kind of
use it is must be handled consistently at different places, which can be
error-prone. VirtualUse is meant to centralize the handling of the
different types of value uses.

This patch makes ScopBuilder and CodeGeneration use VirtualUse. This
already helps to show inconsistencies with the value handling. In order
to keep this patch NFC, exceptions to the general rules are added.
These might be fixed later if they turn to problems. Overall, this
should result in fewer post-codegen IR-verification errors, but instead
assertion failures in `getNewValue` that are closer to the actual error.

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

llvm-svn: 302157

7 years agoclang-format: [JS] exponentiation operator
Martin Probst [Thu, 4 May 2017 15:04:04 +0000 (15:04 +0000)]
clang-format: [JS] exponentiation operator

Summary: While its precedence should be higher than multiplicative, LLVM does not have a level for that, so for the time being just treat it as multiplicative.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 302156

7 years agoReduce code duplication. NFC.
Rafael Espindola [Thu, 4 May 2017 14:54:48 +0000 (14:54 +0000)]
Reduce code duplication. NFC.

llvm-svn: 302155

7 years ago[globalisel][tablegen] Add several GINodeEquiv's for operators that do not require...
Daniel Sanders [Thu, 4 May 2017 14:24:50 +0000 (14:24 +0000)]
[globalisel][tablegen] Add several GINodeEquiv's for operators that do not require additional support.

Summary:
As of this patch, 350 out of 3938 rules are currently imported.

Depends on D32229

Reviewers: qcolombet, kristof.beyls, rovka, t.p.northover, ab, aditya_nandakumar

Reviewed By: ab

Subscribers: dberris, llvm-commits, igorb

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

llvm-svn: 302154

7 years ago[DAGCombine] Transform (fadd A, (fmul B, -2.0)) -> (fsub A, (fadd B, B)).
Chad Rosier [Thu, 4 May 2017 14:14:44 +0000 (14:14 +0000)]
[DAGCombine] Transform (fadd A, (fmul B, -2.0)) -> (fsub A, (fadd B, B)).

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

llvm-svn: 302153

7 years ago[ASAN] Add interceptor for __longjmp_chk
Peter Wu [Thu, 4 May 2017 14:03:57 +0000 (14:03 +0000)]
[ASAN] Add interceptor for __longjmp_chk

Summary:
glibc on Linux calls __longjmp_chk instead of longjmp (or _longjmp) when
_FORTIFY_SOURCE is defined. Ensure that an ASAN-instrumented program
intercepts this function when a system library calls it, otherwise the
stack might remain poisoned and result in CHECK failures and false
positives.

Fixes https://github.com/google/sanitizers/issues/721

Reviewed By: eugenis

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

llvm-svn: 302152

7 years agoDiagnosticsEngine should clear DelayedDiagID before reporting the
Alex Lorenz [Thu, 4 May 2017 13:56:51 +0000 (13:56 +0000)]
DiagnosticsEngine should clear DelayedDiagID before reporting the
delayed diagnostic

This fix avoids an infinite recursion that was uncovered in one of our internal
tests by r301992. The testcase is the most reduced version of that
auto-generated test.

This is an improved version of the reverted commit r302037. The previous fix
actually managed to expose another subtle bug whereby `fatal_too_many_errors`
error was reported twice, with the second report setting the
`FatalErrorOccurred` flag. That prevented the notes that followed the diagnostic
the caused `fatal_too_many_errors` to be emitted. This commit ensures that notes
that follow `fatal_too_many_errors` but that belong to the diagnostic that
caused `fatal_too_many_errors` won't be emitted by setting the
`FatalErrorOccurred` when emitting `fatal_too_many_errors`.

rdar://31962618

llvm-svn: 302151

7 years ago[X86][AVX512] Fix VPABSD file checks
Simon Pilgrim [Thu, 4 May 2017 13:42:57 +0000 (13:42 +0000)]
[X86][AVX512] Fix VPABSD file checks

Fix capitalization and string matching

llvm-svn: 302150

7 years ago[X86][SSE] Add i686 triple tests for partial vector and re-association
Simon Pilgrim [Thu, 4 May 2017 13:35:40 +0000 (13:35 +0000)]
[X86][SSE] Add i686 triple tests for partial vector and re-association

llvm-svn: 302149

7 years agoRefactoring with range-based for, NFC
Krzysztof Parzyszek [Thu, 4 May 2017 13:35:17 +0000 (13:35 +0000)]
Refactoring with range-based for, NFC

Patch by Wei-Ren Chen.

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

llvm-svn: 302148

7 years ago[compiler-rt][mips] Add support for quad precision builtins for mips64
Simon Dardis [Thu, 4 May 2017 13:34:17 +0000 (13:34 +0000)]
[compiler-rt][mips] Add support for quad precision builtins for mips64

Match the builtins that GCC provides for IEEE754 quad precision
on MIPS64. Also, enable building them with clang as PR20098 is resolved.

Disable tests for xf and xc modes as MIPS doesn't support that mode in
hardware or software.

Reviewers: slthakur

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

llvm-svn: 302147

7 years ago[SystemZ] Make copyPhysReg() add impl-use operands of super reg.
Jonas Paulsson [Thu, 4 May 2017 13:33:30 +0000 (13:33 +0000)]
[SystemZ]  Make copyPhysReg() add impl-use operands of super reg.

When a 128 bit COPY is lowered into two instructions, an impl-use operand of
the super-reg should be added to each new instruction in case one of the
sub-regs is undefined.

Review: Ulrich Weigand
llvm-svn: 302146

7 years ago[X86][SSE] Add i686 triple tests for PBLENDW commutation
Simon Pilgrim [Thu, 4 May 2017 13:08:09 +0000 (13:08 +0000)]
[X86][SSE] Add i686 triple tests for PBLENDW commutation

llvm-svn: 302145

7 years ago[X86][AVX1] Regenerate checks and add i686 triple tests for folded logical ops
Simon Pilgrim [Thu, 4 May 2017 13:00:30 +0000 (13:00 +0000)]
[X86][AVX1] Regenerate checks and add i686 triple tests for folded logical ops

llvm-svn: 302144

7 years agoAdd support of the next Ubuntu (Ubuntu 17.10 - Artful Aardvark)
Sylvestre Ledru [Thu, 4 May 2017 12:46:38 +0000 (12:46 +0000)]
Add support of the next Ubuntu (Ubuntu 17.10 - Artful Aardvark)

llvm-svn: 302143

7 years ago[CMake] Remove POLLY_TEST_DIRECTORIES.
Michael Kruse [Thu, 4 May 2017 12:21:25 +0000 (12:21 +0000)]
[CMake] Remove POLLY_TEST_DIRECTORIES.

The test subdirectory POLLY_TEST_DIRECTORIES was heavily outdated and
only used in out-of-LLVM-tree builds
(to generate polly-test-${subdir} targets).

llvm-svn: 302142

7 years agoRevert "IR: Use pointers instead of GUIDs to represent edges in the module summary...
Eric Liu [Thu, 4 May 2017 12:05:40 +0000 (12:05 +0000)]
Revert "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."

This reverts commit r302108.

llvm-svn: 302141

7 years agoRevert "IR: Use pointers instead of GUIDs to represent edges in the module summary...
Eric Liu [Thu, 4 May 2017 11:49:39 +0000 (11:49 +0000)]
Revert "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."

This reverts commit r302108. This causes crash in clang bootstrap with LTO.

Contacted the auther in the original commit.

llvm-svn: 302140

7 years ago[LLDB][MIPS] Fix TestStepOverBreakpoint.py failure.
Nitesh Jain [Thu, 4 May 2017 11:34:42 +0000 (11:34 +0000)]
[LLDB][MIPS] Fix TestStepOverBreakpoint.py failure.

Reviewers: jingham, labath

Subscribers: jaydeep, bhushan, lldb-commits, slthakur

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

llvm-svn: 302139

7 years ago[mips][XRay] Use the base version of emitXRayTable
Simon Dardis [Thu, 4 May 2017 11:03:50 +0000 (11:03 +0000)]
[mips][XRay] Use the base version of emitXRayTable

Follow up rL290858 by removing the MIPS specific version of XRayTable
emission in favour of the basic version.

This resolves a buildbot failure where the ELF sections were malformed
causing the linker to reject the object files with xray related sections.

Reviewers: dberris, slthakur

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

llvm-svn: 302138

7 years ago[ArgPromotion] Fix a truncated variable
Martin Storsjo [Thu, 4 May 2017 10:54:35 +0000 (10:54 +0000)]
[ArgPromotion] Fix a truncated variable

This fixes a regression since SVN rev 273808 (which was supposed to
not change functionality).

The regression caused miscompilations (noted in the wild when targeting
AArch64) on platforms with 32 bit long.

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

llvm-svn: 302137

7 years ago[Index] The relation between the declarations in template
Alex Lorenz [Thu, 4 May 2017 10:42:06 +0000 (10:42 +0000)]
[Index] The relation between the declarations in template
specializations that 'override' declarations in the base template should use
the 'specializationOf' relation instead of 'specializationOf | overrideOf'.

The indexer relations are meant to be orthogonal, so 'specializationOf' is
better than the combined relation.

llvm-svn: 302136

7 years ago[LLVM][inline-asm][Altmacor] Altmacro string delimiter '<..>'
Michael Zuckerman [Thu, 4 May 2017 10:37:00 +0000 (10:37 +0000)]
[LLVM][inline-asm][Altmacor] Altmacro string delimiter '<..>'

In this patch, I introduce a new altmacro string delimiter.
This review is the second review in a series of four reviews.
(one for each altmacro feature: LOCAL, string delimiter, string '!' escape sign and absolute expression as a string '%' ).

In the alternate macro mode, you can delimit strings with matching angle brackets <..>
when using it as a part of calling macro arguments.

As described in the https://sourceware.org/binutils/docs-2.27/as/Altmacro.html
"<string>
You can delimit strings with matching angle brackets."

assumptions:

1. If an argument begins with '<' and ends with '>'. The argument is considered as a string.
2. Except adding new string mark '<..>', a regular macro behavior is expected.
3. The altmacro cannot affect the regular less/greater behavior.
4. If a comma is present inside an angle brackets it considered as a character and not as a separator.

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

llvm-svn: 302135

7 years ago[ScopDetection] Check for already known required-invariant loads [NFC]
Tobias Grosser [Thu, 4 May 2017 10:16:20 +0000 (10:16 +0000)]
[ScopDetection] Check for already known required-invariant loads [NFC]

For certain test cases we spent over 50% of the scop detection time in
checking if a load is likely invariant. We can avoid most of these checks by
testing early on if a load is expected to be invariant. Doing this reduces
scop-detection time on a large benchmark from 52 seconds to just 25 seconds.

No functional change is expected.

llvm-svn: 302134

7 years agoMainLoop: Add unit tests
Pavel Labath [Thu, 4 May 2017 10:11:33 +0000 (10:11 +0000)]
MainLoop: Add unit tests

Summary:
This adds a couple of unit tests to the MainLoop class. To get the
kqueue based version of the signal handling passing, I needed to
modify the implementation a bit to make the queue object persistent.
Otherwise, only the signals which are send during the Run call would get
processed, which did not match the ppoll behaviour.

I also took the opportunity to remove the ForEach template functions and
replace them with something more reasonable.

Reviewers: beanz, eugene

Subscribers: lldb-commits, mgorny

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

llvm-svn: 302133

7 years agoAdjust test case to not trigger the SCEV optimization committed in r302096
Tobias Grosser [Thu, 4 May 2017 08:56:54 +0000 (08:56 +0000)]
Adjust test case to not trigger the SCEV optimization committed in r302096

This makes sure we still test the case that a PHI-NODE cannot be analyzed by
scalar evolution and consequently must be code generated explicitly.  As
Michael's optimization triggers only on a very specific "add %iv, %step"
pattern, just changing 'add' to 'mul' adds back test coverage.

llvm-svn: 302132

7 years ago[ARM] ACLE Chapter 9 intrinsics
Sam Parker [Thu, 4 May 2017 08:37:59 +0000 (08:37 +0000)]
[ARM] ACLE Chapter 9 intrinsics

Implemented the remaining integer data processing intrinsics from
the ARM ACLE v2.1 spec, such as parallel arithemtic and DSP style
multiplications.

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

llvm-svn: 302131

7 years agoDummy commit to trigger CMake reconfiguration and unbreak Sphinx build
Eric Fiselier [Thu, 4 May 2017 08:32:33 +0000 (08:32 +0000)]
Dummy commit to trigger CMake reconfiguration and unbreak Sphinx build

llvm-svn: 302130

7 years agoFix incorrect usage of __libcpp_mutex_trylock. Patch from Andrey Khalyavin
Eric Fiselier [Thu, 4 May 2017 07:45:09 +0000 (07:45 +0000)]
Fix incorrect usage of __libcpp_mutex_trylock. Patch from Andrey Khalyavin

llvm-svn: 302129

7 years agoUpdate Appveyor bot link to point to new llvm-mirror Appveyor account
Eric Fiselier [Thu, 4 May 2017 07:40:23 +0000 (07:40 +0000)]
Update Appveyor bot link to point to new llvm-mirror Appveyor account

llvm-svn: 302128

7 years ago[X86][AVX-512] Allow EVEX encoded instruction selection when available for mul v8i32.
Igor Breger [Thu, 4 May 2017 07:34:58 +0000 (07:34 +0000)]
[X86][AVX-512] Allow EVEX encoded instruction selection when available for mul v8i32.

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

llvm-svn: 302127

7 years ago[ARM] ACLE Chapter 9 intrinsics
Sam Parker [Thu, 4 May 2017 07:31:28 +0000 (07:31 +0000)]
[ARM] ACLE Chapter 9 intrinsics

Added the integer data processing intrinsics from ACLE v2.1 Chapter 9
but I have missed out the saturation_occurred intrinsics for now. For
the instructions that read and write the GE bits, a chain is included
and the only instruction that reads these flags (sel) is only
selectable via the implemented intrinsic.

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

llvm-svn: 302126

7 years ago[OpenCL] Add intel_reqd_sub_group_size attribute support
Xiuli Pan [Thu, 4 May 2017 07:31:20 +0000 (07:31 +0000)]
[OpenCL] Add intel_reqd_sub_group_size attribute support

Summary:
Add intel_reqd_sub_group_size attribute support as intel extension  cl_intel_required_subgroup_size from
https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_required_subgroup_size.txt

Reviewers: Anastasia, bader, hfinkel, pxli168

Reviewed By: Anastasia, bader, pxli168

Subscribers: cfe-commits, yaxunl

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

llvm-svn: 302125

7 years ago[X86] Disabling PLT in Regcall CC Functions
Oren Ben Simhon [Thu, 4 May 2017 07:22:49 +0000 (07:22 +0000)]
[X86] Disabling PLT in Regcall CC Functions

According to psABI, PLT stub clobbers XMM8-XMM15.
In Regcall calling convention those registers are used for passing parameters.
Thus we need to prevent lazy binding in Regcall.

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

llvm-svn: 302124

7 years ago[AVX-512VL] Autogenerate checks. Add --show-mc-encoding to check instruction predicate.
Igor Breger [Thu, 4 May 2017 06:53:31 +0000 (06:53 +0000)]
[AVX-512VL] Autogenerate checks. Add --show-mc-encoding to check instruction predicate.

llvm-svn: 302123

7 years agotest commit
Eric Fiselier [Thu, 4 May 2017 06:28:34 +0000 (06:28 +0000)]
test commit

llvm-svn: 302122

7 years ago[XRay][compiler-rt][NFC] Update comments to doxygen format; group functions better.
Dean Michael Berris [Thu, 4 May 2017 06:27:51 +0000 (06:27 +0000)]
[XRay][compiler-rt][NFC] Update comments to doxygen format; group functions better.

llvm-svn: 302121

7 years agotest commit
Eric Fiselier [Thu, 4 May 2017 06:27:06 +0000 (06:27 +0000)]
test commit

llvm-svn: 302120

7 years ago[AVX] Fix vpcmpeqq predicate.
Igor Breger [Thu, 4 May 2017 06:24:52 +0000 (06:24 +0000)]
[AVX] Fix vpcmpeqq predicate.

Summary:
Fix vpcmpeqq predicate. AVX512 version of vpcmpeqq is not equivalent to AVX one.
Split from https://reviews.llvm.org/D32679

Reviewers: craig.topper, zvi, aymanmus

Reviewed By: craig.topper

Subscribers: llvm-commits

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

llvm-svn: 302119

7 years ago[libcxxabi][CMake] Set library dir when built under runtimes/
Jonas Hahnfeld [Thu, 4 May 2017 06:04:49 +0000 (06:04 +0000)]
[libcxxabi][CMake] Set library dir when built under runtimes/

This will put libraries into the build root's lib/ directory by default.

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

llvm-svn: 302118

7 years ago[libcxx][CMake] Set library dir when built under runtimes/
Jonas Hahnfeld [Thu, 4 May 2017 06:02:50 +0000 (06:02 +0000)]
[libcxx][CMake] Set library dir when built under runtimes/

This will put libraries into the build root's lib/ directory by default.

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

llvm-svn: 302117

7 years agoupdate buildbot doc to link to the new Appveyor builders
Eric Fiselier [Thu, 4 May 2017 05:58:59 +0000 (05:58 +0000)]
update buildbot doc to link to the new Appveyor builders

llvm-svn: 302116

7 years agoAttempt to enable the LIT progress bar on Appveyor
Eric Fiselier [Thu, 4 May 2017 05:32:54 +0000 (05:32 +0000)]
Attempt to enable the LIT progress bar on Appveyor

llvm-svn: 302115

7 years agoUse right function in LoopVectorize.
Jonas Paulsson [Thu, 4 May 2017 05:31:56 +0000 (05:31 +0000)]
Use right function in LoopVectorize.

-    unsigned AS = getMemInstAlignment(I);
+    unsigned AS = getMemInstAddressSpace(I);

Review: Hal Finkel
llvm-svn: 302114

7 years agoSetup Appveyor bot for MSVC 2017 and MSVC 2015
Eric Fiselier [Thu, 4 May 2017 05:16:48 +0000 (05:16 +0000)]
Setup Appveyor bot for MSVC 2017 and MSVC 2015

llvm-svn: 302113

7 years ago[XRay][compiler-rt] Support patching/unpatching specific functions
Dean Michael Berris [Thu, 4 May 2017 04:59:20 +0000 (04:59 +0000)]
[XRay][compiler-rt] Support patching/unpatching specific functions

Summary:
This change allows us to patch/unpatch specific functions using the
function ID. This is useful in cases where implementations might want to
do coverage-style, or more fine-grained control of which functions to
patch or un-patch at runtime.

Depends on D32693.

Reviewers: dblaikie, echristo, kpw

Subscribers: llvm-commits

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

llvm-svn: 302112

7 years ago[XRay] Use wordsize-dependent alignment for index
Dean Michael Berris [Thu, 4 May 2017 04:55:46 +0000 (04:55 +0000)]
[XRay] Use wordsize-dependent alignment for index

This makes it simpler for the runtime to consistently handle the entries
in the function sled index in both 32 and 64 bit platforms where the
XRay runtime works.

Follow-up on D32693.

llvm-svn: 302111

7 years ago[SelectionDAG] Improve known bits support for CTPOP.
Craig Topper [Thu, 4 May 2017 04:33:27 +0000 (04:33 +0000)]
[SelectionDAG] Improve known bits support for CTPOP.

This is based on the same concept from ValueTracking's version of computeKnownBits.

llvm-svn: 302110

7 years ago[XRay] Create an Index of sleds per function
Dean Michael Berris [Thu, 4 May 2017 03:37:57 +0000 (03:37 +0000)]
[XRay] Create an Index of sleds per function

Summary:
This change adds a new section to the xray-instrumented binary that
stores an index into ranges of the instrumentation map, where sleds
associated with the same function can be accessed as an array. At
runtime, we can get access to this index by function ID offset allowing
for selective patching and unpatching by function ID.

Each entry in this new section (xray_fn_idx) will include two pointers
indicating the start and one past the end of the sleds associated with
the same function. These entries will be 16 bytes long on x86 and
aarch64. On arm, we align to 16 bytes anyway so the runtime has to take
that into consideration.

__{start,stop}_xray_fn_idx will be the symbols that the runtime will
look for when we implement the selective patching/unpatching by function
id APIs. Because XRay synthesizes the function id's in a monotonically
increasing manner at runtime now, implementations (and users) can use
this table to look up the sleds associated with a specific function.
This is useful in implementations that want to do things like:

  - Implement coverage mode for functions by patching everything
    pre-main, then as functions are encountered, the installed handler
    can unpatch the function that's been encountered after recording
    that it's been called.
  - Do "learning mode", so that the implementation can figure out some
    statistical information about function calls by function id for a
    time being, and then determine which functions are worth
    uninstrumenting at runtime.
  - Do "selective instrumentation" where an implementation can
    specifically instrument only certain function id's at runtime
    (either based on some external data, or through some other
    heuristics) instead of patching all the instrumented functions at
    runtime.

Reviewers: dblaikie, echristo, chandlerc, javed.absar

Subscribers: pelikan, aemerson, kpw, llvm-commits, rengolin

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

llvm-svn: 302109

7 years agoIR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI.
Peter Collingbourne [Thu, 4 May 2017 03:36:16 +0000 (03:36 +0000)]
IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI.

When profiling a no-op incremental link of Chromium I found that the functions
computeImportForFunction and computeDeadSymbols were consuming roughly 10% of
the profile. The goal of this change is to improve the performance of those
functions by changing the map lookups that they were previously doing into
pointer dereferences.

This is achieved by changing the ValueInfo data structure to be a pointer to
an element of the global value map owned by ModuleSummaryIndex, and changing
reference lists in the GlobalValueSummary to hold ValueInfos instead of GUIDs.
This means that a ValueInfo will take a client directly to the summary list
for a given GUID.

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

llvm-svn: 302108

7 years agoFix accounting of tbss.
Rafael Espindola [Thu, 4 May 2017 03:00:27 +0000 (03:00 +0000)]
Fix accounting of tbss.

We were correctly computing the size contribution of a .tbss input
section (it is none), but we were incorrectly considering the
alignment of the output section: it was advancing Dot instead of
ThreadBssOffset.

As far as I can tell this was always wrong in our linkerscript
implementation, but that became more visible now that the code is
shared with the non linker script case.

llvm-svn: 302107

7 years agollvm/IR/Function.h: Prune an obsolete @param in r302060. [-Wdocumentation]
NAKAMURA Takumi [Thu, 4 May 2017 02:01:18 +0000 (02:01 +0000)]
llvm/IR/Function.h: Prune an obsolete @param in r302060. [-Wdocumentation]

llvm-svn: 302106

7 years ago[libcxx] [test] Strip trailing whitespace. NFC.
Stephan T. Lavavej [Thu, 4 May 2017 01:43:58 +0000 (01:43 +0000)]
[libcxx] [test] Strip trailing whitespace. NFC.

llvm-svn: 302105

7 years ago[libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.
Stephan T. Lavavej [Thu, 4 May 2017 01:35:11 +0000 (01:35 +0000)]
[libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.

_HAS_CXX17 indicates whether MSVC's STL is in C++17 mode.

In MSVC there's a distinction between CRT headers like stdlib.h and STL headers
like cstdlib. Only the STL headers drag in yvals.h, our internal STL-wide header
that defines internal macros like _HAS_CXX17.

_HAS_CXX17 is an MSVC STL library macro, unconditionally defined. We centralize
everything on this, because we have to ask different questions to determine
whether C1XX, EDG, or Clang is in 14 or 17 mode, and we additionally permit
users to override the detection in one way (it's okay to ask for 17 from the
compiler, but only 14 from the libs, at least for the moment; only noexcept
in the type system will give us a headache).

As this header is for testing MSVC's STL, we can assume _HAS_CXX17 is defined.

Fixes D32726.

llvm-svn: 302104

7 years ago[XRay] Detect loops in functions being lowered
Dean Michael Berris [Thu, 4 May 2017 01:24:26 +0000 (01:24 +0000)]
[XRay] Detect loops in functions being lowered

Summary:
This is an implementation of the loop detection logic that XRay needs to
determine whether a function might take time at runtime. Without this
heuristic, XRay will tend to not instrument short functions that have
loops that might have runtime dependent on inputs or external values.

While this implementation doesn't do any further analysis than just
figuring out whether there is a loop in the MachineFunction being
code-gen'ed, we're paving the way for being able to perform more
sophisticated analysis of the function in the future (for example to
determine whether the trip count for the loop might be constant, and
make a decision on that instead). This enables us to cover more
functions with the default heuristics, and potentially identify ones
that have variable runtime latency just by looking for the presence of
loops.

Reviewers: chandlerc, rnk, pelikan

Subscribers: llvm-commits

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

llvm-svn: 302103

7 years agoAttempt to escape paths correctly
Eric Fiselier [Thu, 4 May 2017 01:17:22 +0000 (01:17 +0000)]
Attempt to escape paths correctly

llvm-svn: 302102

7 years agoAttempt to setup MSVC 2017
Eric Fiselier [Thu, 4 May 2017 01:17:21 +0000 (01:17 +0000)]
Attempt to setup MSVC 2017

llvm-svn: 302101

7 years agoUse nullptr instead of the literal 0
Eric Fiselier [Thu, 4 May 2017 01:06:56 +0000 (01:06 +0000)]
Use nullptr instead of the literal 0

llvm-svn: 302100

7 years agoFix macro redefinition warnings for _LIBCPP_NO_RTTI
Eric Fiselier [Thu, 4 May 2017 01:06:54 +0000 (01:06 +0000)]
Fix macro redefinition warnings for _LIBCPP_NO_RTTI

llvm-svn: 302099

7 years agoAdd #pragma clang module begin/end pragmas and generate them when preprocessing a...
Richard Smith [Thu, 4 May 2017 00:29:54 +0000 (00:29 +0000)]
Add #pragma clang module begin/end pragmas and generate them when preprocessing a module.

These pragmas are intended to simulate the effect of entering or leaving a file
with an associated module. This is not completely implemented yet: declarations
between the pragmas will not be attributed to the correct module, but macro
visibility is already functional.

Modules named by #pragma clang module begin must already be known to clang (in
some module map that's either loaded or on the search path).

llvm-svn: 302098

7 years agoTest commit for Appveyor - Remove incorrect caching logic
Eric Fiselier [Thu, 4 May 2017 00:16:35 +0000 (00:16 +0000)]
Test commit for Appveyor - Remove incorrect caching logic

llvm-svn: 302097

7 years ago[SCEV] createAddRecFromPHI: Optimize for the most common case.
Michael Zolotukhin [Wed, 3 May 2017 23:53:38 +0000 (23:53 +0000)]
[SCEV] createAddRecFromPHI: Optimize for the most common case.

Summary:
The existing implementation creates a symbolic SCEV expression every
time we analyze a phi node and then has to remove it, when the analysis
is finished. This is very expensive, and in most of the cases it's also
unnecessary. According to the data I collected, ~60-70% of analyzed phi
nodes (measured on SPEC) have the following form:
  PN = phi(Start, OP(Self, Constant))
Handling such cases separately significantly speeds this up.

Reviewers: sanjoy, pete

Subscribers: llvm-commits

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

llvm-svn: 302096

7 years agoCMake: Only add test/ subdirectory when it exists
Duncan P. N. Exon Smith [Wed, 3 May 2017 23:33:54 +0000 (23:33 +0000)]
CMake: Only add test/ subdirectory when it exists

r296685 started adding the test/ subdirectory even when
LIBCXX_INCLUDE_TESTS=OFF.  This is great for testing libcxx standalone,
but it also breaks the build when the test/ subdirectory is removed
(and our submission system strips all test/ directories).

This patch updates the logic to check for test/ before adding it.

rdar://problem/31931366

llvm-svn: 302095

7 years agostrlen-1.ll: Fix test
Matthias Braun [Wed, 3 May 2017 23:32:51 +0000 (23:32 +0000)]
strlen-1.ll: Fix test

Change test for `strlen(x) == 0 --> *x == 0` to actually test the
pattern.

llvm-svn: 302094

7 years ago[InstCombine][KnownBits] Use KnownBits better to detect nsw adds
Craig Topper [Wed, 3 May 2017 23:22:46 +0000 (23:22 +0000)]
[InstCombine][KnownBits] Use KnownBits better to detect nsw adds

Change checkRippleForAdd from a heuristic to a full check -
if it is provable that the add does not overflow return true, otherwise false.

Patch by Yoav Ben-Shalom

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

llvm-svn: 302093

7 years agoMark functions as not having CFI once we finalize an x86 stack frame
Reid Kleckner [Wed, 3 May 2017 23:13:42 +0000 (23:13 +0000)]
Mark functions as not having CFI once we finalize an x86 stack frame

We'll set it back to true in emitPrologue if it gets called. It doesn't
get called for naked functions.

Fixes PR32912

llvm-svn: 302092

7 years ago[KnownBits] Add methods for determining if KnownBits is a constant value
Craig Topper [Wed, 3 May 2017 23:12:29 +0000 (23:12 +0000)]
[KnownBits] Add methods for determining if KnownBits is a constant value

This patch adds isConstant and getConstant for determining if KnownBits represents a constant value and to retrieve the value. Use them to simplify code.

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

llvm-svn: 302091

7 years agoRemove a comment that is no longer true.
Rui Ueyama [Wed, 3 May 2017 23:10:33 +0000 (23:10 +0000)]
Remove a comment that is no longer true.

llvm-svn: 302090

7 years ago[ValueTracking] Remove handling for BitWidth being 0 in ComputeSignBit and isKnownNon...
Craig Topper [Wed, 3 May 2017 22:25:19 +0000 (22:25 +0000)]
[ValueTracking] Remove handling for BitWidth being 0 in ComputeSignBit and isKnownNonZero.

I don't believe its possible to have non-zero values here since DataLayout became required. The APInt constructor inside of the KnownBits object will assert if this ever happens.

llvm-svn: 302089

7 years ago[KnownBits] Add zext, sext, and trunc methods to KnownBits
Craig Topper [Wed, 3 May 2017 22:07:25 +0000 (22:07 +0000)]
[KnownBits] Add zext, sext, and trunc methods to KnownBits

This patch adds zext, sext, and trunc methods to KnownBits and uses them where possible.

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

llvm-svn: 302088

7 years ago[TargetLowering] use isSubsetOf in SimplifyDemandedBits; NFCI
Sanjay Patel [Wed, 3 May 2017 21:55:34 +0000 (21:55 +0000)]
[TargetLowering] use isSubsetOf in SimplifyDemandedBits; NFCI

This is the DAG equivalent of https://reviews.llvm.org/D32255 ,
which will hopefully be committed again. The functionality
(preferring a 'not' op) is already here in the DAG, so this is
just intended to be a clean-up and performance improvement.

llvm-svn: 302087