platform/upstream/llvm.git
7 years ago[XRay][compiler-rt] Explicitly include <cstdint> for types
Dean Michael Berris [Mon, 19 Dec 2016 03:47:35 +0000 (03:47 +0000)]
[XRay][compiler-rt] Explicitly include <cstdint> for types

This is an attempt to un-break the ARM7, AArch64 builds.

Follow-up on D25360.

llvm-svn: 290078

7 years ago[XRay] [compiler-rt] Move machine-dependent code into machine-dependent files.
Dean Michael Berris [Mon, 19 Dec 2016 03:21:26 +0000 (03:21 +0000)]
[XRay] [compiler-rt] Move machine-dependent code into machine-dependent files.

Summary: Include the necessary headers while there.

Reviewers: dberris

Subscribers: llvm-commits

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

llvm-svn: 290077

7 years agoRemove inappropriate use of CachedHashStringRef.
Rui Ueyama [Mon, 19 Dec 2016 03:14:16 +0000 (03:14 +0000)]
Remove inappropriate use of CachedHashStringRef.

Use of CachedHashStringRef makes sense only when we reuse hash values.
Sprinkling it to all DenseMap has no benefits and just complicates data types.
Basically we shouldn't use CachedHashStringRef unless there is a strong
reason to to do so.

llvm-svn: 290076

7 years agoAdd a lit test for PR31374
Yaxun Liu [Mon, 19 Dec 2016 02:55:53 +0000 (02:55 +0000)]
Add a lit test for PR31374

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

llvm-svn: 290075

7 years ago[XRay] [compiler-rt] Fix format string; sanitizers' internal printf() doesn't support...
Dean Michael Berris [Mon, 19 Dec 2016 00:47:40 +0000 (00:47 +0000)]
[XRay] [compiler-rt] Fix format string; sanitizers' internal printf() doesn't support %ld.

Summary:
Getting rid of the distance number altogether because:
- a person knowledgeable enough to know what the message means will also
  know how to do hexadecimal math (with the help of a calculator)
- numbers outside INT_MIN - INT_MAX are hard to comprehend anyway

This unbreaks the case when you dynamically link a library with XRay and
it exits pre-main() with a not very informative static string.

Author: pelikan

Reviewers: dberris

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 290074

7 years ago[X86] Remove all of the patterns that use X86ISD:FAND/FXOR/FOR/FANDN except for the...
Craig Topper [Mon, 19 Dec 2016 00:42:28 +0000 (00:42 +0000)]
[X86] Remove all of the patterns that use X86ISD:FAND/FXOR/FOR/FANDN except for the ones needed for SSE1. Anything SSE2 or above uses the integer ISD opcode.

This removes 11721 bytes from the DAG isel table or 2.2%

llvm-svn: 290073

7 years agoFix name hiding and redeclaration checking for dependent local
Richard Smith [Sun, 18 Dec 2016 22:01:46 +0000 (22:01 +0000)]
Fix name hiding and redeclaration checking for dependent local
using-declarations.

llvm-svn: 290072

7 years agoFix some interactions between C++11 and C++14 features and using-declarations:
Richard Smith [Sun, 18 Dec 2016 21:39:37 +0000 (21:39 +0000)]
Fix some interactions between C++11 and C++14 features and using-declarations:

 * a dependent non-type using-declaration within a function template can be
   valid, as it can refer to an enumerator, so don't reject it in the template
   definition
 * we can partially substitute into a dependent using-declaration if it appears
   within a (local class in a) generic lambda within a function template, which
   means an UnresolvedUsing*Decl doesn't necessarily instantiate to a UsingDecl.

llvm-svn: 290071

7 years ago[FileCheck] Fix --strict-whitespace --match-full-lines -- add test-case
Tom de Vries [Sun, 18 Dec 2016 21:04:47 +0000 (21:04 +0000)]
[FileCheck] Fix --strict-whitespace --match-full-lines -- add test-case

Add test-case that was missing in "[FileCheck] Fix --strict-whitespace
--match-full-lines" commit.

llvm-svn: 290070

7 years ago[FileCheck] Fix --strict-whitespace --match-full-lines
Tom de Vries [Sun, 18 Dec 2016 20:45:59 +0000 (20:45 +0000)]
[FileCheck] Fix --strict-whitespace --match-full-lines

Make sure FileCheck --strict-whitespace --match-full-lines translates
'CHECK: bla ' into pattern '^ bla $' instead of pattern '^bla$'.

llvm-svn: 290069

7 years ago[PDB] Don't use the long type
David Majnemer [Sun, 18 Dec 2016 20:10:50 +0000 (20:10 +0000)]
[PDB] Don't use the long type

Long is not the same size across a number of the platforms we support.
Use unsigned int here instead, it is more appropriate because
overflow/wrap-around is possible and, in this case, expected.

llvm-svn: 290068

7 years ago[InstCombine] use commutative matchers for patterns with commutative operators
Sanjay Patel [Sun, 18 Dec 2016 18:49:48 +0000 (18:49 +0000)]
[InstCombine] use commutative matchers for patterns with commutative operators

Background/motivation - I was circling back around to:
https://llvm.org/bugs/show_bug.cgi?id=28296

I made a simple patch for that and noticed some regressions, so added test cases for
those with rL281055, and this is hopefully the minimal fix for just those cases.

But as you can see from the surrounding untouched folds, we are missing commuted patterns
all over the place, and of course there are no regression tests to cover any of those cases.

We could sprinkle "m_c_" dust all over this file and catch most of the missing folds, but
then we still wouldn't have test coverage, and we'd still miss some fraction of commuted
patterns because they require adjustments to the match order.

I'm aware of the concern about the potential compile-time performance impact of adding
matches like this (currently being discussed on llvm-dev), but I don't think there's any
evidence yet to suggest that handling commutative pattern matching more thoroughly is not
a worthwhile goal of InstCombine.

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

llvm-svn: 290067

7 years agoRevert r289955 and r289962. This is causing lots of ASAN failures for us.
Daniel Jasper [Sun, 18 Dec 2016 14:36:38 +0000 (14:36 +0000)]
Revert r289955 and r289962. This is causing lots of ASAN failures for us.

Not sure whether it causes and ASAN false positive or whether it
actually leads to incorrect code or whether it even exposes bad code.
Hans, I'll get you instructions to reproduce this.

llvm-svn: 290066

7 years ago[X86] [AVX512] Minor fix in encoding of scalar EVEX instructions. NFC.
Michael Zuckerman [Sun, 18 Dec 2016 14:29:00 +0000 (14:29 +0000)]
[X86] [AVX512] Minor fix in encoding of scalar EVEX instructions. NFC.

Commit on behalf of Gadi Haber

Removed EVEX_V512 prefix from scalar EVEX instructions since HW ignores L'L bits anyway (LIG). 4 instructions are modified.
The changed encodings are validated with XED.
Rviewers: delena, igorb

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

llvm-svn: 290065

7 years ago[X86][SSE] Add support for combining target shuffles to SHUFPS.
Simon Pilgrim [Sun, 18 Dec 2016 14:26:02 +0000 (14:26 +0000)]
[X86][SSE] Add support for combining target shuffles to SHUFPS.

As discussed on D27692, the next step will be to allow cross-domain shuffles once the combined shuffle depth passes a certain point.

llvm-svn: 290064

7 years agoWdocumentation fix
Simon Pilgrim [Sun, 18 Dec 2016 14:12:38 +0000 (14:12 +0000)]
Wdocumentation fix

llvm-svn: 290063

7 years agoRemove lld/Support/Memory.h.
Rui Ueyama [Sun, 18 Dec 2016 14:06:06 +0000 (14:06 +0000)]
Remove lld/Support/Memory.h.

I thought for a while about how to remove it, but it looks like we
can just copy the file for now. Of course I'm not happy about that,
but it's just less than 50 lines of code, and we already have
duplicate code in Error.h and some other places. I want to solve
them all at once later.

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

llvm-svn: 290062

7 years ago[FileCheck] Fix comment in ReadCheckFile
Tom de Vries [Sun, 18 Dec 2016 09:41:20 +0000 (09:41 +0000)]
[FileCheck] Fix comment in ReadCheckFile

The comment in ReadCheckFile claims that both leading and trailing whitespace
are removed, but the associated statement only removes leading whitespace.

llvm-svn: 290061

7 years ago[X86][SSE][AVX-512] Convert FAND/FOR/FXOR/FANDN nodes to integer operations if they...
Craig Topper [Sun, 18 Dec 2016 07:54:23 +0000 (07:54 +0000)]
[X86][SSE][AVX-512] Convert FAND/FOR/FXOR/FANDN nodes to integer operations if they are available. This will allow a bunch of patterns to be removed.

These nodes are only emitted for lowering FABS/FNEG/FNABS/FCOPYSIGN. Ideally we just wouldn't create these nodes if SSE2 or higher is available, but it was simple to just convert them in DAG combine.

For SSE2, AVX, and AVX512 with DQI this is no functional change as the execution domain fixing pass ensures the right domain is selected regardless of the ISD opcode.

For AVX-512 without DQI we end up using integer instructions since the floating point versions aren't available. But we were already doing that for any logical operations in code that didn't come from FABS/FNEG/FNABS/FCOPYSIGN so this seems no worse. And we get the benefit of being able to fold broadcasts now.

llvm-svn: 290060

7 years agoFix a lit test issue exposed by r290056
Yaxun Liu [Sun, 18 Dec 2016 07:26:01 +0000 (07:26 +0000)]
Fix a lit test issue exposed by r290056

The test requests a target which supports cl_khr_gl_msaa_sharing since in test/PCH/ocl_types.h
it tries to enable cl_khr_gl_msaa_sharing. Therefore this test fails on targets not supporting
cl_khr_gl_msaa_sharing, e.g. ppc64, etc.

The fix is to add triple spir-unknown-unknown which supports cl_khr_gl_msaa_sharing.

llvm-svn: 290059

7 years agoAttempt to fix build failure and regressions due to r290056
Yaxun Liu [Sun, 18 Dec 2016 06:35:06 +0000 (06:35 +0000)]
Attempt to fix build failure and regressions due to r290056

Add llvm:: namespace to StringRef.
Make conversion between bool and uint64_t explicit.

llvm-svn: 290058

7 years ago[AVX-512] Use EVEX encoded XOR instruction for zeroing scalar registers when DQI...
Craig Topper [Sun, 18 Dec 2016 06:23:14 +0000 (06:23 +0000)]
[AVX-512] Use EVEX encoded XOR instruction for zeroing scalar registers when DQI and VLX instructions are available.

This can give the register allocator more registers to use.

llvm-svn: 290057

7 years agoRecommit r289979 [OpenCL] Allow disabling types and declarations associated with...
Yaxun Liu [Sun, 18 Dec 2016 05:18:55 +0000 (05:18 +0000)]
Recommit r289979 [OpenCL] Allow disabling types and declarations associated with extensions

Fixed undefined behavior due to cast integer to bool in initializer list.

llvm-svn: 290056

7 years ago[AVX-512] Make sure VLX is also enabled before using EVEX encoded logic ops for scala...
Craig Topper [Sun, 18 Dec 2016 04:17:00 +0000 (04:17 +0000)]
[AVX-512] Make sure VLX is also enabled before using EVEX encoded logic ops for scalars. I missed this in r290049.

llvm-svn: 290055

7 years ago[PDB] Don't reimplement CRC32
David Majnemer [Sun, 18 Dec 2016 00:41:15 +0000 (00:41 +0000)]
[PDB] Don't reimplement CRC32

We already have a CRC32 implementation which is compatible with the PDB
hash, reuse it.

llvm-svn: 290054

7 years ago[PDB] Validate superblock addresses
David Majnemer [Sun, 18 Dec 2016 00:41:10 +0000 (00:41 +0000)]
[PDB] Validate superblock addresses

- Validate the address of the block map.
- Validate the address of the free block map.

llvm-svn: 290053

7 years ago[CMake] Fix issue reported on sanitizer bots
Chris Bieneman [Sat, 17 Dec 2016 21:28:24 +0000 (21:28 +0000)]
[CMake] Fix issue reported on sanitizer bots

This should resolve an issue reported on the commit thread that impacted sanitizer bots.

llvm-svn: 290052

7 years ago[clang-tidy] Remove duplicated check from move-constructor-init
Malcolm Parsons [Sat, 17 Dec 2016 20:23:14 +0000 (20:23 +0000)]
[clang-tidy] Remove duplicated check from move-constructor-init

Summary:
An addition to the move-constructor-init check was duplicating the
modernize-pass-by-value check.
Remove the additional check and UseCERTSemantics option.
Run the move-constructor-init test with both checks enabled.
Fix modernize-pass-by-value false-positive when initializing a base
class.
Add option to modernize-pass-by-value to only warn about parameters
that are already values.

Reviewers: alexfh, flx, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 290051

7 years agoAMDGPU: Fix broken check prefix in test
Matt Arsenault [Sat, 17 Dec 2016 20:03:59 +0000 (20:03 +0000)]
AMDGPU: Fix broken check prefix in test

llvm-svn: 290050

7 years ago[AVX-512] Use EVEX encoded logic operations for scalar types when they are available...
Craig Topper [Sat, 17 Dec 2016 19:26:00 +0000 (19:26 +0000)]
[AVX-512] Use EVEX encoded logic operations for scalar types when they are available. This gives the register allocator more registers to work with.

llvm-svn: 290049

7 years ago[AVX-512] Update scalar logic test to show missed opportunity to use EVEX encoded...
Craig Topper [Sat, 17 Dec 2016 19:25:55 +0000 (19:25 +0000)]
[AVX-512] Update scalar logic test to show missed opportunity to use EVEX encoded logic instructions to get more registers to use.

llvm-svn: 290048

7 years agoRevert "AArch64CollectLOH: Rewrite as block-local analysis."
Matthias Braun [Sat, 17 Dec 2016 18:53:11 +0000 (18:53 +0000)]
Revert "AArch64CollectLOH: Rewrite as block-local analysis."

It is still breaking Chrome. http://llvm.org/PR31361

This reverts commit r290026.

llvm-svn: 290047

7 years ago[InstCombine] Simplify code slightly. NFC
Craig Topper [Sat, 17 Dec 2016 18:10:04 +0000 (18:10 +0000)]
[InstCombine] Simplify code slightly. NFC

llvm-svn: 290046

7 years agoFix the cmake declaration syntax
Sylvestre Ledru [Sat, 17 Dec 2016 13:04:35 +0000 (13:04 +0000)]
Fix the cmake declaration syntax

llvm-svn: 290045

7 years agoSupport of lldb on Kfreebsd
Sylvestre Ledru [Sat, 17 Dec 2016 12:48:06 +0000 (12:48 +0000)]
Support of lldb on Kfreebsd

Summary: Patch by Pino Toscano. Reported in http://bugs.debian.org/835665

Reviewers: tfiala, emaste

Subscribers: beanz, mgorny, emaste, krytarowski, brucem, tberghammer, danalbert, srhines, #lldb

Tags: #lldb

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

llvm-svn: 290044

7 years agoRevert "[libFuzzer] add an experimental flag -experimental_len_control=1 that sets...
Daniel Jasper [Sat, 17 Dec 2016 12:27:49 +0000 (12:27 +0000)]
Revert "[libFuzzer] add an experimental flag -experimental_len_control=1 that sets max_len to 1M and tries to increases the actual max sizes of mutations very gradually. Also remove a bit of dead code"

This reverts commit r289998.

See comment:
https://reviews.llvm.org/rL289998

llvm-svn: 290043

7 years ago[ELF] - Use DWARFDebugPubTable parser class intead of hand-written parsing.
George Rimar [Sat, 17 Dec 2016 10:18:05 +0000 (10:18 +0000)]
[ELF] - Use DWARFDebugPubTable parser class intead of hand-written parsing.

DWARFDebugPubTable was introduced recently and allows us to get rid of
code duplication in LLD.

llvm-svn: 290042

7 years ago[DWARF] - Make PubIndexEntryDescriptor::toBits() to be const.
George Rimar [Sat, 17 Dec 2016 10:15:39 +0000 (10:15 +0000)]
[DWARF] - Make PubIndexEntryDescriptor::toBits() to be const.

That is usefull when iterating over entries of new DWARFDebugPubTable class
via DWARFDebugPubTable::getData which returns ArrayRef.

llvm-svn: 290041

7 years ago[DWARF] - Introduce DWARFDebugPubTable class for dumping pub* sections.
George Rimar [Sat, 17 Dec 2016 09:10:32 +0000 (09:10 +0000)]
[DWARF] - Introduce DWARFDebugPubTable class for dumping pub* sections.

Patch implements parser of pubnames/pubtypes tables instead of static
function used before. It is now should be possible to reuse it
in LLD or other projects and clean up the duplication code.

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

llvm-svn: 290040

7 years ago[libFuzzer] use less memory for merge
Kostya Serebryany [Sat, 17 Dec 2016 08:20:24 +0000 (08:20 +0000)]
[libFuzzer] use less memory for merge

llvm-svn: 290039

7 years ago[OpenMP] Sema and parsing for 'target teams' pragma
Kelvin Li [Sat, 17 Dec 2016 05:48:59 +0000 (05:48 +0000)]
[OpenMP] Sema and parsing for 'target teams' pragma

This patch is to implement sema and parsing for 'target teams' pragma.

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

llvm-svn: 290038

7 years agoAdd custom type for PseudoSourceValue
Tom Stellard [Sat, 17 Dec 2016 04:41:53 +0000 (04:41 +0000)]
Add custom type for PseudoSourceValue

Summary:
PseudoSourceValue can be used to attach a target specific value for "well behaved" side-effects lowered from target specific intrinsics.
This is useful whenever there is not an LLVM IR Value around when representing such "well behaved" side-effected operations in backends by attaching a MachineMemOperand with a custom PseudoSourceValue as this makes the scheduler not treating them as "GlobalMemoryObjects" which triggers a logic that makes the operation act like a barrier in the Schedule DAG.

This patch adds another Kind to the PseudoSourceValue object which is "TargetCustom". It indicates a type of PseudoSourceValue that has a target specific meaning (aka. LLVM shouldn't assume any specific usage for such a PSV).

It supports the possibility of having many different kinds of "TargetCustom" PseudoSourceValues.

We had a discussion about if this was valuable or not (in particular because there was a believe that PSV were going away sooner or later) but seems like they are not going anywhere and I think they are useful backend side.

It is not clear the interaction of this with MIRParser (do we need a target hook to parse these?) and I would like a comment from Alex about that :)

Reviewers: arphaman, hfinkel, arsenm

Subscribers: Eugene.Zelenko, llvm-commits

Patch By: Marcello Maggioni

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

llvm-svn: 290037

7 years agoADT: Add a getArrayRef() accessor to MapVector.
Peter Collingbourne [Sat, 17 Dec 2016 04:04:18 +0000 (04:04 +0000)]
ADT: Add a getArrayRef() accessor to MapVector.

llvm-svn: 290036

7 years ago[libFuzzer] speed up __sanitizer_cov_trace_switch a bit more (remove DIV)
Kostya Serebryany [Sat, 17 Dec 2016 02:23:35 +0000 (02:23 +0000)]
[libFuzzer] speed up __sanitizer_cov_trace_switch a bit more (remove DIV)

llvm-svn: 290034

7 years ago[libFuzzer] remove stale test
Kostya Serebryany [Sat, 17 Dec 2016 02:18:59 +0000 (02:18 +0000)]
[libFuzzer] remove stale test

llvm-svn: 290033

7 years agoMove test to correct directory
Matthias Braun [Sat, 17 Dec 2016 02:16:26 +0000 (02:16 +0000)]
Move test to correct directory

See also test/CodeGen/MIR/README

llvm-svn: 290032

7 years ago[libFuzzer] when tracing switch statements, handle only one case at a time (to make...
Kostya Serebryany [Sat, 17 Dec 2016 02:03:34 +0000 (02:03 +0000)]
[libFuzzer] when tracing switch statements, handle only one case at a time (to make things faster). Also ensure that the signals from value profile do not intersect with the regular coverage

llvm-svn: 290031

7 years agoRevert "[GVNHoist] Move GVNHoist to function simplification part of pipeline."
Evgeniy Stepanov [Sat, 17 Dec 2016 01:53:15 +0000 (01:53 +0000)]
Revert "[GVNHoist] Move GVNHoist to function simplification part of pipeline."

This reverts r289696, which caused TSan perf regression.

See PR31382.

llvm-svn: 290030

7 years agoFix compilation.
Evgeniy Stepanov [Sat, 17 Dec 2016 01:31:46 +0000 (01:31 +0000)]
Fix compilation.

unittests/ADT/TwineTest.cpp:106:38: error: field 'Count' will be initialized after base 'llvm::FormatAdapter<int>' [-Werror,-Wreorder]
    explicit formatter(int &Count) : Count(Count), FormatAdapter(0) {}

llvm-svn: 290029

7 years ago[Hexagon] Other attempt to fix build with enabled asserts broken in 290024 (NFC).
Eugene Zelenko [Sat, 17 Dec 2016 01:29:35 +0000 (01:29 +0000)]
[Hexagon] Other attempt to fix build with enabled asserts broken in 290024 (NFC).

llvm-svn: 290028

7 years ago[Hexagon] Fix build with enabled asserts broken in 290024 (NFC).
Eugene Zelenko [Sat, 17 Dec 2016 01:17:18 +0000 (01:17 +0000)]
[Hexagon] Fix build with enabled asserts broken in 290024 (NFC).

llvm-svn: 290027

7 years agoAArch64CollectLOH: Rewrite as block-local analysis.
Matthias Braun [Sat, 17 Dec 2016 01:15:59 +0000 (01:15 +0000)]
AArch64CollectLOH: Rewrite as block-local analysis.

Re-apply r288561: Liveness tracking should be correct now after r290014.

Previously this pass was using up to 5% compile time in some cases which
is a bit much for what it is doing. The pass featured a full blown
data-flow analysis which in the default configuration was restricted to a
single block.

This rewrites the pass under the assumption that we only ever work on a
single block. This is done in a single pass maintaining a state machine
per general purpose register to catch LOH patterns.

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

llvm-svn: 290026

7 years ago[libclang] Remove the 'extern "C"' blocks from the implementation files.
Argyrios Kyrtzidis [Sat, 17 Dec 2016 01:09:40 +0000 (01:09 +0000)]
[libclang] Remove the 'extern "C"' blocks from the implementation files.

These are unnecessary, the declarations already carry the 'extern C' property, and if there is mismatch
between declaration and definition then we will get linker errors via libclang.exports.

llvm-svn: 290025

7 years ago[Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Sat, 17 Dec 2016 01:09:05 +0000 (01:09 +0000)]
[Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 290024

7 years ago[analyzer] UnixAPIChecker: Don't diagnose for functions in C++ namespaces
Devin Coughlin [Sat, 17 Dec 2016 01:08:17 +0000 (01:08 +0000)]
[analyzer] UnixAPIChecker: Don't diagnose for functions in C++ namespaces

Update the UnixAPIChecker to not diagnose for calls to functions that
are declared in C++ namespaces. This avoids false positives when a
namespaced function has the same name as a Unix API.

This address PR28331.

llvm-svn: 290023

7 years agoRetry: [BPI] Use a safer constructor to calculate branch probabilities
Vedant Kumar [Sat, 17 Dec 2016 01:02:08 +0000 (01:02 +0000)]
Retry: [BPI] Use a safer constructor to calculate branch probabilities

BPI may trigger signed overflow UB while computing branch probabilities for
cold calls or to unreachables. For example, with our current choice of weights,
we'll crash if there are >= 2^12 branches to an unreachable.

Use a safer BranchProbability constructor which is better at handling fractions
with large denominators.

Changes since the initial commit:
  - Use explicit casts to ensure that multiplication operands are 64-bit
    ints.

rdar://problem/29368161

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

llvm-svn: 290022

7 years agoDelete unused file.
Zachary Turner [Sat, 17 Dec 2016 00:58:19 +0000 (00:58 +0000)]
Delete unused file.

llvm-svn: 290021

7 years agoAdd support for formatv to llvm::Twine.
Zachary Turner [Sat, 17 Dec 2016 00:38:15 +0000 (00:38 +0000)]
Add support for formatv to llvm::Twine.

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

llvm-svn: 290020

7 years agoRevert "[BPI] Use a safer constructor to calculate branch probabilities"
Vedant Kumar [Sat, 17 Dec 2016 00:19:06 +0000 (00:19 +0000)]
Revert "[BPI] Use a safer constructor to calculate branch probabilities"

This reverts commit r290016. It breaks this bot, even though the test
passes locally:

  http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/32956/

AnalysisTests: /home/bb/ninja-x64-msvc-RA-centos6/llvm-project/llvm/lib/Support/BranchProbability.cpp:52: static llvm::BranchProbability llvm::BranchProbability::getBranchProbability(uint64_t, uint64_t): Assertion `Numerator <= Denominator && "Probability cannot be bigger than 1!"' failed.
llvm-svn: 290019

7 years ago[libfuzzer] removing experimental FuzzerFnAdapter
Mike Aizatsky [Sat, 17 Dec 2016 00:12:13 +0000 (00:12 +0000)]
[libfuzzer] removing experimental FuzzerFnAdapter

Summary: This is superceded by protobuf mutation work.

Reviewers: kcc

Subscribers: mgorny

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

llvm-svn: 290018

7 years ago[sancov] skip dead files from computations
Mike Aizatsky [Sat, 17 Dec 2016 00:11:48 +0000 (00:11 +0000)]
[sancov] skip dead files from computations

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

llvm-svn: 290017

7 years ago[BPI] Use a safer constructor to calculate branch probabilities
Vedant Kumar [Sat, 17 Dec 2016 00:09:51 +0000 (00:09 +0000)]
[BPI] Use a safer constructor to calculate branch probabilities

BPI may trigger signed overflow UB while computing branch probabilities
for cold calls or to unreachables. For example, with our current choice
of weights, we'll crash if there are >= 2^12 branches to an unreachable.

Use a safer BranchProbability constructor which is better at handling
fractions with large denominators.

rdar://problem/29368161

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

llvm-svn: 290016

7 years ago[ORC][RPC] Use more meaningful template parameter names.
Lang Hames [Sat, 17 Dec 2016 00:04:24 +0000 (00:04 +0000)]
[ORC][RPC] Use more meaningful template parameter names.

llvm-svn: 290015

7 years agoAArch64: Enable post-ra liveness updates
Matthias Braun [Fri, 16 Dec 2016 23:55:43 +0000 (23:55 +0000)]
AArch64: Enable post-ra liveness updates

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

llvm-svn: 290014

7 years agoBranchRelaxation: Recompute live-ins when splitting a block
Matthias Braun [Fri, 16 Dec 2016 23:55:37 +0000 (23:55 +0000)]
BranchRelaxation: Recompute live-ins when splitting a block

Factors out and reuses live-in computation code from BranchFolding.

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

llvm-svn: 290013

7 years agoAllow "line 0" to be the first explicit debug location in a function.
Paul Robinson [Fri, 16 Dec 2016 23:54:33 +0000 (23:54 +0000)]
Allow "line 0" to be the first explicit debug location in a function.

Feedback on r289468 from Adrian Prantl.

llvm-svn: 290012

7 years agoGDB pretty printers: Basic DenseMap support
David Blaikie [Fri, 16 Dec 2016 23:53:14 +0000 (23:53 +0000)]
GDB pretty printers: Basic DenseMap support

Still prints the empty/tombstone keys (which some people would prefer,
but I find pretty noisy) because I haven't yet found a reliable way to
skip them (it requires calling into the running process to do so, which
isn't ideal for a pretty printer (doesn't work on a core file, for
example) - and gdb's ability to do so (or my ability to figure out how
to get gdb to do so) is limited) left some breadcrumbs for the next
person who might try to address that.

llvm-svn: 290011

7 years agoAdded clangLex to the dependencies for clang-import-test.
Sean Callanan [Fri, 16 Dec 2016 23:45:03 +0000 (23:45 +0000)]
Added clangLex to the dependencies for clang-import-test.

This is part of the effort to get the i686-mingw32-RA-on-linux bot to like clang-import-test.

llvm-svn: 290010

7 years agoFix MSVC build of libclang after r288438
Reid Kleckner [Fri, 16 Dec 2016 23:44:44 +0000 (23:44 +0000)]
Fix MSVC build of libclang after r288438

llvm-svn: 290009

7 years agoAdd explicit triple to test to fix arm bots.
Peter Collingbourne [Fri, 16 Dec 2016 23:43:51 +0000 (23:43 +0000)]
Add explicit triple to test to fix arm bots.

llvm-svn: 290008

7 years agoAdd isl_multi_pw_aff to GICHelper
Alexandre Isoard [Fri, 16 Dec 2016 23:41:26 +0000 (23:41 +0000)]
Add isl_multi_pw_aff to GICHelper

Add isl_multi_pw_aff* to GICHelper and add some missing isl_pw_multi_aff* handlers.

llvm-svn: 290007

7 years agoFixed library dependencies on clang-import-test to clean up the bots.
Sean Callanan [Fri, 16 Dec 2016 23:34:16 +0000 (23:34 +0000)]
Fixed library dependencies on clang-import-test to clean up the bots.

llvm-svn: 290006

7 years ago[analyzer] Extend UnixAPIChecker open() checks to handle openat().
Devin Coughlin [Fri, 16 Dec 2016 23:31:56 +0000 (23:31 +0000)]
[analyzer] Extend UnixAPIChecker open() checks to handle openat().

The openat() API has similar constraints to the open() API -- it just takes
an extra parameter.

rdar://problem/29526458

llvm-svn: 290005

7 years agoTestbed and skeleton of a new expression parser
Sean Callanan [Fri, 16 Dec 2016 23:21:38 +0000 (23:21 +0000)]
Testbed and skeleton of a new expression parser

LLVM's JIT is now the foundation of dynamic-compilation features for many languages. Clang also has low-level support for dynamic compilation (ASTImporter and ExternalASTSource, notably). How the compiler is set up for dynamic parsing is generally left up to individual clients, for example LLDB's C/C++/Objective-C expression parser and the ROOT project.

Although this arrangement offers external clients the flexibility to implement dynamic features as they see fit, the lack of an in-tree client means that subtle bugs can be introduced that cause regressions in the external clients but aren't caught by tests (or users) until much later. LLDB for example regularly encounters complicated ODR violation scenarios where it is not immediately clear who is at fault.

Other external clients (notably, Cling) rely on similar functionality, and another goal is to break this functionality up into composable parts so that any client can be built easily on top of Clang without requiring extensive additional code.

I propose that the parts required to build a simple expression parser be added to Clang.  Initially, I aim to have the following features:

- A piece that looks up external declarations from a variety of sources (e.g., from previous dynamic compilations, from modules, or from DWARF) and uses clear conflict resolution rules to reconcile differences, with easily understood errors. This functionality will be supported by in-tree tests.

- A piece that works hand in hand with the LLVM JIT to resolve the locations of external declarations so that e.g. variables can be redeclared and (for high-performance applications like DTrace) external variables can be accessed directly from the registers where they reside.

This commit adds a tester that parses a sequence of source files and then uses them as source data for an expression. External references are resolved using an ExternalASTSource that responds to name queries using an ASTImporter. This is the setup that LLDB uses, and the motivating reason for MinimalImport in ASTImporter.  When complete, this tester will implement the first of the above goals.

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

llvm-svn: 290004

7 years agoModuleSummaryAnalysis: Remove some duplicate code. NFCI.
Peter Collingbourne [Fri, 16 Dec 2016 23:19:02 +0000 (23:19 +0000)]
ModuleSummaryAnalysis: Remove some duplicate code. NFCI.

llvm-svn: 290003

7 years agoFix compiler warning.
Zachary Turner [Fri, 16 Dec 2016 23:12:58 +0000 (23:12 +0000)]
Fix compiler warning.

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

llvm-svn: 290002

7 years agoFix a bugs with using some Mach-O command line flags like "-arch armv7m".
Kevin Enderby [Fri, 16 Dec 2016 22:54:02 +0000 (22:54 +0000)]
Fix a bugs with using some Mach-O command line flags like "-arch armv7m".

The Mach-O command line flag like "-arch armv7m" does not match the
arch name part of its llvm Triple which is "thumbv7m-apple-darwin”.

I think the best way to fix this is to have
llvm::object::MachOObjectFile::getArchTriple() optionally return the
name of the Mach-O arch flag that would be used with -arch that
matches the CPUType and CPUSubType.  Then change
llvm::object::MachOUniversalBinary::ObjectForArch::getArchTypeName()
to use that and change it to getArchFlagName() as the type name is
really part of the Triple and the -arch flag name is a Mach-O thing
for a specific Triple with a specific Mcpu value.

rdar://29663637

llvm-svn: 290001

7 years agoResubmit "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."
Zachary Turner [Fri, 16 Dec 2016 22:48:14 +0000 (22:48 +0000)]
Resubmit "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."

The original patch was broken due to some undefined behavior
as well as warnings that were triggering -Werror.

llvm-svn: 290000

7 years ago[libFuzzer] avoid msan false positives in more cases
Kostya Serebryany [Fri, 16 Dec 2016 22:45:25 +0000 (22:45 +0000)]
[libFuzzer] avoid msan false positives in more cases

llvm-svn: 289999

7 years ago[libFuzzer] add an experimental flag -experimental_len_control=1 that sets max_len...
Kostya Serebryany [Fri, 16 Dec 2016 22:42:05 +0000 (22:42 +0000)]
[libFuzzer] add an experimental flag -experimental_len_control=1 that sets max_len to 1M and tries to increases the actual max sizes of mutations very gradually. Also remove a bit of dead code

llvm-svn: 289998

7 years agoReally revert all changes from r289979. Apparently conflict resolution failed
Reid Kleckner [Fri, 16 Dec 2016 22:11:28 +0000 (22:11 +0000)]
Really revert all changes from r289979. Apparently conflict resolution failed

llvm-svn: 289997

7 years agoIRGen: Fix assertion failure when creating debug info for an integer constant wider...
Peter Collingbourne [Fri, 16 Dec 2016 22:10:52 +0000 (22:10 +0000)]
IRGen: Fix assertion failure when creating debug info for an integer constant wider than 64 bits.

llvm-svn: 289996

7 years ago[libclang] Restore the CXXRecordDecl path for clang_Type_getNumTemplateArguments...
Argyrios Kyrtzidis [Fri, 16 Dec 2016 21:40:16 +0000 (21:40 +0000)]
[libclang] Restore the CXXRecordDecl path for clang_Type_getNumTemplateArguments and clang_Type_getTemplateArgumentAsType

Patch by Emilio Cobos Álvarez!
See https://reviews.llvm.org/D26907

llvm-svn: 289995

7 years agoFix compiler warning.
Zachary Turner [Fri, 16 Dec 2016 21:35:12 +0000 (21:35 +0000)]
Fix compiler warning.

llvm-svn: 289994

7 years ago[ThinLTO] Import composite types as declarations
Teresa Johnson [Fri, 16 Dec 2016 21:25:01 +0000 (21:25 +0000)]
[ThinLTO] Import composite types as declarations

Summary:
When reading the metadata bitcode, create a type declaration when
possible for composite types when we are importing. Doing this in
the bitcode reader saves memory. Also it works naturally in the case
when the type ODR map contains a definition for the same composite type
because it was used in the importing module (buildODRType will
automatically use the existing definition and not create a type
declaration).

For Chromium built with -g2, this reduces the aggregate size of the
generated native object files by 66% (from 31G to 10G). It reduced
the time through the ThinLTO link and backend phases by about 20% on
my machine.

Reviewers: mehdi_amini, dblaikie, aprantl

Subscribers: llvm-commits

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

llvm-svn: 289993

7 years agoPreserve loop metadata when folding branches to a common destination.
Michael Kuperstein [Fri, 16 Dec 2016 21:23:59 +0000 (21:23 +0000)]
Preserve loop metadata when folding branches to a common destination.

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

llvm-svn: 289992

7 years agoRevert r289979 due to regressions
Yaxun Liu [Fri, 16 Dec 2016 21:23:55 +0000 (21:23 +0000)]
Revert r289979 due to regressions

llvm-svn: 289991

7 years ago[Sema] Transform the default arguments of a lambda expression when the
Akira Hatanaka [Fri, 16 Dec 2016 21:16:57 +0000 (21:16 +0000)]
[Sema] Transform the default arguments of a lambda expression when the
lambda expression is instantiated.

Rather than waiting until Sema::CheckCXXDefaultArgExpr tries to
transform the default arguments (which fails because it can't get the
template arguments that are used), transform the default arguments
earlier when the lambda expression is transformed in
TransformLambdaExpr.

rdar://problem/27535319

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

llvm-svn: 289990

7 years ago[OpenMP] support the 'is_device_ptr' clause with 'target parallel' pragma
Kelvin Li [Fri, 16 Dec 2016 20:50:46 +0000 (20:50 +0000)]
[OpenMP] support the 'is_device_ptr' clause with 'target parallel' pragma

This patch is to add support of the 'is_device_ptr' clause in the 'target parallel' pragma.

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

llvm-svn: 289989

7 years ago[CodeGenPrep] Skip merging empty case blocks
Jun Bum Lim [Fri, 16 Dec 2016 20:38:39 +0000 (20:38 +0000)]
[CodeGenPrep] Skip merging empty case blocks

This is recommit of r287553 after fixing the invalid loop info after eliminating an empty block and unit test failures in AVR and WebAssembly :

Summary: Merging an empty case block into the header block of switch could cause ISel to add COPY instructions in the header of switch, instead of the case block, if the case block is used as an incoming block of a PHI. This could potentially increase dynamic instructions, especially when the switch is in a loop. I added a test case which was reduced from the benchmark I was targetting.

Reviewers: t.p.northover, mcrosier, manmanren, wmi, joerg, davidxl

Subscribers: joerg, qcolombet, danielcdh, hfinkel, mcrosier, llvm-commits

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

llvm-svn: 289988

7 years agoInline stripInvariantGroupMetadata out of existence
Sanjoy Das [Fri, 16 Dec 2016 20:29:39 +0000 (20:29 +0000)]
Inline stripInvariantGroupMetadata out of existence

As a one liner function, I don't think it is pulling its weight in terms
of helping readability.

llvm-svn: 289987

7 years agoRemove the temporary fix to the RUN line that was committed in r289924.
Akira Hatanaka [Fri, 16 Dec 2016 20:25:11 +0000 (20:25 +0000)]
Remove the temporary fix to the RUN line that was committed in r289924.

Also, dump the AST and run FileCheck to make sure the expected nodes are
created in the AST.

llvm-svn: 289986

7 years agoFix clang build
Zachary Turner [Fri, 16 Dec 2016 19:49:14 +0000 (19:49 +0000)]
Fix clang build

llvm-svn: 289985

7 years agoRevert "Update for LLVM global variable debug info API change."
Adrian Prantl [Fri, 16 Dec 2016 19:39:18 +0000 (19:39 +0000)]
Revert "Update for LLVM global variable debug info API change."

This reverts commit r289921.

llvm-svn: 289984

7 years agoRevert "Fix debug info metadata for upstream change in LLVM."
Adrian Prantl [Fri, 16 Dec 2016 19:39:18 +0000 (19:39 +0000)]
Revert "Fix debug info metadata for upstream change in LLVM."

llvm-svn: 289983

7 years agoRevert "[IR] Remove the DIExpression field from DIGlobalVariable."
Adrian Prantl [Fri, 16 Dec 2016 19:39:01 +0000 (19:39 +0000)]
Revert "[IR] Remove the DIExpression field from DIGlobalVariable."

This reverts commit 289920 (again).
I forgot to implement a Bitcode upgrade for the case where a DIGlobalVariable
has not DIExpression. Unfortunately it is not possible to safely upgrade
these variables without adding a flag to the bitcode record indicating which
version they are.
My plan of record is to roll the planned follow-up patch that adds a
unit: field to DIGlobalVariable into this patch before recomitting.
This way we only need one Bitcode upgrade for both changes (with a
version flag in the bitcode record to safely distinguish the record
formats).

Sorry for the churn!

llvm-svn: 289982

7 years agoRevert "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."
Zachary Turner [Fri, 16 Dec 2016 19:25:23 +0000 (19:25 +0000)]
Revert "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."

This reverts commit r289978, which is failing due to some rebase/merge
issues.

llvm-svn: 289981

7 years agoFix comment on the verifier (typo + doxygen) (NFC)
Mehdi Amini [Fri, 16 Dec 2016 19:24:13 +0000 (19:24 +0000)]
Fix comment on the verifier (typo + doxygen) (NFC)

llvm-svn: 289980

7 years ago[OpenCL] Allow disabling types and declarations associated with extensions
Yaxun Liu [Fri, 16 Dec 2016 19:22:08 +0000 (19:22 +0000)]
[OpenCL] Allow disabling types and declarations associated with extensions

Added a map to associate types and declarations with extensions.

Refactored existing diagnostic for disabled types associated with extensions and extended it to declarations for generic situation.

Fixed some bugs for types associated with extensions.

Allow users to use pragma to declare types and functions for supported extensions, e.g.

#pragma OPENCL EXTENSION the_new_extension_name : begin
// declare types and functions associated with the extension here
#pragma OPENCL EXTENSION the_new_extension_name : end

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

llvm-svn: 289979

7 years ago[CodeView] Hook CodeViewRecordIO for reading/writing symbols.
Zachary Turner [Fri, 16 Dec 2016 19:20:35 +0000 (19:20 +0000)]
[CodeView] Hook CodeViewRecordIO for reading/writing symbols.

This is the 3rd of 3 patches to get reading and writing of
CodeView symbol and type records to use a single codepath.

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

llvm-svn: 289978