Hiroshi Inoue [Wed, 30 Jan 2019 05:26:31 +0000 (05:26 +0000)]
[NFC] fix trivial typos in comments
llvm-svn: 352602
Matt Arsenault [Wed, 30 Jan 2019 04:19:31 +0000 (04:19 +0000)]
GlobalISel: Implement fewerElementsVector for select
llvm-svn: 352601
Craig Topper [Wed, 30 Jan 2019 03:43:41 +0000 (03:43 +0000)]
[IR] Use CallBase to simplify some code
Summary:
This patch does the following to simplify the asm-goto patch
-Move isInlineAsm from CallInst to CallBase to share with CallBrInst in the asm-goto patch.
-Forward CallSite's data_operands_begin()/data_operands_end() to CallBase's implementation.
-Forward CallSite's getOperandBundlesAsDefs to CallBase.
Reviewers: chandlerc
Reviewed By: chandlerc
Subscribers: nickdesaulniers, llvm-commits
Differential Revision: https://reviews.llvm.org/D57415
llvm-svn: 352600
Matt Arsenault [Wed, 30 Jan 2019 03:36:25 +0000 (03:36 +0000)]
AMDGPU/GlobalISel: Fix clamping shifts with 16-bit insts
llvm-svn: 352599
Heejin Ahn [Wed, 30 Jan 2019 03:21:57 +0000 (03:21 +0000)]
[WebAssembly] Exception handling: Switch to the new proposal
Summary:
This switches the EH implementation to the new proposal:
https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md
(The previous proposal was
https://github.com/WebAssembly/exception-handling/blob/master/proposals/old/Exceptions.md)
- Instruction changes
- Now we have one single `catch` instruction that returns a except_ref
value
- `throw` now can take variable number of operations
- `rethrow` does not have 'depth' argument anymore
- `br_on_exn` queries an except_ref to see if it matches the tag and
branches to the given label if true.
- `extract_exception` is a pseudo instruction that simulates popping
values from wasm stack. This is to make `br_on_exn`, a very special
instruction, work: `br_on_exn` puts values onto the stack only if it
is taken, and the # of values can vay depending on the tag.
- Now there's only one `catch` per `try`, this patch removes all special
handling for terminate pad with a call to `__clang_call_terminate`.
Before it was the only case there are two catch clauses (a normal
`catch` and `catch_all` per `try`).
- Make `rethrow` act as a terminator like `throw`. This splits BB after
`rethrow` in WasmEHPrepare, and deletes an unnecessary `unreachable`
after `rethrow` in LateEHPrepare.
- Now we stop at all catchpads (because we add wasm `catch` instruction
that catches all exceptions), this creates new
`findWasmUnwindDestinations` function in SelectionDAGBuilder.
- Now we use `br_on_exn` instrution to figure out if an except_ref
matches the current tag or not, LateEHPrepare generates this sequence
for catch pads:
```
catch
block i32
br_on_exn $__cpp_exception
end_block
extract_exception
```
- Branch analysis for `br_on_exn` in WebAssemblyInstrInfo
- Other various misc. changes to switch to the new proposal.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D57134
llvm-svn: 352598
Matt Arsenault [Wed, 30 Jan 2019 02:57:43 +0000 (02:57 +0000)]
GlobalISel: Use appropriate extension for legalizing select conditions
llvm-svn: 352597
Zi Xuan Wu [Wed, 30 Jan 2019 02:56:22 +0000 (02:56 +0000)]
[PowerPC] [NFC] Create a helper function to copy register to particular register class at PPCFastISel
Make copy register code as common function as following.
unsigned copyRegToRegClass(const TargetRegisterClass *ToRC, unsigned SrcReg, unsigned Flag = 0, unsigned SubReg = 0);
Differential Revision: https://reviews.llvm.org/D57368
llvm-svn: 352596
James Y Knight [Wed, 30 Jan 2019 02:54:28 +0000 (02:54 +0000)]
Cleanup: replace uses of CallSite with CallBase.
llvm-svn: 352595
Matt Arsenault [Wed, 30 Jan 2019 02:35:38 +0000 (02:35 +0000)]
GlobalISel: Support narrowScalar for uneven loads
llvm-svn: 352594
Richard Smith [Wed, 30 Jan 2019 02:23:34 +0000 (02:23 +0000)]
Simplify and modernize this code a little.
No functionality change intended.
llvm-svn: 352593
Thomas Lively [Wed, 30 Jan 2019 02:23:29 +0000 (02:23 +0000)]
[WebAssembly] Optimize BUILD_VECTOR lowering for size
Summary:
Implements custom lowering logic that finds the optimal value for the
initial splat of the vector and either uses it or uses v128.const if
it is available and if it would produce smaller code. This logic
replaces large TableGen ISEL patterns that would lower all non-splat
BUILD_VECTORs into a splat followed by a fixed number of replace_lane
instructions. This CL fixes PR39685.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D56633
llvm-svn: 352592
Matt Arsenault [Wed, 30 Jan 2019 02:22:13 +0000 (02:22 +0000)]
GlobalISel: Handle some odd splits in fewerElementsVector
Also add some quick hacks to AMDGPU legality for the tests.
llvm-svn: 352591
Nico Weber [Wed, 30 Jan 2019 02:17:27 +0000 (02:17 +0000)]
lld/coff: Implement some support for the comdat selection field
LLD used to handle comdats as if the selection field was always set to
IMAGE_COMDAT_SELECT_ANY. This means for obj files produced by `cl /Gy`, LLD
would never report a duplicate symbol error.
This change:
- adds validation for the Selection field (should make no difference in
practice for compiler-generated obj inputs)
- rejects comdats that have different Selection fields in different obj files
(likewise). This is a bit more strict but also more self-consistent thank
link.exe (see comment in code)
- implements handling for all the selection kinds
In practice, compilers only generate comdats with
IMAGE_COMDAT_SELECT_NODUPLICATES (LLD now produces duplicate symbol errors for
these), IMAGE_COMDAT_SELECT_ANY (no behavior change), and
IMAGE_COMDAT_SELECT_LARGEST (for RTTI data; here LLD should no longer create
broken executables when linking some TUs with RTTI enabled and some with it
disabled – but see below).
The implementation of `IMAGE_COMDAT_SELECT_LARGEST` is incomplete: If one
SELECT_LARGEST comdat replaces an earlier one, the comdat symbol is replaced
correctly, but the old section stays loaded and if /opt:ref is disabled (via
/opt:noref or /debug) it's still written to the output. That's not ideal, but
better than the current treatment of just picking any one of those comdats. I
hope to fix this better later.
Fixes most of PR40094.
Differential Revision: https://reviews.llvm.org/D57324
llvm-svn: 352590
Nico Weber [Wed, 30 Jan 2019 02:15:08 +0000 (02:15 +0000)]
lld-link: Add test I forgot to add in 332012
Differential Revision: https://reviews.llvm.org/D46693
llvm-svn: 352589
George Karpenkov [Wed, 30 Jan 2019 02:11:04 +0000 (02:11 +0000)]
[analyzer] [RetainCountChecker] Bugfix for tracking top-level parameters of Objective-C methods
Differential Revision: https://reviews.llvm.org/D57433
llvm-svn: 352588
Sam Clegg [Wed, 30 Jan 2019 02:08:34 +0000 (02:08 +0000)]
Add enum values to CodeGenOpt::Level
The absolute values of this enum are important at least in that
they get printed by SelectionDAGISel. e.g:
`Before: -O2 ; After: -O0`
Differential Revision: https://reviews.llvm.org/D57430
llvm-svn: 352587
Petr Hosek [Wed, 30 Jan 2019 02:06:06 +0000 (02:06 +0000)]
[CMake][Fuchsia] Re-enable iOS runtimes for Fuchsia standard
Turned out this is used by Flutter which uses Fuchsia Clang toolchain.
Differential Revision: https://reviews.llvm.org/D57432
llvm-svn: 352586
Matt Arsenault [Wed, 30 Jan 2019 02:04:31 +0000 (02:04 +0000)]
GlobalISel: Handle more cases for widenScalar for G_STORE
llvm-svn: 352585
Petr Hosek [Wed, 30 Jan 2019 02:02:25 +0000 (02:02 +0000)]
[CMake][Fuchsia] Enable hermetic static libunwind for Fuchsia
In addition to libc++abi and libc++, we also want to use hermetic
static libunwind on Fuchsia.
Differential Revision: https://reviews.llvm.org/D57431
llvm-svn: 352584
Chen Zheng [Wed, 30 Jan 2019 01:57:01 +0000 (01:57 +0000)]
[PowerPC] more opportunity for converting reg+reg to reg+imm
Differential Revision: https://reviews.llvm.org/D57314
llvm-svn: 352583
Matt Arsenault [Wed, 30 Jan 2019 01:10:47 +0000 (01:10 +0000)]
Add 8.0 release bug to merge request script
llvm-svn: 352579
Matt Arsenault [Wed, 30 Jan 2019 01:10:42 +0000 (01:10 +0000)]
GlobalISel: Verify memory size for load/store
llvm-svn: 352578
Kostya Serebryany [Wed, 30 Jan 2019 00:36:28 +0000 (00:36 +0000)]
[libFuzzer] update a test
llvm-svn: 352577
George Burgess IV [Wed, 30 Jan 2019 00:28:56 +0000 (00:28 +0000)]
Remove a redundant space from an error message; NFC
llvm-svn: 352576
Sam Clegg [Wed, 30 Jan 2019 00:25:52 +0000 (00:25 +0000)]
[WebAssembly] Fix undefined weak function symbols in LTO builds
Summary: Fixes PR40219
Subscribers: dschuff, mehdi_amini, inglorion, jgravelle-google, aheejin, sunfish, steven_wu, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D57420
llvm-svn: 352575
Aaron Puchert [Wed, 30 Jan 2019 00:18:24 +0000 (00:18 +0000)]
Fix thread safety tests after r352549
llvm-svn: 352574
Sam Clegg [Wed, 30 Jan 2019 00:15:48 +0000 (00:15 +0000)]
[WebAssembly] Add missing SymbolRef update from rL352551
This change broke some MC tests which are now fixed.
Differential Revision: https://reviews.llvm.org/D57424
llvm-svn: 352573
Artem Dergachev [Wed, 30 Jan 2019 00:06:43 +0000 (00:06 +0000)]
[analyzer] NFC: GenericTaintChecker: Revise rule specification mechanisms.
Provide a more powerful and at the same time more readable way of specifying
taint propagation rules for known functions within the checker.
Now it should be possible to specify an unlimited amount of source and
destination parameters for taint propagation.
No functional change intended just yet.
Patch by Gábor Borsik!
Differential Revision: https://reviews.llvm.org/D55734
llvm-svn: 352572
Kostya Serebryany [Tue, 29 Jan 2019 23:53:28 +0000 (23:53 +0000)]
[libFuzzer] remove stale code
llvm-svn: 352571
Jonas Devlieghere [Tue, 29 Jan 2019 23:48:53 +0000 (23:48 +0000)]
Add FileCollector + test to Xcode project.
llvm-svn: 352570
Thomas Lively [Tue, 29 Jan 2019 23:44:48 +0000 (23:44 +0000)]
[WebAssembly] Lower SCALAR_TO_VECTOR to splats
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish
Differential Revision: https://reviews.llvm.org/D57269
llvm-svn: 352568
Kostya Serebryany [Tue, 29 Jan 2019 23:41:50 +0000 (23:41 +0000)]
[libFuzzer] revert an accidental commit
llvm-svn: 352567
Kostya Serebryany [Tue, 29 Jan 2019 23:40:05 +0000 (23:40 +0000)]
[libFuzzer] remove deprecated support for -fsanitize-coverage=trace-pc[-guard]
llvm-svn: 352566
Matt Arsenault [Tue, 29 Jan 2019 23:38:42 +0000 (23:38 +0000)]
GlobalISel: Fix unused variable warning in release builds
llvm-svn: 352565
Kostya Serebryany [Tue, 29 Jan 2019 23:37:20 +0000 (23:37 +0000)]
[libFuzzer] remove deprecated support for -fsanitize-coverage=trace-pc[-guard]
llvm-svn: 352564
Craig Topper [Tue, 29 Jan 2019 23:31:54 +0000 (23:31 +0000)]
[IR] Use CallBase to reduce code duplication. NFC
Noticed in the asm-goto patch. Callbr needs to go here too. One cast and call is better than 3.
Differential Revision: https://reviews.llvm.org/D57295
llvm-svn: 352563
Matt Arsenault [Tue, 29 Jan 2019 23:29:00 +0000 (23:29 +0000)]
GlobalISel: Verify pointer casts
Not sure if the old AArch64 tests should be just
deleted or not.
llvm-svn: 352562
Thomas Anderson [Tue, 29 Jan 2019 23:19:45 +0000 (23:19 +0000)]
[libc++] Fix Windows build error in <functional>
On my Windows system, __allocator is defined to nothing. This change fixes build errors of the below form:
In file included from algorithm:644:
functional(1492,31): error: expected member name or ';' after declaration specifiers
const _Alloc& __allocator() const { return __f_.second(); }
Differential Revision: https://reviews.llvm.org/D57355
llvm-svn: 352561
Matt Arsenault [Tue, 29 Jan 2019 23:17:35 +0000 (23:17 +0000)]
GlobalISel: Partially implement widenScalar for MERGE_VALUES
llvm-svn: 352560
Petr Hosek [Tue, 29 Jan 2019 23:01:08 +0000 (23:01 +0000)]
[libunwind] Support building hermetic static library
This is useful when the static libunwind library is being linked into
shared libraries that may be used in with other shared libraries that
use different unwinder. We want to avoid avoid exporting libunwind
symbols in those cases. This achieved by a new CMake option which can be
enabled by libunwind vendors as needed.
The same CMake option has already been added to libc++ and libc++abi in
D55404 and D56026.
Differential Revision: https://reviews.llvm.org/D57107
llvm-svn: 352559
Stephen Kelly [Tue, 29 Jan 2019 22:58:28 +0000 (22:58 +0000)]
NFC: Move GenericSelectionExpr dump to NodeDumper
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D56961
llvm-svn: 352558
Zachary Turner [Tue, 29 Jan 2019 22:55:21 +0000 (22:55 +0000)]
Fix some warnings in building LLDB.
Differential Revision: https://reviews.llvm.org/D57413
llvm-svn: 352557
Jonas Devlieghere [Tue, 29 Jan 2019 22:53:47 +0000 (22:53 +0000)]
[test] Use correct macro in FileCollectorTest.cpp
This test was supposed to be skipped on Windows but was using the wrong
macro name.
llvm-svn: 352556
Alina Sbirlea [Tue, 29 Jan 2019 22:33:20 +0000 (22:33 +0000)]
Check bool attribute value in getOptionalBoolLoopAttribute.
Summary:
Check the bool value of the attribute in getOptionalBoolLoopAttribute
not just its existance.
Eliminates the warning noise generated when vectorization is explicitly disabled.
Reviewers: Meinersbur, hfinkel, dmgreen
Subscribers: jlebar, sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D57260
llvm-svn: 352555
Sam Clegg [Tue, 29 Jan 2019 22:26:31 +0000 (22:26 +0000)]
[WebAssembly] Don't load weak undefined symbols from archive files
Summary: Fixes PR40494
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D57370
llvm-svn: 352554
Petr Hosek [Tue, 29 Jan 2019 22:26:18 +0000 (22:26 +0000)]
Drop the dependency on <algorithm>, add placement new inline
We haven't eliminated C++ library dependency altogether in D57251,
UnwindCursor.hpp had an unused dependency on <algorithm> which was
pulling in other C++ headers. Removing that dependency also revealed
(correctly) that we need our own global placement new declaration. Now
libunwind should be independent of the C++ library.
Differential Revision: https://reviews.llvm.org/D57262
llvm-svn: 352553
Stephen Kelly [Tue, 29 Jan 2019 22:22:55 +0000 (22:22 +0000)]
NFC: Implement GenericSelectionExpr::Association dump with Visitor
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D56960
llvm-svn: 352552
Sam Clegg [Tue, 29 Jan 2019 22:22:32 +0000 (22:22 +0000)]
[WebAssembly] Ensure BasicSymbolRef.getRawDataRefImpl().p is non-null
Store a non-zero value to ref.d.a and use ref.d.b to store the symbol
index. This means that ref.p is never null, which was confusing
llvm-nm.
Fixes PR40497
Differential Revision: https://reviews.llvm.org/D57373
llvm-svn: 352551
Shoaib Meenai [Tue, 29 Jan 2019 22:17:51 +0000 (22:17 +0000)]
[docs] Prevent O0 optnone for opt input
If we just compile with -O0, clang will add optnone attributes
everywhere, so opt won't actually be able to perform any passes.
Instruct clang to not emit the optnone so opt can do its thing.
Differential Revision: https://reviews.llvm.org/D56950
llvm-svn: 352550
Aaron Puchert [Tue, 29 Jan 2019 22:11:42 +0000 (22:11 +0000)]
Thread safety analysis: Improve diagnostics for double locking
Summary:
We use the existing diag::note_locked_here to tell the user where we saw
the first locking.
Reviewers: aaron.ballman, delesley
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D56967
llvm-svn: 352549
Adrian Prantl [Tue, 29 Jan 2019 21:46:34 +0000 (21:46 +0000)]
Make a blind attempt at fixing PDBASTParser nullability issues
llvm-svn: 352548
Amara Emerson [Tue, 29 Jan 2019 21:19:33 +0000 (21:19 +0000)]
[AArch64][GlobalISel] Unmerge into scalars from a vector should use FPR bank.
This currently shows up as a selection fallback since the dest regs were given
GPR banks but the source was a vector FPR reg.
Differential Revision: https://reviews.llvm.org/D57408
llvm-svn: 352545
Matt Arsenault [Tue, 29 Jan 2019 21:14:56 +0000 (21:14 +0000)]
OpenCL: Try to fix bot test failure
llvm-svn: 352544
Alexey Bataev [Tue, 29 Jan 2019 21:12:28 +0000 (21:12 +0000)]
[OPENMP]Fix PR40513: lastprivate taskloop counter.
We don't need to use the predetermined data-sharing attributes for the
loop counters if the user explicitly specified correct data-sharing
attributes for such variables.
llvm-svn: 352543
Paul Robinson [Tue, 29 Jan 2019 20:57:50 +0000 (20:57 +0000)]
[cc1as] Test that -g of empty .s file does something sensible.
Depends on LLVM r352541.
llvm-svn: 352542
Paul Robinson [Tue, 29 Jan 2019 20:53:51 +0000 (20:53 +0000)]
[DWARF] Emit reasonable debug info for empty .s files.
llvm-svn: 352541
Matt Arsenault [Tue, 29 Jan 2019 20:49:54 +0000 (20:49 +0000)]
OpenCL: Use length modifier for warning on vector printf arguments
Re-enable format string warnings on printf.
The warnings are still incomplete. Apparently it is undefined to use a
vector specifier without a length modifier, which is not currently
warned on. Additionally, type warnings appear to not be working with
the hh modifier, and aren't warning on all of the special restrictions
from c99 printf.
llvm-svn: 352540
Matt Arsenault [Tue, 29 Jan 2019 20:49:47 +0000 (20:49 +0000)]
Revert "OpenCL: Extend argument promotion rules to vector types"
This reverts r348083. This was based on a misreading of the spec
for printf specifiers.
Also revert r343653, as without a subsequent patch, a correctly
specified format for a vector will incorrectly warn.
Fixes bug 40491.
llvm-svn: 352539
Jonas Devlieghere [Tue, 29 Jan 2019 20:36:38 +0000 (20:36 +0000)]
[Reproducers] Add file provider
This patch adds the file provider which is responsible for capturing
files used by LLDB.
When capturing a reproducer, we use a file collector that is very
similar to the one used in clang. For every file that we touch, we add
an entry with a mapping from its virtual to its real path. When we
decide to generate a reproducer we copy over the files and their
permission into to reproducer folder.
When replaying a reproducer, we load the VFS mapping and instantiate a
RedirectingFileSystem. The latter will transparently use the files
available in the reproducer.
I've tested this on two macOS machines with an artificial example.
Still, it is very likely that I missed some places where we (still) use
native file system calls. I'm hoping to flesh those out while testing
with more advanced examples. However, I will fix those things in
separate patches.
Differential revision: https://reviews.llvm.org/D54617
llvm-svn: 352538
Steven Wu [Tue, 29 Jan 2019 20:13:02 +0000 (20:13 +0000)]
Fix the tests from r350970
Relax the tests from r350970 to allow non-standard path for ld.
llvm-svn: 352537
Sanjay Patel [Tue, 29 Jan 2019 20:02:45 +0000 (20:02 +0000)]
[InstCombine] canonicalize cmp/select form of uadd saturate with constant
I'm circling back around to a loose end from D51929.
The backend (either CGP or DAG) doesn't recognize this pattern, so we end up with different asm for these IR variants.
Regardless of any future changes to canonicalize to saturation/overflow intrinsics, we want to get raw IR variations
into the minimal number of raw IR forms. If/when we can canonicalize to intrinsics, that will make that step easier.
Pre: C2 == ~C1
%a = add i32 %x, C1
%c = icmp ugt i32 %x, C2
%r = select i1 %c, i32 -1, i32 %a
=>
%a = add i32 %x, C1
%c2 = icmp ult i32 %x, C2
%r = select i1 %c2, i32 %a, i32 -1
https://rise4fun.com/Alive/pkH
Differential Revision: https://reviews.llvm.org/D57352
llvm-svn: 352536
James Y Knight [Tue, 29 Jan 2019 19:33:48 +0000 (19:33 +0000)]
Fix the behavior of clang's -w flag.
It is intended to disable _all_ warnings, even those upgraded to
errors via `-Werror=warningname` or `#pragma clang diagnostic error'
Fixes: https://llvm.org/PR38231
Differential Revision: https://reviews.llvm.org/D53199
llvm-svn: 352535
George Karpenkov [Tue, 29 Jan 2019 19:29:59 +0000 (19:29 +0000)]
[analyzer] [RetainCountChecker] Track input parameters to the top-level function
Track them for ISL/OS objects by default, and for NS/CF under a flag.
rdar://
47536377
Differential Revision: https://reviews.llvm.org/D57356
llvm-svn: 352534
George Karpenkov [Tue, 29 Jan 2019 19:29:45 +0000 (19:29 +0000)]
[analyzer] [RetainSummaryManager] [NFC] Split one function into two, as it's really doing two things
Differential Revision: https://reviews.llvm.org/D57201
llvm-svn: 352533
George Karpenkov [Tue, 29 Jan 2019 19:29:33 +0000 (19:29 +0000)]
[analyzer] [ARCMT] [NFC] Unify entry point into RetainSummaryManager
Just use one single entry point, since we have AnyCall utility now.
Differential Revision: https://reviews.llvm.org/D57346
llvm-svn: 352532
George Karpenkov [Tue, 29 Jan 2019 19:29:19 +0000 (19:29 +0000)]
Extend AnyCall to handle callable declarations without the call expressions
That weakens inner invariants, but allows the class to be more generic,
allowing usage in situations where the call expression is not known (or
should not matter).
Differential Revision: https://reviews.llvm.org/D57344
llvm-svn: 352531
George Karpenkov [Tue, 29 Jan 2019 19:29:07 +0000 (19:29 +0000)]
[analyzer] [RetainCountChecker] Support 'taggedRetain' and 'taggedRelease'
Differential Revision: https://reviews.llvm.org/D57211
llvm-svn: 352530
Martin Storsjo [Tue, 29 Jan 2019 19:24:32 +0000 (19:24 +0000)]
[MinGW] Don't define names for ignored options. NFC.
Move them to the same section as the newly added ignored options
without a defined name.
Also move options that actually weren't ignored to the right section.
Differential Revision: https://reviews.llvm.org/D57374
llvm-svn: 352529
Sanjay Patel [Tue, 29 Jan 2019 19:13:39 +0000 (19:13 +0000)]
[DAGCombiner] fold extract_subvector of extract_subvector
This is the sibling fold for insert-of-insert that was added with D56604.
Now that we have x86 shuffle narrowing (D57156), this change shows improvements for
lots of AVX512 reduction code (not sure that we would ever expect extract-of-extract otherwise).
There's a small regression in some of the partial-permute tests (extracting followed by splat).
That is tracked by PR40500:
https://bugs.llvm.org/show_bug.cgi?id=40500
Differential Revision: https://reviews.llvm.org/D57336
llvm-svn: 352528
Michael J. Spencer [Tue, 29 Jan 2019 19:07:15 +0000 (19:07 +0000)]
[VFS] Fix warning and use better check.
llvm-svn: 352527
Alexey Bataev [Tue, 29 Jan 2019 18:51:58 +0000 (18:51 +0000)]
[OPENMP]Make the loop with unsigned counter countable.
According to the report, better to keep the original strict compare
operation as the loop condition with unsigned loop counters to make the
loop countable. This allows further loop transformations.
llvm-svn: 352526
Thomas Anderson [Tue, 29 Jan 2019 18:48:35 +0000 (18:48 +0000)]
[libc++] Fix Windows build error in include/filesystem
_LIBCPP_FUNC_VIS is redundant since the class is already annotated with
_LIBCPP_EXCEPTION_ABI.
Fixes this build error:
In file included from fstream:188:
filesystem(1350,3): error: attribute 'dllimport' cannot be applied to member of 'dllimport' class
_LIBCPP_FUNC_VIS
__config(674,37): note: expanded from macro '_LIBCPP_FUNC_VIS'
#define _LIBCPP_FUNC_VIS _LIBCPP_DLL_VIS
__config(666,38): note: expanded from macro '_LIBCPP_DLL_VIS'
# define _LIBCPP_DLL_VIS __declspec(dllimport)
filesystem(1313,7): note: previous attribute is here
class _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error {
__config(675,37): note: expanded from macro '_LIBCPP_EXCEPTION_ABI'
#define _LIBCPP_EXCEPTION_ABI _LIBCPP_DLL_VIS
__config(666,38): note: expanded from macro '_LIBCPP_DLL_VIS'
# define _LIBCPP_DLL_VIS __declspec(dllimport)
Differential Revision: https://reviews.llvm.org/D57354
llvm-svn: 352525
Sterling Augustine [Tue, 29 Jan 2019 18:27:51 +0000 (18:27 +0000)]
Rollback unwindlib patch.
llvm-svn: 352524
Matt Arsenault [Tue, 29 Jan 2019 18:13:02 +0000 (18:13 +0000)]
GlobalISel: Fix narrowScalar for load/store with different mem size
This was ignoring the memory size, and producing multiple loads/stores
if the operand size was different from the memory size.
I assume this is the intent of not having an explicit G_ANYEXTLOAD
(although I think that would probably be better).
llvm-svn: 352523
Eric Fiselier [Tue, 29 Jan 2019 18:01:14 +0000 (18:01 +0000)]
Fix PR40495 - is_invokable_v<void> does not compile
The meta-programming that attempted to form the invoke call expression
was not in a SFINAE context. This made it a hard error to provide
non-referencable types like 'void' or 'void (...) const'.
This patch fixes the error by checking the validity of the call
expression within a SFINAE context.
llvm-svn: 352522
Adrian Prantl [Tue, 29 Jan 2019 17:52:34 +0000 (17:52 +0000)]
Make Type::GetByteSize optional (NFC)
This is a continuation of my quest to make the size 0 a supported value.
This reapplies r352394 with additional PDB parser fixes prepared by
Pavel Labath!
Differential Revision: https://reviews.llvm.org/D57273
llvm-svn: 352521
Sanjay Patel [Tue, 29 Jan 2019 17:00:47 +0000 (17:00 +0000)]
[x86] add tests for vector bool math; NFC
llvm-svn: 352520
Sanjay Patel [Tue, 29 Jan 2019 17:00:07 +0000 (17:00 +0000)]
[AArch64] add tests for vector bool math; NFC
llvm-svn: 352519
Andrea Di Biagio [Tue, 29 Jan 2019 16:47:27 +0000 (16:47 +0000)]
[X86][Btver2] Improved latency/throughput model for scalar int-to-float conversions.
Account for bypass delays when computing the latency of scalar int-to-float
conversions.
On Jaguar we need to account for an extra 6cy latency (see AMD fam16h SOG).
This patch also fixes the number of micropcodes for the register-memory variants
of scalar int-to-float conversions.
Differential Revision: https://reviews.llvm.org/D57148
llvm-svn: 352518
Sanjay Patel [Tue, 29 Jan 2019 16:44:05 +0000 (16:44 +0000)]
[InstCombine] regenerate test checks; NFC
llvm-svn: 352517
James Y Knight [Tue, 29 Jan 2019 16:43:16 +0000 (16:43 +0000)]
Add .clang-tidy and .clang-format files to the toplevel of the
repository (the same content as those in llvm/ and clang/).
llvm-svn: 352516
Sanjay Patel [Tue, 29 Jan 2019 16:39:23 +0000 (16:39 +0000)]
[InstCombine] add tests for ext-of-bool + add/sub; NFC
We should choose one of these as canonical:
%z = zext i1 %cmp to i32
%r = sub i32 %x, %z
=>
%s = sext i1 %cmp to i32
%r = add i32 %x, %s
The test comments assume that the zext form is better,
but we can adjust that if we decide to go the other way.
llvm-svn: 352515
James Y Knight [Tue, 29 Jan 2019 16:37:27 +0000 (16:37 +0000)]
Adjust documentation for git migration.
This fixes most references to the paths:
llvm.org/svn/
llvm.org/git/
llvm.org/viewvc/
github.com/llvm-mirror/
github.com/llvm-project/
reviews.llvm.org/diffusion/
to instead point to https://github.com/llvm/llvm-project.
This is *not* a trivial substitution, because additionally, all the
checkout instructions had to be migrated to instruct users on how to
use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of
checking out various projects into various subdirectories.
I've attempted to not change any scripts here, only documentation. The
scripts will have to be addressed separately.
Additionally, I've deleted one document which appeared to be outdated
and unneeded:
lldb/docs/building-with-debug-llvm.txt
Differential Revision: https://reviews.llvm.org/D57330
llvm-svn: 352514
Louis Dionne [Tue, 29 Jan 2019 16:30:11 +0000 (16:30 +0000)]
[NFC] Add missing revision for removal of bad_array_length in ABI changelog
llvm-svn: 352513
Marshall Clow [Tue, 29 Jan 2019 16:12:45 +0000 (16:12 +0000)]
Mark some of the behavior in the move w/allocator constructors of deque/unordered containers as 'libc++-specific'. Thanks to Andrey Maksimov for pointing this out.
llvm-svn: 352512
Ilya Biryukov [Tue, 29 Jan 2019 16:04:39 +0000 (16:04 +0000)]
[clangd] Remove extra ';' to fix -Wpedantic warning. NFC
llvm-svn: 352511
Ilya Biryukov [Tue, 29 Jan 2019 15:57:14 +0000 (15:57 +0000)]
[clangd] Attempt to fix failing buildbots after r352494
For failures see:
http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/38501/steps/build-unified-tree/logs/stdio
llvm-svn: 352510
Ilya Biryukov [Tue, 29 Jan 2019 15:52:05 +0000 (15:52 +0000)]
[clangd] Make -clang-tidy-checks a non-hidden command-line arg
Summary:
This looks like a useful user-facing configuration parameter,
which should be discoverable.
Also fix a small typo in the description.
Reviewers: hokein
Reviewed By: hokein
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D57384
llvm-svn: 352509
Nico Weber [Tue, 29 Jan 2019 15:50:31 +0000 (15:50 +0000)]
lld-link: Allow backward references between associated comdats
References between associated comdats are invalid per COFF spec, but the newest
Windows SDK contains obj files that have these references
(https://bugs.chromium.org/p/chromium/issues/detail?id=925943#c13). So add back
support for them and add tests for them. The old code handled them fine.
This makes lld-link match the behavior of newer link.exe versions as far as I
can tell. (The behavior before this change matched the behavior of older
link.exe versions.)
This mostly reverts r352254.
Differential Revision: https://reviews.llvm.org/D57387
llvm-svn: 352508
Pavel Labath [Tue, 29 Jan 2019 15:39:27 +0000 (15:39 +0000)]
BreakpadRecords: Add parsing code for FILE and LINE records
The two records aren't used by anything yet, but this part can be
separated out easily, so I am comitting it separately to simplify
reviews of the followup patch.
llvm-svn: 352507
Nirav Dave [Tue, 29 Jan 2019 15:14:07 +0000 (15:14 +0000)]
[SelectionDAGBuilder] Remove redundant variable. NFCI.
llvm-svn: 352506
Jordan Rupprecht [Tue, 29 Jan 2019 15:05:38 +0000 (15:05 +0000)]
[llvm-objcopy] Implement --set-section-flags.
Summary:
--set-section-flags is used to change the section flags (e.g. SHF_ALLOC) for given sections. The flags allowed are the same from the existing --rename-section=.old=.new[,flags] feature.
Additionally, make sure that --set-section-flag cannot be used with --rename-section (either the source or destination), since --rename-section accepts flags. This avoids ambiguity for something like "--rename-section=.foo=.bar,alloc --set-section-flag=.bar,code".
Reviewers: jhenderson, jakehehrlich, alexshap, espindola
Reviewed By: jhenderson, jakehehrlich
Subscribers: llvm-commits, emaste, arichardson
Differential Revision: https://reviews.llvm.org/D57198
llvm-svn: 352505
Ayonam Ray [Tue, 29 Jan 2019 15:00:50 +0000 (15:00 +0000)]
Reversing the checkin for version 352484 as tests are failing.
llvm-svn: 352504
Eric Liu [Tue, 29 Jan 2019 14:40:01 +0000 (14:40 +0000)]
[Tooling] Handle #pragma once header guard in include insertion.
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D57223
llvm-svn: 352503
Nico Weber [Tue, 29 Jan 2019 14:39:54 +0000 (14:39 +0000)]
gn build: Merge r352444, r352431, r352430
llvm-svn: 352502
Ilya Biryukov [Tue, 29 Jan 2019 14:31:19 +0000 (14:31 +0000)]
[clangd] Unit test for sourceLocationInMainFile.
This should have been part of r352494, which added the corresponding
function. The unit test ended up as a separate commit accidentally.
llvm-svn: 352501
Neil Henning [Tue, 29 Jan 2019 14:28:17 +0000 (14:28 +0000)]
[AMDGPU] Fix a weird WWM intrinsic issue.
I found a really strange WWM issue through a very convoluted shader that
essentially boils down to a bug in SIInstrInfo where canReadVGPR did not
correctly identify that WWM is like a copy and can have a VGPR as its
source.
Differential Revision: https://reviews.llvm.org/D56002
llvm-svn: 352500
Fangrui Song [Tue, 29 Jan 2019 14:24:35 +0000 (14:24 +0000)]
[ELF] Simplify. NFC
llvm-svn: 352499
Ilya Biryukov [Tue, 29 Jan 2019 14:17:36 +0000 (14:17 +0000)]
[clangd] Interfaces for writing code tweaks
Summary:
The code tweaks are an implementation of mini-refactorings exposed
via the LSP code actions. They run in two stages:
- Stage 1. Decides whether the action is available to the user and
collects all the information required to finish the action.
Should be cheap, since this will run over all the actions known to
clangd on each textDocument/codeAction request from the client.
- Stage 2. Uses information from stage 1 to produce the actual edits
that the code action should perform. This stage can be expensive and
will only run if the user chooses to perform the specified action in
the UI.
One unfortunate consequence of this change is increased latency of
processing the textDocument/codeAction requests, which now wait for an
AST. However, we cannot avoid this with what we have available in the LSP
today.
Reviewers: kadircet, ioeric, hokein, sammccall
Reviewed By: sammccall
Subscribers: mgrang, mgorny, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D56267
llvm-svn: 352494
Hans Wennborg [Tue, 29 Jan 2019 13:43:22 +0000 (13:43 +0000)]
Revert r351833 and r352250.
They were breaking the Windows build when using MSBuild, see the
discussion on D56781.
r351833: "Use response file when generating LLVM-C.dll"
> Use response file when generating LLVM-C.dll
>
> As discovered in D56774 the command line gets to long, so use a response file to give the script the libs. This change has been tested and is confirmed working for me.
>
> Commited on behalf of Jakob Bornecrantz
>
> Differential Revision: https://reviews.llvm.org/D56781
r352250: "Build LLVM-C.dll by default on windows and enable in release package"
> Build LLVM-C.dll by default on windows and enable in release package
>
> With the fixes to the building of LLVM-C.dll in D56781 this should now
> be safe to land. This will greatly simplify dealing with LLVM for people
> that just want to use the C API on windows. This is a follow up from
> D35077.
>
> Patch by Jakob Bornecrantz!
>
> Differential revision: https://reviews.llvm.org/D56774
llvm-svn: 352492