Commit Graph

251435 Commits

Author SHA1 Message Date
Pavel Labath d338381077 Fix MSVC build failure introduced in r291431
MSVC does not like to reinterpret_cast to a uint64_t. Use a different cast
instead.

llvm-svn: 291435
2017-01-09 11:20:35 +00:00
Daniel Jasper c941e7d21b clang-format: Improve support for override/final as variable names.
Before:
  bool a = f() &&override.f();
  bool a = f() &&final.f();
  void f(const MyOverride & override);
  void f(const MyFinal & final);

After:
  bool a = f() && override.f();
  bool a = f() && final.f();
  void f(const MyOverride &override);
  void f(const MyFinal &final);

llvm-svn: 291434
2017-01-09 11:04:07 +00:00
Asiri Rathnayake b71c89913c [libcxx] Fix externally-threaded shared library builds after r291275.
Need to allow unresolved symbols in the dylib. This was previously done for
LIBCXX_HAS_EXTERNAL_THREAD_API, but we have since split that into two with
LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY being the externally-threaded variant.

Also a minor CMakeLists.txt cleanup.

llvm-svn: 291433
2017-01-09 10:38:56 +00:00
Pavel Labath c9fa114b28 [lld][cmake] Fix LLVM_LINK_LLVM_DYLIB build
Summary:
Lld's build had a couple of issues which prevented a successfull
LLVM_LINK_LLVM_DYLIB compilation.

- add_llvm_library vs llvm_add_library: One adds a library to libLLVM.so, other
  one doesn't. Lld was using the wrong one, causing symbols to be mupltiply
  defined in things linking to libLLVM.
- confusion when to use LINK_LIBS vs LINK_COMPONENTS in llvm_add_library
- not using LLVM_LINK_COMPONENTS for add_lld_tool

With these fixes lld compiles and it's test suite passes both in
LLVM_LINK_LLVM_DYLIB mode and without it.

Reviewers: ruiu, beanz

Subscribers: llvm-commits, mgorny

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

llvm-svn: 291432
2017-01-09 09:57:08 +00:00
Eugene Leviant be2d68f774 RuntimeDyldELF: don't create thunk if not needed
This patch doesn't create thunk for branch operation when following conditions are met:
- Architecture is AArch64
- Relocation target is in the same object file
- Relocation target is close enough to be encoded in immediate offset

In such case we branch directly to the target instead of branching to thunk

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

llvm-svn: 291431
2017-01-09 09:56:31 +00:00
Gabor Horvath 3d57457298 [analyzer] Add checker for iterators dereferenced beyond their range.
Patch by: Adam Balogh!

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

llvm-svn: 291430
2017-01-09 09:52:32 +00:00
Martin Probst fd18ec5885 clang-format: [JS] fix broken test.
llvm-svn: 291429
2017-01-09 09:00:58 +00:00
Martin Probst d40bca431d clang-format: [JS] ASI after imports
Summary:
Automatic semicolon insertion should break import and export statements:

Before, this would format on one line:

  // Note: no semi after 'x' below!
  import {x} from 'x'
  export function foo() {}

Into:
  import {x} from 'x' export function foo() {}

With this change, the statements get separated.

This also improves automatic semicolon insertion to consider closing
braces preceding declarations and statements.

Reviewers: klimek

Subscribers: cfe-commits

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

llvm-svn: 291428
2017-01-09 08:56:36 +00:00
Richard Smith 6eedfe77c1 Implement C++ DR1391 (wg21.link/cwg1391)
Check for implicit conversion sequences for non-dependent function
template parameters between deduction and substitution. The idea is to accept
as many cases as possible, on the basis that substitution failure outside the
immediate context is much more common during substitution than during implicit
conversion sequence formation.

This re-commits r290808, reverted in r290811 and r291412, with a couple of
fixes for handling of explicitly-specified non-trailing template argument
packs.

llvm-svn: 291427
2017-01-09 08:01:21 +00:00
Chandler Carruth 082c183f06 [PM] Teach SCEV to invalidate itself when its dependencies become
invalid.

This fixes use-after-free bugs that will arise with any interesting use
of SCEV.

I've added a dedicated test that works diligently to trigger these kinds
of bugs in the new pass manager and also checks for them explicitly as
well as triggering ASan failures when things go squirly.

llvm-svn: 291426
2017-01-09 07:44:34 +00:00
Richard Smith de0d34a576 Implement DR1388 (wg21.link/cwg1388).
This issue clarifies how deduction proceeds past a non-trailing function
parameter pack. Essentially, the pack itself is skipped and consumes no
arguments (except for those implied by an explicitly-specified template
arguments), and nothing is deduced from it. As a small fix to the standard's
rule, we do not allow subsequent deduction to change the length of the function
parameter pack (by preventing extension of the explicitly-specified pack if
present, and otherwise deducing all contained packs to empty packs).

llvm-svn: 291425
2017-01-09 07:14:40 +00:00
Dan Gohman 2aae5dc713 [WebAssembly] Fix the opcode values for i64.eq and i64.ne.
llvm-svn: 291424
2017-01-09 06:21:28 +00:00
Jonas Paulsson cf7543c44b Remove unused method in LoopVectorize.cpp.
computeInterleaveCount() is not defined/used and is therefore removed.

Review: Davide Italiano
llvm-svn: 291423
2017-01-09 06:13:21 +00:00
George Burgess IV 8af74a4a20 Add release notes for `diagnose_if`
Bots seem happy with `diagnose_if` so far, so I'm optimistically adding
release notes for it.

llvm-svn: 291422
2017-01-09 05:58:18 +00:00
Daniel Berlin b755aea8eb NewGVN: Fix PR 31573, a failure to verify memory congruency due to
not excluding ourselves when checking if any equivalent stores
exist.

llvm-svn: 291421
2017-01-09 05:34:29 +00:00
Daniel Berlin 2f1fbcc718 NewGVN: Change a std::vector to SmallVector and cleanup naming.
llvm-svn: 291420
2017-01-09 05:34:19 +00:00
Craig Topper 96ab6fd2eb [AVX-512] Change another pattern that was using BLENDM to use masked moves. A future patch will conver it back to BLENDM if its beneficial to register allocation.
llvm-svn: 291419
2017-01-09 04:19:34 +00:00
George Burgess IV 177399e227 Add the diagnose_if attribute to clang.
`diagnose_if` can be used to have clang emit either warnings or errors
for function calls that meet user-specified conditions. For example:

```
constexpr int foo(int a)
  __attribute__((diagnose_if(a > 10, "configurations with a > 10 are "
                                      "expensive.", "warning")));

int f1 = foo(9);
int f2 = foo(10); // warning: configuration with a > 10 are expensive.
int f3 = foo(f2);
```

It currently only emits diagnostics in cases where the condition is
guaranteed to always be true. So, the following code will emit no
warnings:

```
constexpr int bar(int a) {
  foo(a);
  return 0;
}

constexpr int i = bar(10);
```

We hope to support optionally emitting diagnostics for cases like that
(and emitting runtime checks) in the future.

Release notes will appear shortly. :)

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

llvm-svn: 291418
2017-01-09 04:12:14 +00:00
Francis Ricci ff567a8ba2 Enable weak hooks on darwin
Summary:
By default, darwin requires a definition for weak interface functions at
link time. Adding the '-U' link flag with each weak function allows these
weak interface functions to be used without definitions, which mirrors
behavior on linux and windows.

Reviewers: compnerd, eugenis

Subscribers: kubabrecka, mgorny, llvm-commits

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

llvm-svn: 291417
2017-01-09 03:51:42 +00:00
Faisal Vali c72a08c1f6 [cxx1z-constexpr-lambda] Implement constant evaluation of non-capturing lambda expressions.
Add a visitor for lambda expressions to RecordExprEvaluator in ExprConstant.cpp that creates an empty APValue of Struct type to represent the closure object. Additionally, add a LambdaExpr visitor to the TemporaryExprEvaluator that forwards constant evaluation of immediately-called-lambda-expressions to the one in RecordExprEvaluator through VisitConstructExpr.

This patch supports:
constexpr auto ID = [] (auto a) { return a; };
static_assert(ID(3.14) == 3.14);
static_assert([](auto a) { return a + 1; }(10) == 11);

Lambda captures are still not supported for constexpr lambdas.

llvm-svn: 291416
2017-01-09 03:02:53 +00:00
Craig Topper 6393afce97 [AVX-512] Add patterns to use a zero masked VPTERNLOG instruction for vselects of all ones and all zeros.
Previously we emitted a VPTERNLOG and a separate masked move.

llvm-svn: 291415
2017-01-09 02:44:34 +00:00
Rui Ueyama 3e6490399e Define sys::path::convert_to_slash
This patch moves convertToUnixPathSeparator from LLD to LLVM.

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

llvm-svn: 291414
2017-01-09 01:47:15 +00:00
Rui Ueyama ec1c75e059 Add linker-script-included files to reproduce tar files.
Previously, files added using INCLUDE directive weren't added
to reproduce archives. In this patch, I defined a function to
open a file and use that from Driver and LinkerScript.

llvm-svn: 291413
2017-01-09 01:42:02 +00:00
Richard Smith 7950d82ab5 Revert r291410 and r291411.
The test-suite bots are still failing even after r291410's fix.

llvm-svn: 291412
2017-01-09 01:18:18 +00:00
Richard Smith 1e7f386a64 Fix test for targets whose preferred spelling for an 8-byte int is 'long long', not 'long'.
llvm-svn: 291411
2017-01-09 01:10:14 +00:00
Richard Smith d22652122d Implement C++ DR1391 (wg21.link/cwg1391)
Check for implicit conversion sequences for non-dependent function
template parameters between deduction and substitution. The idea is to accept
as many cases as possible, on the basis that substitution failure outside the
immediate context is much more common during substitution than during implicit
conversion sequence formation.

This re-commits r290808, reverted in r290811, with a fix for handling of
explicitly-specified template argument packs.

llvm-svn: 291410
2017-01-09 00:43:47 +00:00
Argyrios Kyrtzidis e24f5e204b [index] Introduce SymbolSubKind for reporting language-specific details.
Initially reports if a constructor symbol is a copy or move constructor.

llvm-svn: 291409
2017-01-08 23:21:35 +00:00
Benjamin Kramer 796c1d9b54 Use the correct ObjC EH personality
This fixes ObjC exceptions on Win64 (which uses SEH), among others.

Patch by Jonathan Schleifer!

llvm-svn: 291408
2017-01-08 22:58:07 +00:00
Richard Smith 32b4376402 PR31514: Add recursive self-instantiation check during template argument
deduction in partial ordering.

This prevents us from crashing due to attempting to instantiate the same class
template specialization definition multiple times. (Debug builds also appear to
sometimes hit the stack limit before hitting the instantiation depth limit in
this case.)

llvm-svn: 291407
2017-01-08 22:45:21 +00:00
Mehdi Amini e4c7f12274 CommandLine option: Relax the assertion introduced in r290467 to allows for empty string
This is used in LDC for custom boolean commandline options, setArgStr
is called with an empty string before using AddLiteralOption.

llvm-svn: 291406
2017-01-08 22:30:43 +00:00
Piotr Padlewski 09ad678bc4 [MemDep] NFC walk invariant.group graph only down
Summary:
By using stripPointerCasts we can get to the root
value and then walk down the bitcast graph

Reviewers: reames

Subscribers: llvm-commits

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

llvm-svn: 291405
2017-01-08 22:26:06 +00:00
Davide Italiano 362cc7b0fd [LCSSA] Fix some typos. NFCI.
llvm-svn: 291404
2017-01-08 22:22:09 +00:00
Richard Smith f9c59b7122 PR30305: Implement proposed DR resolution to prevent slicing via inherited constructor.
The rule we use is that a construction of a class type T from an argument of
type U cannot use an inherited constructor if U is the same as T or is derived
from T (or if the initialization would first convert it to such a type). This
(approximately) matches the rule in use by GCC, and matches the current proposed
DR resolution.

llvm-svn: 291403
2017-01-08 21:45:44 +00:00
Craig Topper f51ba1e3da [AVX-512] If avx512dq is available use vpmovm2d/vpmovm2q instead of vselect of zeroes/ones when handling sign extends of i1 without VLX.
llvm-svn: 291402
2017-01-08 21:32:30 +00:00
Craig Topper 0930a523cc [X86] Add avx512bw and avx512dq command lines to the vector compare results test.
This is preparation for improving a case with avx512dq.

llvm-svn: 291401
2017-01-08 21:32:26 +00:00
Davide Italiano 1a12522e87 [SCCP] Unknown instructions are sent to overdefined anyway. NFCI.
llvm-svn: 291400
2017-01-08 21:19:05 +00:00
Lang Hames ec97c706cb [Orc][RPC] Lock the pending results data structure when installing new result
handlers, make abandonPendingResults public API.

This should make installing asynchronous result handlers thread safe.

The abandonPendingResults method is made public so that clients can disconnect
from a remote even if they have asynchronous handlers awaing results from that
remote. The asynchronous handlers will all receive "abandoned result" errors as
their argument.

llvm-svn: 291399
2017-01-08 20:09:35 +00:00
Saleem Abdulrasool 1d84d9ac48 llvm-objdump: speed up -objc-meta-data
Running a Debug build of objdump -objc-meta-data with a large Mach-O file is
currently unnecessarily slow.

With some local test input, this change reduces the run time from 75-85s down
to 15-20s.

The two changes are:
  Assert on pointer equality not array equality
  Replace vector<pair<address, symbol>> with DenseMap<address, symbol>

Additionally, use a std::unique_ptr rather than handling the memory manually.

Patch by Dave Lee!

llvm-svn: 291398
2017-01-08 19:14:15 +00:00
Faisal Vali d92e7499fb [cxx1z-constexpr-lambda] Make conversion function constexpr, and teach the expression-evaluator to evaluate the static-invoker.
This patch has been sitting in review hell since july 2016 and our lack of constexpr lambda support is getting embarrassing (given that I've had a branch that implements the feature (modulo *this capture) for over a year.  While in Issaquah I was enjoying shamelessly trying to convince folks of the lie that this was Richard's fault ;) I won't be able to do so in Kona since I won't be attending - so I'm going to aim to have this feature be implemented by then.

I'm quite confident of the approach in this patch, which simply maps the static-invoker 'thunk' back to the corresponding call-operator (specialization).

Thanks!

llvm-svn: 291397
2017-01-08 18:56:11 +00:00
Weiming Zhao ccd3e6803c [Builtins] [ARM] Adding Thumb1 support for fcmp
Summary: Mainly translate IT block into cmp/branch for functions in comparesf2.S

Reviewers: rengolin, compnerd

Subscribers: aemerson, llvm-commits

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

llvm-svn: 291396
2017-01-08 18:51:12 +00:00
Simon Pilgrim e6d948b857 Strip trailing whitespace.
llvm-svn: 291395
2017-01-08 18:37:42 +00:00
Saleem Abdulrasool 84d75f8337 unittest: remove extraneous ';'
Silences a warning from gcc:6.  NFC

llvm-svn: 291394
2017-01-08 18:36:49 +00:00
Simon Pilgrim b2a80950fe Fix line endings and strip trailing whitespace.
llvm-svn: 291393
2017-01-08 16:45:39 +00:00
Sanjay Patel bf51c8a975 [x86] fix usage of stale operands when lowering select
I noticed this problem as part of the ongoing attempt to canonicalize min/max ops in IR.

The debug output shows nodes like this:

t4: i32 = xor t2, Constant:i32<-1>
    t21: i8 = setcc t4, Constant:i32<0>, setlt:ch
  t14: i32 = select t21, t4, Constant:i32<-1>

And because the select is holding onto the t4 (xor) node while EmitTest creates a new 
x86-specific xor node, the lowering results in:

  t4: i32 = xor t2, Constant:i32<-1>
  t25: i32,i32 = X86ISD::XOR t2, Constant:i32<-1>
t28: i32,glue = X86ISD::CMOV Constant:i32<-1>, t4, Constant:i8<15>, t25:1

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

llvm-svn: 291392
2017-01-08 15:53:40 +00:00
Simon Pilgrim 9c58950eeb [CostModel][X86] Fixed vXi8 uniform shift costs.
The 'fast' costs should only work for shifts by uniform constants (uniform non-constant are lowered using the slow default implementation).

Logical shifts were not taking into account that we must mask the psrlw result, so the costs needed to be doubled.

Added missing AVX2/AVX512BW costs as well.

llvm-svn: 291391
2017-01-08 14:14:36 +00:00
Simon Pilgrim 1fa5487c05 [CostModel][X86] Moved legal uniform shift costs earlier.
XOP was prematurely matching, doubling the cost of ashr/lshr uniform shifts.

llvm-svn: 291390
2017-01-08 13:12:03 +00:00
Jonas Hahnfeld 1cdcf8f8c6 Fix tests with CLANG_DEFAULT_LINKER
I originally requested this to be tested in D25263 but in the end
forgot to make sure that it was done.

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

llvm-svn: 291389
2017-01-08 10:04:07 +00:00
Tobias Grosser 9e2dceba19 www: Add dates RSS news
llvm-svn: 291388
2017-01-08 09:28:10 +00:00
Tobias Grosser be6f9f24ba www: add rss feeds from pollylabs.org and polyhedral.info
llvm-svn: 291387
2017-01-08 09:14:39 +00:00
Tobias Grosser b1e9eed9bc www: add Polly Labs named link
llvm-svn: 291386
2017-01-08 08:31:38 +00:00