Zachary Turner [Wed, 18 Feb 2015 18:44:03 +0000 (18:44 +0000)]
Fix warning that not all control-paths return from function.
llvm-svn: 229718
Justin Bogner [Wed, 18 Feb 2015 18:40:46 +0000 (18:40 +0000)]
InstrProf: Handle unknown functions if they consist only of zero-regions
This comes up when we generate coverage for a function but don't end
up emitting the function at all - dead static functions or inline
functions that aren't referenced in a particular TU, for example. In
these cases we'd like to show that the function was never called,
which is trivially true.
llvm-svn: 229717
Meador Inge [Wed, 18 Feb 2015 18:34:59 +0000 (18:34 +0000)]
Sema: Allow 'constexpr' variables in range loops
This fixes PR22492, which is in response to CWG issue #1204.
Per the CWG issue 'contexpr' variables are now allowed in
for range loops.
llvm-svn: 229716
Andrew Kaylor [Wed, 18 Feb 2015 18:31:51 +0000 (18:31 +0000)]
Adding implementation to outline C++ catch handlers for native Windows 64 exception handling.
Differential Revision: http://reviews.llvm.org/D7363
llvm-svn: 229715
Greg Fitzgerald [Wed, 18 Feb 2015 18:26:58 +0000 (18:26 +0000)]
[ASan] Set DYLD_LIBRARY_PATH on Darwin
Differential Revision: http://reviews.llvm.org/D7706
llvm-svn: 229714
Zachary Turner [Wed, 18 Feb 2015 18:04:50 +0000 (18:04 +0000)]
Don't use AVX/XSTATE API on Windows.
CopyContext is necessary to safely get the XState, but LLDB doesn't currently
use the XState. CopyContext is available as of Windows 7 SP1, so it can't be
used on Vista. Furthermore, it requires the Windows 8 SDK it compile,
making the baseline for compiling and running LLDB higher than necessary.
Patch by: Adrian McCarthy
Reviewed by: Zachary Turner
Differential Revision: http://reviews.llvm.org/D7572
llvm-svn: 229710
Justin Bogner [Wed, 18 Feb 2015 18:01:14 +0000 (18:01 +0000)]
InstrProf: Make CoverageMapping testable and add a basic unit test
Make CoverageMapping easier to create, so that we can write targeted
unit tests for its internals, and add a some infrastructure to write
these tests. Finally, add a simple unit test for basic functionality.
llvm-svn: 229709
Marshall Clow [Wed, 18 Feb 2015 17:51:56 +0000 (17:51 +0000)]
Move the default template arguments into the forward declarations for the container adapters: stack and queue. References PR#22605.
llvm-svn: 229708
Eric Fiselier [Wed, 18 Feb 2015 17:39:45 +0000 (17:39 +0000)]
[libcxx] Tired of colorless compile errors? Enable color diagnostics today!
Summary:
This patch adds a lit option to enable color diagnostics when either `--param=color_diagnostics` is passed to LIT or `LIBCXX_COLOR_DIAGNOSTICS` is present in the environment.
My only concern with this patch is that GCC and Clang take different flags and that only GCC 4.9 and greater support `-fdiagnostics-color=always`
Does anybody have objections to this going in?
Reviewers: jroelofs, danalbert
Reviewed By: danalbert
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D7729
llvm-svn: 229707
Jozef Kolek [Wed, 18 Feb 2015 17:33:56 +0000 (17:33 +0000)]
[mips][microMIPS] Make usage of ADDU16 and SUBU16 by code generator
Differential Revision: http://reviews.llvm.org/D7609
llvm-svn: 229706
Marshall Clow [Wed, 18 Feb 2015 17:24:08 +0000 (17:24 +0000)]
Move the default template arguments into the forward declarations for the containers: deque, forwardlist and list. References PR#22605.
llvm-svn: 229705
Ed Maste [Wed, 18 Feb 2015 17:23:52 +0000 (17:23 +0000)]
Add decorator for fd leak test failing on FreeBSD
An fd leak comes from Python on FreeBSD
FreeBSD ports PR: https://bugs.freebsd.org/197376
Python issue: https://bugs.python.org/issue23458
llvm-svn: 229704
Daniel Jasper [Wed, 18 Feb 2015 17:17:15 +0000 (17:17 +0000)]
clang-format: [JS] support AtScript style annotations for JS.
Based on Java annotation support and style.
Patch by Martin Probst.
llvm-svn: 229703
Jozef Kolek [Wed, 18 Feb 2015 17:15:48 +0000 (17:15 +0000)]
[mips][microMIPS] Implement JALX instruction
Differential Revision: http://reviews.llvm.org/D5047
llvm-svn: 229702
Daniel Jasper [Wed, 18 Feb 2015 17:14:05 +0000 (17:14 +0000)]
clang-format: [JS] Support classes.
This adds support for JavaScript class definitions (again following
TypeScript & AtScript style). This only required support for
visibility modifiers in JS, everything else was already working.
Patch by Martin Probst, thank you.
llvm-svn: 229701
Daniel Jasper [Wed, 18 Feb 2015 17:09:53 +0000 (17:09 +0000)]
clang-format: [JS] Support type annotations.
This patch adds support for type annotations that follow TypeScript's,
Flow's, and AtScript's syntax style.
Patch by Martin Probst, thank you.
Review: http://reviews.llvm.org/D7721
llvm-svn: 229700
John Thompson [Wed, 18 Feb 2015 17:08:00 +0000 (17:08 +0000)]
Fixed missing checkins.
llvm-svn: 229699
Eric Fiselier [Wed, 18 Feb 2015 17:00:31 +0000 (17:00 +0000)]
Enable testing with _LIBCPP_DEBUG and fix bad assertions in string_view.
llvm-svn: 229698
Alex Denisov [Wed, 18 Feb 2015 16:51:30 +0000 (16:51 +0000)]
Fix broken link to 'Obtaining Commit Access'
llvm-svn: 229697
Eric Fiselier [Wed, 18 Feb 2015 16:31:46 +0000 (16:31 +0000)]
[libc++] Fix PR20084 - std::is_function<void() const> failed.
Summary:
This patch introduces some black magic to detect const and volatile qualified function types such as `void () const`.
The patch works in the following way:
We first rule out any type that satisfies on of the following. These restrictions are important so that the test below works properly.
* `is_class<_Tp>::value`
* `is_union<_Tp>::value`
* `is_void<_Tp>::value`
* `is_reference<_Tp>::value`
* `__is_nullptr_t<_Tp>::value`
If none of the above is true we perform overload resolution on `__source<_Tp>(0)` to determine the return type.
* If `_Tp&` is well-formed we select `_Tp& __source(int)`. `_Tp&` is only ill formed for cv void types and cv/ref qualified function types.
* Otherwise we select `__dummy_type __source(...)`. Since we know `_Tp` cannot be void then it must be a function type.
let `R` be the returned from `__source<_Tp>(0)`.
We perform overload resolution on `__test<_Tp>(R)`.
* If `R` is `__dummy_type` we call `true_type __test(__dummy_type)`.
* if `R` is `_Tp&` and `_Tp&` decays to `_Tp*` we call `true_type __test(_Tp*)`. Only references to function types decay to a pointer of the same type.
* In all other cases we call `false_type __test(...)`.
`__source<_Tp>(0)` will try and form `_Tp&` in the return type. if `_Tp&` is not well formed the return type of `__source<_Tp>(0)` will be dummy type. `_Tp&` is only ill-formed for cv/ref qualified function types (and void which is dealt with elsewhere).
This fixes PR20084 - http://llvm.org/bugs/show_bug.cgi?id=20084
Reviewers: rsmith, K-ballo, mclow.lists
Reviewed By: mclow.lists
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D7573
llvm-svn: 229696
Daniel Sanders [Wed, 18 Feb 2015 16:24:50 +0000 (16:24 +0000)]
[mips] Add backend support for Mips32r[35] and Mips64r[35].
Summary:
These ISA's didn't add any instructions so they are almost identical to
Mips32r2 and Mips64r2. Even the ELF e_flags are the same, However the ISA
revision in .MIPS.abiflags is 3 or 5 respectively instead of 2.
Reviewers: vmedic
Reviewed By: vmedic
Subscribers: tomatabacu, llvm-commits, atanasyan
Differential Revision: http://reviews.llvm.org/D7381
llvm-svn: 229695
Kit Barton [Wed, 18 Feb 2015 16:21:46 +0000 (16:21 +0000)]
This patch adds the VSX logical instructions introduced in the Power ISA 2.07. It also removes the added complexity that favors VMX versions of the three instructions.
Phabricator review: http://reviews.llvm.org/D7616
Commiting on Nemanja's behalf.
llvm-svn: 229694
John Thompson [Wed, 18 Feb 2015 16:14:32 +0000 (16:14 +0000)]
Added support for extracting headers from module maps as a source for the header list.
llvm-svn: 229692
Tamas Berghammer [Wed, 18 Feb 2015 16:14:02 +0000 (16:14 +0000)]
Add missing exports file and remove unused ones
These files required by the excode project
Patch from: flackr <flackr@google.com>
llvm-svn: 229691
John Thompson [Wed, 18 Feb 2015 16:12:26 +0000 (16:12 +0000)]
Temporary hack to avoid false errors. Real fix comming.
llvm-svn: 229690
Tom Stellard [Wed, 18 Feb 2015 16:08:17 +0000 (16:08 +0000)]
R600/SI: Don't set isCodeGenOnly = 1 on all instructions
We only need to set this on pseudo instructions which won't
be used by the assembler.
llvm-svn: 229689
Tom Stellard [Wed, 18 Feb 2015 16:08:15 +0000 (16:08 +0000)]
R600/SI: Add missing VOP1 instructions
llvm-svn: 229688
Tom Stellard [Wed, 18 Feb 2015 16:08:14 +0000 (16:08 +0000)]
R600/SI: Add missing VOP2 instructions
llvm-svn: 229687
Tom Stellard [Wed, 18 Feb 2015 16:08:13 +0000 (16:08 +0000)]
R600/SI: Add definition for S_CBRANCH_G_FORK
llvm-svn: 229686
Tom Stellard [Wed, 18 Feb 2015 16:08:11 +0000 (16:08 +0000)]
R600/SI: Add missing SOP1 instructions
llvm-svn: 229685
Tom Stellard [Wed, 18 Feb 2015 16:08:09 +0000 (16:08 +0000)]
R600/SI: Refactor SOP2 definitions
llvm-svn: 229684
Tamas Berghammer [Wed, 18 Feb 2015 15:39:41 +0000 (15:39 +0000)]
Merge lldb-platform and lldb-gdbserver into a single binary
This commit merges lldb-platform and lldb-gdbserver into a single binary
of the same size as each of the previous individual binaries. Execution
mode is controlled by the first argument being either platform or
gdbserver.
Patch from: flackr <flackr@google.com>
Differential revision: http://reviews.llvm.org/D7545
llvm-svn: 229683
Ilia K [Wed, 18 Feb 2015 15:30:18 +0000 (15:30 +0000)]
Fix make_symlink in case when symlink already exists (after r229517)
llvm-svn: 229682
Hafiz Abid Qadeer [Wed, 18 Feb 2015 15:25:25 +0000 (15:25 +0000)]
Fix line crossing 80 column border.
llvm-svn: 229681
Zoran Jovanovic [Wed, 18 Feb 2015 15:21:35 +0000 (15:21 +0000)]
Change representation of member function pointers for MIPS targets
Differential Revision: http://reviews.llvm.org/D7148
llvm-svn: 229680
Timur Iskhodzhanov [Wed, 18 Feb 2015 15:14:07 +0000 (15:14 +0000)]
[ASan/Win] Speculative fix to make the sed command line work with all sed implementations
llvm-svn: 229679
Dmitry Vyukov [Wed, 18 Feb 2015 15:13:29 +0000 (15:13 +0000)]
tsan: fix signal handling during stop-the-world
Long story short: stop-the-world briefly resets SIGSEGV handler to SIG_DFL.
This breaks programs that handle and continue after SIGSEGV (namely JVM).
See the test and comments for details.
http://reviews.llvm.org/D7722
llvm-svn: 229678
John Thompson [Wed, 18 Feb 2015 15:11:12 +0000 (15:11 +0000)]
Updated file comment on modularize usage, as it was out-of-date.
llvm-svn: 229677
Daniel Sanders [Wed, 18 Feb 2015 15:08:37 +0000 (15:08 +0000)]
Fix test/CodeGen/atomic_ops.c failure on clang-cmake-mips builder (and others).
Not all targets generate 'store atomic' instructions for
'_Atomic(_Complex int)'. Some targets use the __atomic_store builtin instead.
This commit makes the test accept either one.
llvm-svn: 229676
Vasileios Kalintiris [Wed, 18 Feb 2015 14:57:05 +0000 (14:57 +0000)]
[mips] Avoid redundant sign extension of the result of binary bitwise instructions.
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7581
llvm-svn: 229675
Ilia K [Wed, 18 Feb 2015 14:16:48 +0000 (14:16 +0000)]
Fix typo in make_symlink after r229517. It fixes symlinks on a UNIX style platform.
llvm-svn: 229674
Daniel Jasper [Wed, 18 Feb 2015 14:13:46 +0000 (14:13 +0000)]
Prevent use after free caused by accessing a member into a dense set.
The member gets invalidated as elements are added to the dense set. Directly
access the underlying pointer instead. Not sure how to create a test case for
this :-(. Maybe Richard can help.
llvm-svn: 229673
Benjamin Kramer [Wed, 18 Feb 2015 14:10:44 +0000 (14:10 +0000)]
X86: Use bitset to manage a bag of bits. NFC.
Doesn't matter in terms of memory usage or perf here, but it's a neat
simplification.
llvm-svn: 229672
Toma Tabacu [Wed, 18 Feb 2015 13:46:53 +0000 (13:46 +0000)]
[mips] [IAS] Fix using .cpsetup with local labels (PR22518).
Summary:
Parse for an MCExpr instead of an Identifier and use the symbol for relocations, not just the symbol's name.
This fixes errors when using local labels in .cpsetup (PR22518).
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: seanbruno, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D7697
llvm-svn: 229671
Chandler Carruth [Wed, 18 Feb 2015 11:46:29 +0000 (11:46 +0000)]
[x86] Tighten the assertions to document that canonicalization has
actually removed all but a *very* small number of choices for v2i64.
Also remove dead code handling cases that simply cannot arise.
llvm-svn: 229670
Chandler Carruth [Wed, 18 Feb 2015 11:46:27 +0000 (11:46 +0000)]
[x86] Switch an if which is trivially true to an assert. NFC
llvm-svn: 229669
Chandler Carruth [Wed, 18 Feb 2015 11:46:23 +0000 (11:46 +0000)]
[x86] Remove some more 'bit' nomenclature from the generic shift
lowering.
llvm-svn: 229668
Mohit K. Bhakkad [Wed, 18 Feb 2015 11:41:24 +0000 (11:41 +0000)]
[MSan][MIPS] VarArgHelper for MIPS64
Reviewers: Reviewers: eugenis, kcc, samsonov, petarj
Subscribers: dsanders, sagar, llvm-commits
Differential Revision: http://reviews.llvm.org/D7182
llvm-svn: 229667
Tamas Berghammer [Wed, 18 Feb 2015 11:37:46 +0000 (11:37 +0000)]
Remove alias template from GDBRemoteCommunicationServerCommon
It is required because MSVC 2013 doesn't generate correct code for
template aliases.
llvm-svn: 229666
Renato Golin [Wed, 18 Feb 2015 11:34:41 +0000 (11:34 +0000)]
Enable ASAN build and test on AArch64
llvm-svn: 229665
Hafiz Abid Qadeer [Wed, 18 Feb 2015 11:12:11 +0000 (11:12 +0000)]
Fix some warnings in MSVC build.
Platform.h was causing soem warning due to multiple defined maros.
It already has a define that excludes the singal.h but that was not being
used at correct place. It has been fixed now.
Tested by building on Windows(MSVC) and Linux(gcc).
llvm-svn: 229664
Hafiz Abid Qadeer [Wed, 18 Feb 2015 11:04:17 +0000 (11:04 +0000)]
Fix a typo.
llvm-svn: 229663
Chandler Carruth [Wed, 18 Feb 2015 10:40:38 +0000 (10:40 +0000)]
[x86] Fold together the two shift lowering strategies. They were doing
quite literally the same work, we just need to special case the >64-bit
element shift code emission to emit the byte shift instructions and
offsets. This also makes reasoning about each of the vector lowering
strategies easier as we don't have to remember to use both forms.
llvm-svn: 229662
Bradley Smith [Wed, 18 Feb 2015 10:34:48 +0000 (10:34 +0000)]
[ARM] Add missing M/R class CPUs
Add some of the missing M and R class Cortex CPUs, namely:
Cortex-M0+ (called Cortex-M0plus for GCC compatibility)
Cortex-M1
SC000
SC300
Cortex-R5
llvm-svn: 229661
Bradley Smith [Wed, 18 Feb 2015 10:33:30 +0000 (10:33 +0000)]
[ARM] Add missing M/R class CPUs
Add some of the missing M and R class Cortex CPUs, namely:
Cortex-M0+ (called Cortex-M0plus for GCC compatibility)
Cortex-M1
SC000
SC300
Cortex-R5
llvm-svn: 229660
Michael Kuperstein [Wed, 18 Feb 2015 09:43:40 +0000 (09:43 +0000)]
Fixes two issue in SimplifyDemandedBits of sext_in_reg:
1) We should not try to simplify if the sext has multiple uses
2) There is no need to simplify is the source value is already sign-extended.
Patch by Gil Rapaport <gil.rapaport@intel.com>
Differential Revision: http://reviews.llvm.org/D6949
llvm-svn: 229659
Ulrich Weigand [Wed, 18 Feb 2015 09:42:23 +0000 (09:42 +0000)]
[SystemZ] Clean up warning
Removed (unreachable) default case in switch to clean up warning:
lib/Target/SystemZ/SystemZISelLowering.cpp:1974:5:
error: default label in switch which covers all enumeration values
[-Werror,-Wcovered-switch-default]
llvm-svn: 229658
Dmitry Vyukov [Wed, 18 Feb 2015 09:37:31 +0000 (09:37 +0000)]
tsan: add -Wno-maybe-uninitialized to mingw gcc build flags
As per discussion with David Blaikie here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20150216/260289.html
llvm-svn: 229657
Mohit K. Bhakkad [Wed, 18 Feb 2015 09:24:19 +0000 (09:24 +0000)]
[MSan][MIPS] Fix for some failing tests on MIPS64
Enabling internal ptrace for mips, which fixes some
ptrace related tests. Along with this fixing some
other failures.
Reviewers: Reviewers: eugenis, kcc, samsonov
Subscribers: dsanders, sagar, lldb-commits
Differential Revision: http://reviews.llvm.org/D7332
llvm-svn: 229656
Chandler Carruth [Wed, 18 Feb 2015 09:19:58 +0000 (09:19 +0000)]
[x86] Refactor the bit shift code the same as I just did the byte shift
code.
While this didn't have the miscompile (it used MatchLeft consistently)
it missed some cases where it could use right shifts. I've added a test
case Craig Topper came up with to exercise the right shift matching.
This code is really identical between the two. I'm going to merge them
next so that we don't keep two copies of all of this logic.
llvm-svn: 229655
Ulrich Weigand [Wed, 18 Feb 2015 09:13:27 +0000 (09:13 +0000)]
[SystemZ] Support all TLS access models - CodeGen part
The current SystemZ back-end only supports the local-exec TLS access model.
This patch adds all required CodeGen support for the other TLS models, which
means in particular:
- Expand initial-exec TLS accesses by loading TLS offsets from the GOT
using @indntpoff relocations.
- Expand general-dynamic and local-dynamic accesses by generating the
appropriate calls to __tls_get_offset. Note that this routine has
a non-standard ABI and requires loading the GOT pointer into %r12,
so the patch also adds support for the GLOBAL_OFFSET_TABLE ISD node.
- Add a new platform-specific optimization pass to remove redundant
__tls_get_offset calls in the local-dynamic model (modeled after
the corresponding X86 pass).
- Add test cases verifying all access models and optimizations.
llvm-svn: 229654
Igor Laevsky [Wed, 18 Feb 2015 09:11:50 +0000 (09:11 +0000)]
Testing commit access
llvm-svn: 229653
Ulrich Weigand [Wed, 18 Feb 2015 09:11:36 +0000 (09:11 +0000)]
[SystemZ] Support all TLS access models - MC part
The current SystemZ back-end only supports the local-exec TLS access model.
This patch adds all required MC support for the other TLS models, which
means in particular:
- Support additional relocation types for
Initial-exec model: R_390_TLS_IEENT
Local-dynamic-model: R_390_TLS_LDO32, R_390_TLS_LDO64,
R_390_TLS_LDM32, R_390_TLS_LDM64, R_390_TLS_LDCALL
General-dynamic model: R_390_TLS_GD32, R_390_TLS_GD64, R_390_TLS_GDCALL
- Support assembler syntax to generate additional relocations
for use with __tls_get_offset calls:
:tls_gdcall:
:tls_ldcall:
The patch also adds a new test to verify fixups and relocations,
and removes the (already unused) FK_390_PLT16DBL/FK_390_PLT32DBL
fixup kinds.
llvm-svn: 229652
NAKAMURA Takumi [Wed, 18 Feb 2015 08:36:14 +0000 (08:36 +0000)]
Reformat.
llvm-svn: 229651
NAKAMURA Takumi [Wed, 18 Feb 2015 08:34:47 +0000 (08:34 +0000)]
Revert r229622: "[LoopAccesses] Make VectorizerParams global" and others. r229622 brought cyclic dependencies between Analysis and Vector.
r229622: "[LoopAccesses] Make VectorizerParams global"
r229623: "[LoopAccesses] Stash the report from the analysis rather than emitting it"
r229624: "[LoopAccesses] Cache the result of canVectorizeMemory"
r229626: "[LoopAccesses] Create the analysis pass"
r229628: "[LoopAccesses] Change debug messages from LV to LAA"
r229630: "[LoopAccesses] Add canAnalyzeLoop"
r229631: "[LoopAccesses] Add missing const to APIs in VectorizationReport"
r229632: "[LoopAccesses] Split out LoopAccessReport from VectorizerReport"
r229633: "[LoopAccesses] Add -analyze support"
r229634: "[LoopAccesses] Change LAA:getInfo to return a constant reference"
r229638: "Analysis: fix buildbots"
llvm-svn: 229650
Daniel Jasper [Wed, 18 Feb 2015 08:19:16 +0000 (08:19 +0000)]
NFC: Use range-based for loops and more consistent naming.
No functional changes intended.
(I plan on doing some modifications to this function and would like to
have as few unrelated changes as possible in the patch)
llvm-svn: 229649
Daniel Jasper [Wed, 18 Feb 2015 08:18:07 +0000 (08:18 +0000)]
Remove experimental options to control machine block placement.
This reverts r226034. Benchmarking with those flags has not revealed
anything interesting.
llvm-svn: 229648
Elena Demikhovsky [Wed, 18 Feb 2015 08:09:28 +0000 (08:09 +0000)]
Minor fix after 229495.
Removed metadata and function attributes from the test.
llvm-svn: 229647
Sanjoy Das [Wed, 18 Feb 2015 08:03:22 +0000 (08:03 +0000)]
Address post commit review on r229600.
llvm-svn: 229646
Elena Demikhovsky [Wed, 18 Feb 2015 07:59:20 +0000 (07:59 +0000)]
AVX-512: Added support for FP instructions with embedded rounding mode.
By Asaf Badouh <asaf.badouh@intel.com>
llvm-svn: 229645
David Majnemer [Wed, 18 Feb 2015 07:47:09 +0000 (07:47 +0000)]
Itanium ABI: Mangle <mangled-name> according to the ABI
We attempted to be compatible with GCC's buggy mangling for templates
with a declaration for a template argument.
However, we weren't completely successful in copying their bug in cases
like:
char foo;
template <char &C> decltype(C) f() { return foo; };
template char &f<foo>();
Instead, just follow the ABI specification. This fixes PR22621.
llvm-svn: 229644
Craig Topper [Wed, 18 Feb 2015 07:45:43 +0000 (07:45 +0000)]
[X86] Add another test case for the bug fixed in r229642. With the bug a vpsrldq was emitted instead of pslldq.
llvm-svn: 229643
Chandler Carruth [Wed, 18 Feb 2015 07:13:48 +0000 (07:13 +0000)]
[x86] Rewrite the byte shift detection to not use boolean variables to
track state.
I didn't like this in the code review because the pattern tends to be
error prone, but I didn't see a clear way to rewrite it. Turns out that
there were bugs here, I found them when fuzz testing our shuffle
lowering for correctness on x86.
The core of the problem is that we need to consistently test all our
preconditions for the same directionality of shift and the same input
vector. Instead, formulate this as two predicates (one doesn't depend on
the input in any way), pass things like the directionality and input
vector as inputs, and loop over the alternatives.
This fixes a pattern of very rare miscompiles coming out of this code.
Turned up roughly 4 out of every 1 million v8 shuffles in my fuzz
testing. The new code is over half a million test runs with no failures
yet. I've also fuzzed every other function in the lowering code with
over 3.5 million test cases and not discovered any other miscompiles.
llvm-svn: 229642
Craig Topper [Wed, 18 Feb 2015 06:24:49 +0000 (06:24 +0000)]
[X86] Remove AVX512 pslldq/psrldq shift intrinsics. They aren't implemented yet and when they are they should be done with shuffles like SSE2 and AVX2.
llvm-svn: 229641
Craig Topper [Wed, 18 Feb 2015 06:24:44 +0000 (06:24 +0000)]
[X86] Remove AVX2 and SSE2 pslldq and psrldq intrinsics. We can represent them in IR with vector shuffles now. All their uses have been removed from clang in favor of shuffles.
llvm-svn: 229640
Nico Weber [Wed, 18 Feb 2015 05:19:40 +0000 (05:19 +0000)]
Port r163224 to C++.
The motivation is to fix a crash on
struct S {} s;
Foo S::~S() { s.~S(); }
What was happening here was that S::~S() was marked as invalid since its
return type is invalid, and as a consequence CheckFunctionDeclaration() wasn't
called and S::~S() didn't get merged into S's implicit destructor. This way,
the class ended up with two destructors, which confused the overload printer
when it suddenly had to print two possible destructors for `s.~S()`.
In addition to fixing the crash, this change also seems to improve diagnostics
in a few other places, see test changes.
Crash found by SLi's bot.
llvm-svn: 229639
Saleem Abdulrasool [Wed, 18 Feb 2015 05:09:50 +0000 (05:09 +0000)]
Analysis: fix buildbots
This should fix the compilation failure on the MSVC buildbots which find a
std::make_unique and llvm::make_unique via ADL, resulting in ambiguity.
llvm-svn: 229638
Nico Weber [Wed, 18 Feb 2015 04:53:03 +0000 (04:53 +0000)]
Wrap to 80 columns. No behavior change.
llvm-svn: 229637
Saleem Abdulrasool [Wed, 18 Feb 2015 04:33:26 +0000 (04:33 +0000)]
Sema: partially address post-commit comments
Un-parameterize the warning as there is exactly one attribute added in C++14.
Partially addresses post-commit review comments from Richard Smith.
llvm-svn: 229636
Davide Italiano [Wed, 18 Feb 2015 03:54:21 +0000 (03:54 +0000)]
[ELF] Demangle: don't expose raw info when getter is available.
Differential Revision: D7693
Reviewed by: shankarke
llvm-svn: 229635
Adam Nemet [Wed, 18 Feb 2015 03:44:33 +0000 (03:44 +0000)]
[LoopAccesses] Change LAA:getInfo to return a constant reference
As expected, this required a few more const-correctness fixes.
Based on Hal's feedback on D7684.
llvm-svn: 229634
Adam Nemet [Wed, 18 Feb 2015 03:44:30 +0000 (03:44 +0000)]
[LoopAccesses] Add -analyze support
The LoopInfo in combination with depth_first is used to enumerate the
loops.
Right now -analyze is not yet complete. It only prints the result of
the analysis, the report and the run-time checks. Printing the unsafe
depedences will require a bit more reshuffling which I'd like to do in a
follow-on to this patchset. Unsafe dependences are currently checked
via -debug-only=loop-accesses in the new test.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229633
Adam Nemet [Wed, 18 Feb 2015 03:44:25 +0000 (03:44 +0000)]
[LoopAccesses] Split out LoopAccessReport from VectorizerReport
The only difference between these two is that VectorizerReport adds a
vectorizer-specific prefix to its messages. When LAA is used in the
vectorizer context the prefix is added when we promote the
LoopAccessReport into a VectorizerReport via one of the constructors.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229632
Adam Nemet [Wed, 18 Feb 2015 03:44:20 +0000 (03:44 +0000)]
[LoopAccesses] Add missing const to APIs in VectorizationReport
When I split out LoopAccessReport from this, I need to create some temps
so constness becomes necessary.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229631
Adam Nemet [Wed, 18 Feb 2015 03:44:08 +0000 (03:44 +0000)]
[LoopAccesses] Add canAnalyzeLoop
This allows the analysis to be attempted with any loop. This feature
will be used with -analysis. (LV only requests the analysis on loops
that have already satisfied these tests.)
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229630
Adam Nemet [Wed, 18 Feb 2015 03:43:58 +0000 (03:43 +0000)]
[LoopAccesses] Factor out RuntimePointerCheck::needsChecking
Will be used by the new RuntimePointerCheck::print.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229629
Adam Nemet [Wed, 18 Feb 2015 03:43:37 +0000 (03:43 +0000)]
[LoopAccesses] Change debug messages from LV to LAA
Also add pass name as an argument to VectorizationReport::emitAnalysis.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229628
Adam Nemet [Wed, 18 Feb 2015 03:43:32 +0000 (03:43 +0000)]
[LoopAccesses] Modify test to also check symbolic strides with memchecks
See the comment in the code.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229627
Adam Nemet [Wed, 18 Feb 2015 03:43:24 +0000 (03:43 +0000)]
[LoopAccesses] Create the analysis pass
This is a function pass that runs the analysis on demand. The analysis
can be initiated by querying the loop access info via LAA::getInfo. It
either returns the cached info or runs the analysis.
Symbolic stride information continues to reside outside of this analysis
pass. We may move it inside later but it's not a priority for me right
now. The idea is that Loop Distribution won't support run-time stride
checking at least initially.
This means that when querying the analysis, symbolic stride information
can be provided optionally. Whether stride information is used can
invalidate the cache entry and rerun the analysis. Note that if the
loop does not have any symbolic stride, the entry should be preserved
across Loop Distribution and LV.
Since currently the only user of the pass is LV, I just check that the
symbolic stride information didn't change when using a cached result.
On the LV side, LoopVectorizationLegality requests the info object
corresponding to the loop from the analysis pass. A large chunk of the
diff is due to LAI becoming a pointer from a reference.
A test will be added as part of the -analyze patch.
Also tested that with AVX, we generate identical assembly output for the
testsuite (including the external testsuite) before and after.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229626
Adam Nemet [Wed, 18 Feb 2015 03:43:19 +0000 (03:43 +0000)]
[LoopAccesses] Make blockNeedsPredication static
blockNeedsPredication is in LoopAccess in order to share it with the
vectorizer. It's a utility needed by LoopAccess not strictly provided
by it but it's a good place to share it. This makes the function static
so that it no longer required to create an LoopAccessInfo instance in
order to access it from LV.
This was actually causing problems because it would have required
creating LAI much earlier that LV::canVectorizeMemory().
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229625
Adam Nemet [Wed, 18 Feb 2015 03:42:57 +0000 (03:42 +0000)]
[LoopAccesses] Cache the result of canVectorizeMemory
LAA will be an on-demand analysis pass, so we need to cache the result
of the analysis. canVectorizeMemory is renamed to analyzeLoop which
computes the result. canVectorizeMemory becomes the query function for
the cached result.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229624
Adam Nemet [Wed, 18 Feb 2015 03:42:50 +0000 (03:42 +0000)]
[LoopAccesses] Stash the report from the analysis rather than emitting it
The transformation passes will query this and then emit them as part of
their own report. The currently only user LV is modified to do just
that.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229623
Adam Nemet [Wed, 18 Feb 2015 03:42:43 +0000 (03:42 +0000)]
[LoopAccesses] Make VectorizerParams global
As LAA is becoming a pass, we can no longer pass the params to its
constructor. This changes the command line flags to have external
storage. These can now be accessed both from LV and LAA.
VectorizerParams is moved out of LoopAccessInfo in order to shorten the
code to access it.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229622
Adam Nemet [Wed, 18 Feb 2015 03:42:35 +0000 (03:42 +0000)]
[LoopAccesses] Rename LoopAccessAnalysis to LoopAccessInfo
LoopAccessAnalysis will be used as the name of the pass.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229621
Adam Nemet [Wed, 18 Feb 2015 03:42:15 +0000 (03:42 +0000)]
[LoopAccesses] Make raw_string_ostream local in VectorizationReport
Since VectorizationReport will be part of the result of the analysis it
will be stored in a container. However, one of its members is a
raw_string_ostream which cannot be copy-constructed.
This makes the raw_string_ostream local to the << operator.
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229620
Akira Hatanaka [Wed, 18 Feb 2015 03:30:11 +0000 (03:30 +0000)]
[InstCombine] Do not insert a GEP instruction before a landingpad instruction.
InstCombiner::visitGetElementPtrInst was using getFirstNonPHI to compute the
insertion point, which caused the verifier to complain when a GEP was inserted
before a landingpad instruction. This commit fixes it to use getFirstInsertionPt
instead.
rdar://problem/
19394964
llvm-svn: 229619
Hal Finkel [Wed, 18 Feb 2015 03:12:28 +0000 (03:12 +0000)]
[BDCE] Don't forget uses of root instructions seen before the instruction itself
When visiting the initial list of "root" instructions (those which must always
be alive), for those that are integer-valued (such as invokes returning an
integer), we mark their bits as (initially) all dead (we might, obviously, find
uses of those bits later, but all bits are assumed dead until proven
otherwise). Don't do so, however, if we're already seen a use of those bits by
another root instruction (such as a store).
Fixes a miscompile of the sanitizer unit tests on x86_64.
Also, add a debug line for visiting the root instructions, and remove a debug
line which tried to print instructions being removed (printing dead
instructions is dangerous, and can sometimes crash).
llvm-svn: 229618
David Majnemer [Wed, 18 Feb 2015 02:28:15 +0000 (02:28 +0000)]
CodeGen: Relax a FileCheck line for SystemZ
llvm-svn: 229617
David Majnemer [Wed, 18 Feb 2015 02:28:13 +0000 (02:28 +0000)]
Sema: size_t is available in C when -fms-compatibility is enabled
llvm-svn: 229616
David Majnemer [Wed, 18 Feb 2015 02:28:01 +0000 (02:28 +0000)]
Itanium ABI: Improve our mangling of <destructor-name>
Our mangling of <destructor-name> wasn't quite right: we'd introduce
mangling substitutions where one shouldn't be possible. We also didn't
correctly handle the case where the destroyed type was not dependent but
still a TemplateSpecializationType.
N.B. There isn't a mangling for a template-template parameter showing up
as the destroyed type. We do the 'obvious' thing and mangle the index
of the parameter.
llvm-svn: 229615