Commit Graph

251575 Commits

Author SHA1 Message Date
Dylan McKay 8fa6d8db9c [AVR] Implement TargetLoweing::getRegisterByName
This allows the use of the 'read_register' intrinsics used by clang's
named register globals features.

llvm-svn: 291375
2017-01-07 23:39:47 +00:00
Lang Hames d65748652b [Orc][RPC] Rename Single/MultiThreadedRPC to Single/MultithreadedRPCEndpoint.
llvm-svn: 291374
2017-01-07 22:48:12 +00:00
Lang Hames d659557b5d [Orc][RPC] Remove a redundant 'if' statement.
llvm-svn: 291373
2017-01-07 22:27:52 +00:00
Simon Pilgrim 9681c407b4 [CostModel][X86] Update SSE41/AVX1 vXi32 SHL costs
SSE41 provides pmulld which allows the simpler pslld/paddd/cvttps2dq/pmulld pattern than SSE2's use of pmuludq.

llvm-svn: 291372
2017-01-07 22:27:43 +00:00
Craig Topper a74e3088df [AVX-512] Remove patterns from the other VBLENDM instructions. They are all redundant with masked move instructions.
We should probably teach the two address instruction pass to turn masked moves into BLENDM when its beneficial to the register allocator.

llvm-svn: 291371
2017-01-07 22:20:34 +00:00
Craig Topper 2d02d4926b [X86] Regenerate a test to remove tab characters.
llvm-svn: 291370
2017-01-07 22:20:28 +00:00
Craig Topper 81f20aa336 [AVX-512] Remove patterns from masked broadcast versions of BLENDM instructions.
All but (v2f64 broadcast f64) are handled with VBROADCAST instructions. The v2f64 version can be handled with VMOVDDUP.

We may want to consider converting to BLENDM instructions in the two address instruction pass if its beneficial to register allocation.

llvm-svn: 291369
2017-01-07 22:20:26 +00:00
Craig Topper da84ff3ed4 [AVX-512] Add masked forms of the alternate MOVDDUP patterns.
I'm not too sure how to get isel to select even all of the unmasked forms, but at least we have a consistent set now.

llvm-svn: 291368
2017-01-07 22:20:23 +00:00
Bryant Wong 66b5441c86 [libcxxabi] Add flag to conditionally enable tests
Differential Revision: https://reviews.llvm.org/D28449

llvm-svn: 291367
2017-01-07 22:14:04 +00:00
Simon Pilgrim a470296367 [CostModel][X86] Fix AVX2 v16i16 shift 'splat' costs.
llvm-svn: 291366
2017-01-07 22:08:09 +00:00
Simon Pilgrim 82e3e05fe2 [CostModel][X86] Match 256-bit vector shift 'splat' costs for AVX2 and above
We were matching against general vector shift costs before the uniform splat costs

llvm-svn: 291365
2017-01-07 21:47:10 +00:00
Simon Pilgrim e70644dab7 [CostModel][X86] Generalized cost calculation of SHL by constant -> MUL conversion.
llvm-svn: 291364
2017-01-07 21:33:00 +00:00
Simon Pilgrim 935beac173 [X86][AVX2] Regenerate arithmetic tests
Fixed missing checks for tests that used a '-' in the name, which was messing with update_llc_test_checks.py

llvm-svn: 291363
2017-01-07 20:38:36 +00:00
Mehdi Amini d5549f3dac [ThinLTO] Fix assertions on lazy-loading of Metadata TBAA attachments
Summary:
The issue happens with:

 %0 = ....., !tbaa !0
 %1 = ....., !tbaa !1

With !0 that references !1.

In this case when loading !0 we generates a temporary for the
operand !1. We now flush it immediately and trigger the load of
!1 before moving on. If we don't we get the temporary when
attaching to %1. This is usually not an issue except that we
eagerly try to update TBAA MDNodes, which is obviously not possible
if we only have a temporary.

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

llvm-svn: 291362
2017-01-07 20:24:23 +00:00
Hal Finkel ec85fc5eac [llvm-opt-report] Fix context-sensitive lines where nothing happened
Don't print a line multiple times, each for different inlining contexts, if
nothing happened in any context. This prevents situations like this:

 [[
  > main:
 65     |       if ((i * ni + j) % 20 == 0) fprintf
  > print_array:
 65     |       if ((i * ni + j) % 20 == 0) fprintf
 ]]

which could happen if different optimizations were missed in different inlining
contexts.

llvm-svn: 291361
2017-01-07 20:21:17 +00:00
Richard Smith 0ba25a5cef Fix buildbots.
llvm-svn: 291360
2017-01-07 19:58:39 +00:00
Matt Arsenault a7d2194168 SimplifyLibCalls: Remove incorrect optimization of fabs
fabs(x * x) is not generally safe to assume x is positive if x is a NaN.
This is also less general than it could be, so this will be replaced
with a transformation on the intrinsic.

llvm-svn: 291359
2017-01-07 19:55:12 +00:00
Richard Smith 917316fc5d Consistently use a ConstantEvaluated context for expressions in attributes,
except for those with the "attributes are unevaluated contexts" flag.

llvm-svn: 291358
2017-01-07 19:42:26 +00:00
Daniel Berlin fe4e7d0c94 Update update_test_checks to work properly with phi nodes and other fun things.
Summary:
Prior to this change, phi nodes were never considered defs, and so we ended up with undefined variables for any loop.  Now, instead of trying to find just defs, we iterate over each actual IR value in the line, and replace them one by one with either a definition or a use.

We also don't try to match anything in the comment portions of the line.

I've tested it even on things like function pointer calls, etc, and against existing test cases uses update_test_checks
With this change, we are able to use update_tests on the cyclic cases in newgvn.

The only case i'm aware of that will misfire is if you have a string with which contains a valid token.
However, this is the same as it is now, with a slightly larger set of strings that may misfire.
Prior to this change, a test with the string " %a =" would be replaced.

Reviewers: spatel, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 291357
2017-01-07 19:04:59 +00:00
Mehdi Amini 42ef199058 [Bitcode] Remove unused PlaceHolder parameter to lazyLoadModuleMetadataBlock()
llvm-svn: 291356
2017-01-07 18:31:38 +00:00
Simon Pilgrim 725997154d [CostModel][X86] Merge separate AVX1 cost LUTs. NFCI.
llvm-svn: 291355
2017-01-07 18:19:25 +00:00
Simon Pilgrim a4109d6433 [CostModel][AVX512BW] Add v32i16 vector shift costs for avx512bw targets.
llvm-svn: 291354
2017-01-07 17:54:10 +00:00
Simon Pilgrim df7de7a87e [CostModel][X86] Added missing AVX2 arithmetic costs.
Allows us to correctly fall through to the lower AVX1 costs if look up failed.

llvm-svn: 291353
2017-01-07 17:27:39 +00:00
Simon Pilgrim 100eae1ee0 [CostModel][X86] Reordered AVX1 arithmetic cost LUT into descending target order. NFCI.
llvm-svn: 291352
2017-01-07 17:03:51 +00:00
Daniel Berlin 32f8d560dd NewGVN: Make sure we properly lookup operand leaders while creating
congruence classes for stores, and then keep them up to date.  Add
testcases.

llvm-svn: 291351
2017-01-07 16:55:14 +00:00
Tamas Berghammer 1c62e0356d Fix dereferencing of pointers to empty classes
llvm-svn: 291350
2017-01-07 16:39:07 +00:00
Tamas Berghammer 7850602f0a Remove an incorrect byte size calculation in DWARFASTParserClang
llvm-svn: 291349
2017-01-07 16:39:02 +00:00
Simon Pilgrim bb643ab5bc Attempt to fix windows buildbot
llvm-svn: 291348
2017-01-07 15:44:27 +00:00
Simon Pilgrim a1b8e2c725 [X86][AVX512] Use lowerShuffleAsRepeatedMaskAndLanePermute for non-VBMI v64i8 shuffles (PR31470)
llvm-svn: 291347
2017-01-07 15:37:50 +00:00
Dmitry Vyukov ffff5f16a4 tsan: Introducing a function to flush the shadow memory from third-party libraries
As discussed with Dmitry (https://goo.gl/SA4izd), I would like to introduce a function to be called from a third-party library to flush the shadow memory.
In particular, we ran some experiments with our tool Archer (an OpenMP data race detector based on Tsan, https://github.com/PRUNER/archer) and flushing the memory at the end of an outer parallel region, slightly increase the runtime overhead, but reduce the memory overhead of about 30%. This feature would come very handy in case of very large OpenMP applications that may cause an "out of memory" exception when checked with Tsan.

Reviewed in: https://reviews.llvm.org/D28443
Author: Simone Atzeni (simoatze)

llvm-svn: 291346
2017-01-07 11:27:33 +00:00
Eric Fiselier 5741d86d11 Replace identifiers called `__out` because Windows.h #defines it.
Windows is greedy and it defines the identifier `__out` as a macro.
This patch renames all conflicting libc++ identifiers in order
to correctly work on Windows.

llvm-svn: 291345
2017-01-07 11:27:06 +00:00
Michael Park f62eb6b29a Added "Michael Park" to `CREDITS.TXT`.
Summary: Test commit + give myself credit.

Reviewers: EricWF

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

llvm-svn: 291344
2017-01-07 10:19:24 +00:00
Eric Fiselier 956604fed5 [libc++] Implement terminate(), unexpected() and uncaught_exceptions() on Windows
Summary:
This patch implements the following functions on Windows by forwarding to the MSVCRT:

* `get_terminate()`
* `set_terminate()`
* `terminate()`
* `set_unexpected()`
* `get_unexpected()`
* `unexpected()`
* `uncaught_exception()`

* `uncaught_exceptions()`

Reviewers: compnerd, rnk, majnemer, smeenai

Subscribers: cfe-commits

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

llvm-svn: 291343
2017-01-07 10:04:40 +00:00
Eric Fiselier 72771139f1 Ensure Sleep(...) isn't passed the value 0 on Windows
llvm-svn: 291342
2017-01-07 09:53:28 +00:00
Rui Ueyama d52f4b86f3 TarWriter: Use fitsInUstar function.
This change should have been commit as part of r291340.

llvm-svn: 291341
2017-01-07 08:32:07 +00:00
Rui Ueyama 999f094aa3 TarWriter: Use Ustar header's "prefix" field to store long filenames.
Tar's Ustar header has the "prefix" field to store a directory
part of a filename. It is not as flexible as the PAX-extended
filename because there's still a limitation on the maximum filename
size, but it mitigates the situation.

This patch should unbreak some Windows buildbots that uses very
old tar command.

llvm-svn: 291340
2017-01-07 08:28:56 +00:00
Kuba Mracek 3f499b6825 Follow-up for r291277: Redirect otool output to stderr.
Tests need to output everything into a single stream, or FileCheck is sometimes confused (buffering can cause stdout/stderr to be interleaved randomly).

llvm-svn: 291339
2017-01-07 07:41:47 +00:00
Craig Topper 42b848a683 [X86] Disable load unfolding for 128-bit MOVDDUP instructions since the load size is smaller than the register size so unfolding would increase the load size.
llvm-svn: 291338
2017-01-07 06:56:54 +00:00
Eric Fiselier a7234f1a60 Explicitly specify MSVC mangling of iostream globals. Patch from Dave Lee
llvm-svn: 291337
2017-01-07 06:09:12 +00:00
Saleem Abdulrasool 49a10e1c07 system_error: correct ELAST emulation on Windows
ELAST should point to the last valid error string value.  However,
`_sys_nerr` provides the number of elements in the errlist array.  Since
the index is 0-based, this is off-by-one.  Adjust it accordingly.

Thanks to David Majnemer for catching this!

llvm-svn: 291336
2017-01-07 05:13:32 +00:00
Xin Tong ee5cb65ada Fix a typo. NFC
llvm-svn: 291335
2017-01-07 04:30:58 +00:00
Daniel Berlin 0444343326 NewGVN: Reformat and fix a few newlines
llvm-svn: 291334
2017-01-07 03:23:47 +00:00
Saleem Abdulrasool 6d7d0bec10 provide Win32 native threading
Add an implementation for the Win32 threading model as a backing API for
the internal c++ threading interfaces.  This uses the Fls* family for
the TLS (which has the support for adding termination callbacks),
CRITICAL_SECTIONs for the recursive mutex, and Slim Reader/Writer locks
(SRW locks) for non-recursive mutexes.  These APIs should all be
available on Vista or newer.

llvm-svn: 291333
2017-01-07 03:07:45 +00:00
Eric Fiselier cd71f447b7 [libc++] Tolerate presence of __deallocate macro
Summary:
On Windows the identifier `__deallocate` is defined as a macro by one of the Windows system headers. Previously libc++ worked around this by `#undef __deallocate` and generating a warning. However this causes the WIN32 version of `__threading_support` to always generate a warning on Windows. This is not OK.

This patch renames all usages of `__deallocate` internally as to not conflict with the macro.

Reviewers: mclow.lists, majnemer, rnk, rsmith, smeenai, compnerd

Subscribers: cfe-commits

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

llvm-svn: 291332
2017-01-07 03:01:24 +00:00
Saleem Abdulrasool deaceefc4b thread: implement sleep_for on Windows
Windows does not provide an implementation of `nanosleep`.  Round up the
time duration to the nearest ms and use `Sleep`.  Although this may
over-sleep, there is no hard real-time guarantee on the wake, so
sleeping a bit more is better than under-sleeping as it within the
specification.

llvm-svn: 291331
2017-01-07 02:48:30 +00:00
Shoaib Meenai 1b0bda3310 [libc++] Correct macro name in documenation
The macro is named `_LIBCPP_TEMPLATE_VIS`, not `_LIBCPP_TEMPLATE_ONLY`.
No functional change.

llvm-svn: 291330
2017-01-07 02:45:35 +00:00
Eric Fiselier 330fe0170f Add _LIBCPP_ABI_[ITANIUM|MICROSOFT] macros.
This patch adds a libc++ configuration macro for the ABI we
are targeting, either Itanium or Microsoft. For now we configure
for the Microsoft ABI when on Windows with a compiler that defines
_MSC_VER. However this is only temporary until Clang implements
builtin macros we can use.

llvm-svn: 291329
2017-01-07 02:43:58 +00:00
Davide Italiano 1b97fc34a4 [NewGVN] Prefer auto over explicit type. NFCI.
llvm-svn: 291328
2017-01-07 02:05:50 +00:00
Dan Gohman 0e2ceb8121 [WebAssembly] Don't abort on code with UB.
Gracefully leave code that performs function-pointer bitcasts implying
non-trivial pointer conversions alone, rather than aborting, since it's
just undefined behavior.

llvm-svn: 291326
2017-01-07 01:50:01 +00:00
Dan Gohman d5eda35557 [WebAssembly] Move a SmallVector to a more specific scope. NFC.
llvm-svn: 291324
2017-01-07 01:31:18 +00:00