platform/upstream/llvm.git
5 years agoCheck that __MAC_OS_X_VERSION_MIN_REQUIRED is defined before checking
Akira Hatanaka [Sat, 20 Oct 2018 17:35:50 +0000 (17:35 +0000)]
Check that __MAC_OS_X_VERSION_MIN_REQUIRED is defined before checking
whether it is too old.

llvm-svn: 344856

5 years ago[InstCombine] use 'match' to simplify code; NFC
Sanjay Patel [Sat, 20 Oct 2018 17:15:57 +0000 (17:15 +0000)]
[InstCombine] use 'match' to simplify code; NFC

llvm-svn: 344855

5 years ago[InstCombine] make code more flexible with lambda; NFC
Sanjay Patel [Sat, 20 Oct 2018 16:58:27 +0000 (16:58 +0000)]
[InstCombine] make code more flexible with lambda; NFC

I couldn't tell from svn history when these checks were added,
but it pre-dates the split of instcombine into its own directory
at rL92459.

The motivation for changing the check is partly shown by the
code in PR34724:
https://bugs.llvm.org/show_bug.cgi?id=34724

There are also existing regression tests for SLPVectorizer with
sequences of extract+insert that are likely assumed to become
shuffles by the vectorizer cost models.

llvm-svn: 344854

5 years ago[InstCombine] add explanatory comment for strange vector logic; NFC
Sanjay Patel [Sat, 20 Oct 2018 16:25:55 +0000 (16:25 +0000)]
[InstCombine] add explanatory comment for strange vector logic; NFC

llvm-svn: 344852

5 years ago[clangd] Namespace style cleanup in cpp files. NFC.
Sam McCall [Sat, 20 Oct 2018 15:30:37 +0000 (15:30 +0000)]
[clangd] Namespace style cleanup in cpp files. NFC.

Standardize on the most common namespace setup in our *.cpp files:
  using namespace llvm;
  namespace clang {
  namespace clangd {
  void foo(StringRef) { ... }
And remove redundant llvm:: qualifiers. (Except for cases like
make_unique where this causes problems with std:: and ADL).

This choice is pretty arbitrary, but some broad consistency is nice.
This is going to conflict with everything. Sorry :-/

Squash the other configurations:

A)
  using namespace llvm;
  using namespace clang;
  using namespace clangd;
  void clangd::foo(StringRef);
This is in some of the older files. (It prevents accidentally defining a
new function instead of one in the header file, for what that's worth).

B)
  namespace clang {
  namespace clangd {
  void foo(llvm::StringRef) { ... }
This is fine, but in practice the using directive often gets added over time.

C)
  namespace clang {
  namespace clangd {
  using namespace llvm; // inside the namespace
This was pretty common, but is a bit misleading: name lookup preferrs
clang::clangd::foo > clang::foo > llvm:: foo (no matter where the using
directive is).

llvm-svn: 344850

5 years ago[SLPVectorizer][X86] Add mul/and/or/xor unrolled reduction tests
Simon Pilgrim [Sat, 20 Oct 2018 15:17:27 +0000 (15:17 +0000)]
[SLPVectorizer][X86] Add mul/and/or/xor unrolled reduction tests

We miss arithmetic reduction for everything but Add/FAdd (I assume because that's the only cases which x86 has horizontal ops for.....)

llvm-svn: 344849

5 years ago[SLPVectorizer] regenerate test checks; NFC
Sanjay Patel [Sat, 20 Oct 2018 14:53:07 +0000 (14:53 +0000)]
[SLPVectorizer] regenerate test checks; NFC

llvm-svn: 344848

5 years ago[NFC][Test commit] Fix typos in a comment
Aleksei Sidorin [Sat, 20 Oct 2018 14:47:37 +0000 (14:47 +0000)]
[NFC][Test commit] Fix typos in a comment

llvm-svn: 344847

5 years ago[CostModel][X86] Add integer vector reduction cost tests
Simon Pilgrim [Sat, 20 Oct 2018 14:29:59 +0000 (14:29 +0000)]
[CostModel][X86] Add integer vector reduction cost tests

llvm-svn: 344846

5 years agoFix MSVC "truncation from 'double' to 'float'" warning. NFCI.
Simon Pilgrim [Sat, 20 Oct 2018 13:20:26 +0000 (13:20 +0000)]
Fix MSVC "truncation from 'double' to 'float'" warning. NFCI.

llvm-svn: 344845

5 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Sat, 20 Oct 2018 13:18:49 +0000 (13:18 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

llvm-svn: 344844

5 years agoReplace setFeature macro with lambda to fix MSVC "shift count negative or too big...
Simon Pilgrim [Sat, 20 Oct 2018 13:16:31 +0000 (13:16 +0000)]
Replace setFeature macro with lambda to fix MSVC "shift count negative or too big" warnings. NFCI.

llvm-svn: 344843

5 years agoAdd an addAbsolute static function to Writer.cpp
Alexander Richardson [Sat, 20 Oct 2018 11:12:50 +0000 (11:12 +0000)]
Add an addAbsolute static function to Writer.cpp

Summary:
SymbolTable::addAbsolute() was removed in rL344305.
To me this is more readable than the lambda named `Add` and in our
out-of-tree CHERI target we use addAbsolute() in another function.

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: kristina, emaste, llvm-commits

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

llvm-svn: 344842

5 years agoDebugInfo: Use base address specifiers more aggressively
David Blaikie [Sat, 20 Oct 2018 09:16:49 +0000 (09:16 +0000)]
DebugInfo: Use base address specifiers more aggressively

Using a base address specifier even for a single-element range is a size
win for object files (7 words versus 8 words - more significant savings
if the debug info is compressed (since it's 3 words of uncompressable
reloc + 4 compressable words compared to 6 uncompressable reloc + 2
compressable words) - does trade off executable size increase though.

llvm-svn: 344841

5 years ago[clang-query] Add option to print matcher expression
Stephen Kelly [Sat, 20 Oct 2018 09:13:59 +0000 (09:13 +0000)]
[clang-query] Add option to print matcher expression

Summary:
This is useful if using clang-query -f with a file containing multiple
matchers.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 344840

5 years agoAdd missed file from previous commit (r344838)
David Blaikie [Sat, 20 Oct 2018 08:55:51 +0000 (08:55 +0000)]
Add missed file from previous commit (r344838)

llvm-svn: 344839

5 years agoDebugInfo: Use DW_OP_addrx in DWARFv5
David Blaikie [Sat, 20 Oct 2018 08:54:05 +0000 (08:54 +0000)]
DebugInfo: Use DW_OP_addrx in DWARFv5

Reuse addresses in the address pool, even in non-split cases.

llvm-svn: 344838

5 years agoDebugInfo: Implement debug_rnglists.dwo
David Blaikie [Sat, 20 Oct 2018 08:12:36 +0000 (08:12 +0000)]
DebugInfo: Implement debug_rnglists.dwo

Save space/relocations in .o files by keeping dwo ranges in the dwo
file rather than the .o file.

llvm-svn: 344837

5 years agoDebugInfo: Use address pool forms in debug_rnglists
David Blaikie [Sat, 20 Oct 2018 07:36:39 +0000 (07:36 +0000)]
DebugInfo: Use address pool forms in debug_rnglists

Save no relocations by reusing addresses from the address pool.

llvm-svn: 344836

5 years agollvm-dwarfdump: Support RLE_addressx and RLE_startx_length in .debug_rnglists
David Blaikie [Sat, 20 Oct 2018 06:16:25 +0000 (06:16 +0000)]
llvm-dwarfdump: Support RLE_addressx and RLE_startx_length in .debug_rnglists

llvm-svn: 344835

5 years agoDebugInfo: Use debug_addr for non-dwo addresses in DWARF 5
David Blaikie [Sat, 20 Oct 2018 06:02:15 +0000 (06:02 +0000)]
DebugInfo: Use debug_addr for non-dwo addresses in DWARF 5

Putting addresses in the address pool, even with non-fission, can reduce
relocations - reusing the addresses from debug_info and debug_rnglists
(the latter coming soon)

llvm-svn: 344834

5 years ago[CodeGen] Use the mangle context owned by CodeGenModule to correctly
Akira Hatanaka [Sat, 20 Oct 2018 05:45:01 +0000 (05:45 +0000)]
[CodeGen] Use the mangle context owned by CodeGenModule to correctly
mangle types of lambda objects captured by a block instead of creating a
new mangle context everytime a captured field type is mangled.

This fixes a bug in IRGen's block helper merging code that was
introduced in r339438 where two blocks capturing two distinct lambdas
would end up sharing helper functions and the block descriptor. This
happened because the ID number used to distinguish lambdas defined
in the same context is reset everytime a mangled context is created.

rdar://problem/45314494

llvm-svn: 344833

5 years ago[X86] Add support for more than 32 features for __builtin_cpu_is
Craig Topper [Sat, 20 Oct 2018 03:51:52 +0000 (03:51 +0000)]
[X86] Add support for more than 32 features for __builtin_cpu_is

libgcc supports more than 32 features by adding a new 32-bit variable __cpu_features2.

This adds the clang support for checking these feature bits.

Patches for compiler-rt and llvm to support this are coming as well.

Probably still need an additional patch for target multiversioning in clang.

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

llvm-svn: 344832

5 years ago[X86] Add additional CPUs and features to Host.cpp and X86TargetParser.def to match...
Craig Topper [Sat, 20 Oct 2018 03:51:43 +0000 (03:51 +0000)]
[X86] Add additional CPUs and features to Host.cpp and X86TargetParser.def to match compiler-rt and enable __builtin_cpu_supports/__builtin_cpu_is support in clang

Summary: This matches LLVM to D53461 for compiler-rt.

Reviewers: echristo, erichkeane

Reviewed By: echristo

Subscribers: dberris, llvm-commits

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

llvm-svn: 344831

5 years ago[X86][compiler-rt] Add additional CPUs and features to the cpu detection to match...
Craig Topper [Sat, 20 Oct 2018 03:49:04 +0000 (03:49 +0000)]
[X86][compiler-rt] Add additional CPUs and features to the cpu detection to match libgcc

Summary: This patch adds additional features and cpus from libgcc. Unfortunately we've overflowed the existing 32-bits of features so we had to add a new __cpu_features2 variable to hold the additional bits. This matches libgcc as far as I can tell.

Reviewers: echristo

Reviewed By: echristo

Subscribers: dberris, llvm-commits

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

llvm-svn: 344830

5 years ago[libcxx] [test] Don't detect Windows' UCRT with TEST_COMPILER_C1XX
Billy Robert O'Neal III [Sat, 20 Oct 2018 03:35:45 +0000 (03:35 +0000)]
[libcxx] [test] Don't detect Windows' UCRT with TEST_COMPILER_C1XX

The test is trying to avoid saying aligned_alloc on Windows' UCRT, which does not (and can not) implement aligned_alloc. However, it's testing for c1xx, meaning clang on Windows will fail this test when using the UCRT.

llvm-svn: 344829

5 years agoMake -Wfor-loop-analysis work with C++17
Richard Trieu [Sat, 20 Oct 2018 02:15:58 +0000 (02:15 +0000)]
Make -Wfor-loop-analysis work with C++17

For now, disable the "variable in loop condition not modified" warning to not
be emitted when there is a structured binding variable in the loop condition.

https://bugs.llvm.org/show_bug.cgi?id=39285

llvm-svn: 344828

5 years agoDisable unittests/clangd/JSONTransportTests.cpp on versions of macosx
Akira Hatanaka [Sat, 20 Oct 2018 02:11:45 +0000 (02:11 +0000)]
Disable unittests/clangd/JSONTransportTests.cpp on versions of macosx
earlier than 10.13.

rdar://problem/45310173

llvm-svn: 344827

5 years ago[WebAssembly] Implement vector sext_inreg and tests with comparisons
Thomas Lively [Sat, 20 Oct 2018 01:35:23 +0000 (01:35 +0000)]
[WebAssembly] Implement vector sext_inreg and tests with comparisons

Summary: Depends on D53251.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 344826

5 years ago[WebAssembly] Custom lower i64x2 constant shifts to avoid wrap
Thomas Lively [Sat, 20 Oct 2018 01:31:18 +0000 (01:31 +0000)]
[WebAssembly] Custom lower i64x2 constant shifts to avoid wrap

Summary: Depends on D53057.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 344825

5 years ago[X86] When checking the bits in cpu_features for function multiversioning dispatcher...
Craig Topper [Sat, 20 Oct 2018 01:30:00 +0000 (01:30 +0000)]
[X86] When checking the bits in cpu_features for function multiversioning dispatcher in the resolver, make sure all the required bits are set. Not just one of them

Summary:
The multiversioning code repurposed the code from __builtin_cpu_supports for checking if a single feature is enabled. That code essentially performed (_cpu_features & (1 << C)) != 0. But with the multiversioning path, the mask is no longer guaranteed to be a power of 2. So we return true anytime any one of the bits in the mask is set not just all of the bits.

The correct check is (_cpu_features & mask) == mask

Reviewers: erichkeane, echristo

Reviewed By: echristo

Subscribers: cfe-commits

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

llvm-svn: 344824

5 years ago[analyzer] Be more plugin-friendly by moving static locals into .cpp files.
Artem Dergachev [Sat, 20 Oct 2018 00:29:24 +0000 (00:29 +0000)]
[analyzer] Be more plugin-friendly by moving static locals into .cpp files.

The GDMIndex functions return a pointer that's used as a key for looking up
data, but addresses of local statics defined in header files aren't the same
across shared library boundaries and the result is that analyzer plugins
can't access this data.

Event types are uniqued by using the addresses of a local static defined
in a header files, but it isn't the same across shared library boundaries
and plugins can't currently handle ImplicitNullDerefEvents.

Patches by Joe Ranieri!

Differential Revision: https://reviews.llvm.org/D52905
Differential Revision: https://reviews.llvm.org/D52906

llvm-svn: 344823

5 years ago[MachineCSE][GlobalISel] Making sure MachineCSE works mid-GlobalISel (again)
Roman Tereshin [Sat, 20 Oct 2018 00:06:15 +0000 (00:06 +0000)]
[MachineCSE][GlobalISel] Making sure MachineCSE works mid-GlobalISel (again)

Change of approach, it looks like it's a much better idea to deal with
the vregs that have LLTs and reg classes both properly, than trying to
avoid creating those across all GlobalISel passes and all targets.

The change mostly touches MachineRegisterInfo::constrainRegClass,
which is apparently only used by MachineCSE. The changes are NFC for
any pipeline but one that contains MachineCSE mid-GlobalISel.

NOTE on isCallerPreservedOrConstPhysReg change in MachineCSE:

    There is no test covering it as the only way to insert a new pass
(MachineCSE) from a command line I know of is llc's -run-pass option,
which only works with MIR, but MIRParser freezes reserved registers upon
MachineFunctions creation, making it impossible to reproduce the state
that exposes the issue.

Reviwed By: aditya_nandakumar

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

llvm-svn: 344822

5 years ago[libcxx] [test] Add missing <stdexcept> to map at tests.
Billy Robert O'Neal III [Fri, 19 Oct 2018 23:49:15 +0000 (23:49 +0000)]
[libcxx] [test] Add missing <stdexcept> to map at tests.

Reviewed as https://reviews.llvm.org/D50551

llvm-svn: 344821

5 years agoRepair thread-unsafe modifications of n_alive in F.pass.cpp
Billy Robert O'Neal III [Fri, 19 Oct 2018 23:45:45 +0000 (23:45 +0000)]
Repair thread-unsafe modifications of n_alive in F.pass.cpp

In this example, the ctor of G runs in the main thread in the expression G(), and also in the copy ctor of G() in the DECAY_COPY inside std::thread. The main thread destroys the G() instance at the semicolon, and the started thread destroys the G() after it returns. Thus there is a race between the threads on the n_alive variable.

The fix is to join with the background thread before attempting to destroy the G in the main thread.

llvm-svn: 344820

5 years ago[llvm-objdump] Fix --file-headers (-f) option
Petar Jovanovic [Fri, 19 Oct 2018 22:16:49 +0000 (22:16 +0000)]
[llvm-objdump] Fix --file-headers (-f) option

Changed the format call to match the surrounding code. Previously it was
printing an unsigned int while the return type being printed was
long unsigned int or wider. This caused problems for big-endian systems
which were discovered on mips64.
Also, the printed address had less characters than it should because the
character count was directly obtained from the number of bytes in the
address.
The tests were adapted to fit this fix and now use longer addresses.

Patch by Milos Stojanovic.

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

llvm-svn: 344818

5 years ago[LoopVectorize] Loop vectorization for minimum and maximum
Thomas Lively [Fri, 19 Oct 2018 21:11:43 +0000 (21:11 +0000)]
[LoopVectorize] Loop vectorization for minimum and maximum

Summary: Depends on D52766.

Reviewers: aheejin, dschuff

Subscribers: llvm-commits

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

llvm-svn: 344816

5 years agoAMDGPU: Add support pattern for SUB of one bit
Changpeng Fang [Fri, 19 Oct 2018 21:09:21 +0000 (21:09 +0000)]
AMDGPU: Add support pattern for SUB of one bit

Summary:
  Add selection patterns to support one bit Sub.

Reviewers:
  rampitec, arsenm

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

llvm-svn: 344815

5 years ago[NFC][InstCombine] Undo stray change
Evandro Menezes [Fri, 19 Oct 2018 20:57:45 +0000 (20:57 +0000)]
[NFC][InstCombine] Undo stray change

Undo stray change introduced by r344725.

llvm-svn: 344814

5 years ago[X86] Remove some left over code from when MVT:i1 was a legal type for AVX512.
Craig Topper [Fri, 19 Oct 2018 20:44:33 +0000 (20:44 +0000)]
[X86] Remove some left over code from when MVT:i1 was a legal type for AVX512.

llvm-svn: 344813

5 years agoFix typos in assert message
Matt Arsenault [Fri, 19 Oct 2018 20:17:05 +0000 (20:17 +0000)]
Fix typos in assert message

llvm-svn: 344812

5 years ago[GISel]: Allow PHIs to be DCEd
Aditya Nandakumar [Fri, 19 Oct 2018 20:11:52 +0000 (20:11 +0000)]
[GISel]: Allow PHIs to be DCEd

https://reviews.llvm.org/D53304

Currently dead phis are not cleaned up during DCE. This patch allows
dead PHI and G_PHI insts to be deleted.

Reviewed by: dsanders

llvm-svn: 344811

5 years ago[PDB] Test variadic function type in PDB
Aaron Smith [Fri, 19 Oct 2018 19:30:59 +0000 (19:30 +0000)]
[PDB] Test variadic function type in PDB

This adds back the test case reverted in commit: d260a269200824c5c1c8c6de531fd5aa63db9c35

llvm-svn: 344809

5 years ago[X86] In PostprocessISelDAG, start from allnodes_end, not the root.
Craig Topper [Fri, 19 Oct 2018 19:24:42 +0000 (19:24 +0000)]
[X86] In PostprocessISelDAG, start from allnodes_end, not the root.

There is no guarantee the root is at the end if isel created any nodes without morphing them. This includes the nodes created by manual isel from C++ code in X86ISelDAGToDAG.

This is similar to r333415 from PowerPC which is where I originally stole the peephole loop from.

I don't have a test case, but without this a future patch doesn't work which is how I found it.

llvm-svn: 344808

5 years ago[DWARF] Make llvm-dwarfdump display location lists in a .dwp file correctly. Fixes...
Wolfgang Pieb [Fri, 19 Oct 2018 19:23:16 +0000 (19:23 +0000)]
[DWARF] Make llvm-dwarfdump display location lists in a .dwp file correctly. Fixes PR38990.

Considers the index when extracting location lists from a .dwp file.
Majority of the patch by David Blaikie.

Reviewers: dblaikie

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

llvm-svn: 344807

5 years agoRevert "[Driver] Reland: Default Android toolchains to libc++."
Dan Albert [Fri, 19 Oct 2018 19:23:01 +0000 (19:23 +0000)]
Revert "[Driver] Reland: Default Android toolchains to libc++."

This reverts commit 84677d5009d613232d360fda27e6e41fb5cb6700.

llvm-svn: 344806

5 years ago[WebAssembly] Handle undefined lane indices in SIMD patterns
Thomas Lively [Fri, 19 Oct 2018 19:08:06 +0000 (19:08 +0000)]
[WebAssembly] Handle undefined lane indices in SIMD patterns

Summary:
Undefined indices in shuffles can be used when not all lanes of the
output vector will be used. This happens for example in the expansion
of vector reduce operations. Regardless, undefs are legal as lane
indices in IR and should be supported.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 344803

5 years agoFix a use-after-RAUW bug in large GEP splitting
Krzysztof Pszeniczny [Fri, 19 Oct 2018 19:02:16 +0000 (19:02 +0000)]
Fix a use-after-RAUW bug in large GEP splitting

Summary:
Large GEP splitting, introduced in rL332015, uses a `DenseMap<AssertingVH<Value>, ...>`. This causes an assertion to fail (in debug builds) or undefined behaviour to occur (in release builds) when a value is RAUWed.

This manifested itself in the 7zip benchmark from the llvm test suite built on ARM with `-fstrict-vtable-pointers` enabled while RAUWing invariant group launders and splits in CodeGenPrepare.

This patch merges the large offsets of the argument and the result of an invariant.group strip/launder intrinsic before RAUWing.

Reviewers: Prazek, javed.absar, haicheng, efriedma

Reviewed By: Prazek, efriedma

Subscribers: kristof.beyls, hiraditya, llvm-commits

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

llvm-svn: 344802

5 years agoPR24164, PR39336: init-captures are not distinct full-expressions.
Richard Smith [Fri, 19 Oct 2018 19:01:34 +0000 (19:01 +0000)]
PR24164, PR39336: init-captures are not distinct full-expressions.

Rather, they are subexpressions of the enclosing lambda-expression, and
any temporaries in them are destroyed at the end of that
full-expression, or when the corresponding lambda-expression is
destroyed if they are lifetime-extended.

llvm-svn: 344801

5 years agoAdd basic test that we perform lifetime extension in the expected
Richard Smith [Fri, 19 Oct 2018 19:01:31 +0000 (19:01 +0000)]
Add basic test that we perform lifetime extension in the expected
situations.

llvm-svn: 344800

5 years ago[InstCombine] InstCombine and InstSimplify for minimum and maximum
Thomas Lively [Fri, 19 Oct 2018 19:01:26 +0000 (19:01 +0000)]
[InstCombine] InstCombine and InstSimplify for minimum and maximum

Summary: Depends on D52765

Reviewers: aheejin, dschuff

Subscribers: llvm-commits

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

llvm-svn: 344799

5 years ago[lldb] Add support in Status::AsCString to retrieve win32 system error strings
Aaron Smith [Fri, 19 Oct 2018 18:58:24 +0000 (18:58 +0000)]
[lldb] Add support in Status::AsCString to retrieve win32 system error strings

Reviewers: rnk, zturner, aleksandr.urakov

Subscribers: lldb-commits

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

llvm-svn: 344798

5 years ago[llvm-mca] Remove a stale TODO comment. NFC
Andrea Di Biagio [Fri, 19 Oct 2018 18:39:29 +0000 (18:39 +0000)]
[llvm-mca] Remove a stale TODO comment. NFC

Starting from revision r344334, we can now describe optimizable
register-register moves in the machine scheduling models.

llvm-svn: 344797

5 years ago[ConstantFolding] Constant fold minimum and maximum intrinsics
Thomas Lively [Fri, 19 Oct 2018 18:15:32 +0000 (18:15 +0000)]
[ConstantFolding] Constant fold minimum and maximum intrinsics

Summary: Depends on D52764

Reviewers: aheejin, dschuff

Subscribers: llvm-commits

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

llvm-svn: 344796

5 years ago[Driver] Reland: Default Android toolchains to libc++.
Dan Albert [Fri, 19 Oct 2018 18:06:02 +0000 (18:06 +0000)]
[Driver] Reland: Default Android toolchains to libc++.

The sanitizer builder that was broken by this should now be fixed.

Original review was https://reviews.llvm.org/D53109

llvm-svn: 344795

5 years ago[dwarfdump] Hide ranges in diff-mode.
Jonas Devlieghere [Fri, 19 Oct 2018 17:57:53 +0000 (17:57 +0000)]
[dwarfdump] Hide ranges in diff-mode.

llvm-dwarfdump --diff should not print DW_AT_ranges. This patch fixes
that.

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

llvm-svn: 344794

5 years ago[InstCombine] use m_Neg() in dyn_castNegVal() to match vectors with undef elts
Sanjay Patel [Fri, 19 Oct 2018 17:54:53 +0000 (17:54 +0000)]
[InstCombine] use m_Neg() in dyn_castNegVal() to match vectors with undef elts

llvm-svn: 344793

5 years ago[Hexagon] Remove support for V4
Krzysztof Parzyszek [Fri, 19 Oct 2018 17:31:11 +0000 (17:31 +0000)]
[Hexagon] Remove support for V4

llvm-svn: 344791

5 years ago[InstCombine] move/add tests for sub/neg; NFC
Sanjay Patel [Fri, 19 Oct 2018 17:26:22 +0000 (17:26 +0000)]
[InstCombine] move/add tests for sub/neg; NFC

These should all be handled using "dyn_castNegVal",
but that misses vectors with undef elements.

llvm-svn: 344790

5 years agoJava annotation declaration being handled correctly
Hans Wennborg [Fri, 19 Oct 2018 16:19:52 +0000 (16:19 +0000)]
Java annotation declaration being handled correctly

Previously, Java annotation declarations (@interface AnnotationName) were being
handled as ObjC interfaces. This caused the brace formatting to mess up, so
that when you had a class with an interface defined in it, it would indent the
final brace of the class.

It used to format this class like so:

  class A {
    @interface B {}
    }

But will now just skip the @interface and format it like so:

  class A {
    @interface B {}
  }

Patch by Sam Maier!

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

llvm-svn: 344789

5 years ago[lldbsuite, windows] Disable two tail call frames tests that fail on Windows
Stella Stamenova [Fri, 19 Oct 2018 16:00:58 +0000 (16:00 +0000)]
[lldbsuite, windows] Disable two tail call frames tests that fail on Windows

Summary: These tests fail on Windows because of known limitations (a.k.a. bugs) with the current implementation of GetFrameAtIndex

Reviewers: asmith, vsk

Reviewed By: vsk

Subscribers: abidh, lldb-commits

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

llvm-svn: 344788

5 years ago[clangd] Set workspace root when initializing ClangdServer, disallow mutation.
Sam McCall [Fri, 19 Oct 2018 15:42:23 +0000 (15:42 +0000)]
[clangd] Set workspace root when initializing ClangdServer, disallow mutation.

Summary:
Rename instance variable to WorkspaceRoot to match what we call it internally.

Add fixme to set it automatically. Don't do it yet, clients have assumptions
that the constructor won't access the FS.

Don't second-guess the provided root.

Reviewers: ioeric

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 344787

5 years ago[Hexagon] Remove support for V4
Krzysztof Parzyszek [Fri, 19 Oct 2018 15:36:45 +0000 (15:36 +0000)]
[Hexagon] Remove support for V4

llvm-svn: 344786

5 years ago[clang-tidy] Resolve readability-else-after-return false positive for constexpr if.
Marek Kurdej [Fri, 19 Oct 2018 15:26:17 +0000 (15:26 +0000)]
[clang-tidy] Resolve readability-else-after-return false positive for constexpr if.

Summary:
It fixes the false positive when using constexpr if and where else cannot be removed:

Example:
```
  if constexpr (sizeof(int) > 4)
    // ...
    return /* ... */;
  else // This else cannot be removed.
    // ...
    return /* ... */;
```

Reviewers: alexfh, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: lebedev.ri, xazax.hun, cfe-commits

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

llvm-svn: 344785

5 years ago[ASTImporter] Removed uneeded default case label.
Balazs Keri [Fri, 19 Oct 2018 15:16:51 +0000 (15:16 +0000)]
[ASTImporter] Removed uneeded default case label.

llvm-svn: 344784

5 years ago[ASTImporter] Added error handling for AST import.
Balazs Keri [Fri, 19 Oct 2018 13:32:20 +0000 (13:32 +0000)]
[ASTImporter] Added error handling for AST import.

Summary:
The goal of this change is to make the ASTImporter::Import functions return
llvm::Expected instead of the imported type.
As first part the ASTNodeImporter visit functions are updated to return with
llvm::Expected. Various `import` functions are added to ASTNodeImporter to
simplify the code and have a common place for interface towards ASTImporter
(from ASTNodeImporter). There is some temporary code that is needed before
ASTImporter is updated.

Reviewers: a.sidorin, a_sidorin, xazax.hun

Reviewed By: a_sidorin

Subscribers: dkrupp, Szelethus, rnkovacs, martong, jfb, cfe-commits

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

llvm-svn: 344783

5 years ago[llvm-exegesis] Mark second-form X87 instructions as unsupported.
Clement Courbet [Fri, 19 Oct 2018 12:24:49 +0000 (12:24 +0000)]
[llvm-exegesis] Mark second-form X87 instructions as unsupported.

Summary:
We only support the first form because we rely on information that is
only available there.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 344782

5 years ago[MC][DWARF][AsmParser] Ensure nested CFI frames are diagnosed.
Kristina Brooks [Fri, 19 Oct 2018 12:14:30 +0000 (12:14 +0000)]
[MC][DWARF][AsmParser] Ensure nested CFI frames are diagnosed.

This avoids a crash (with asserts) or bad codegen (without asserts)
in Dwarf streamer later on. This patch fixes this condition in
MCStreamer and propogates SMLoc down when it's available with an
added bonus of source locations for those specific types of errors.

Further patches could use similar improvements as currently most
non-Windows CFI directives lack an SMLoc parameter.

Modified an existing test to verify source location propogation and
added an object-file version of it to verify that it does not crash in
addition to a standalone test to only ensure it does not crash.

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

llvm-svn: 344781

5 years ago[llvm-exegesis] Re-enable liveliness tracker.
Clement Courbet [Fri, 19 Oct 2018 12:08:05 +0000 (12:08 +0000)]
[llvm-exegesis] Re-enable liveliness tracker.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 344780

5 years ago[llvm-exegesis] X87 RFP setup code.
Clement Courbet [Fri, 19 Oct 2018 09:56:54 +0000 (09:56 +0000)]
[llvm-exegesis] X87 RFP setup code.

Summary:
This was lost during refactoring in rL342644.

Fix and simplify simplify value size handling: always go through a 80 bit value,
because the value can be 1 byte). Add unit tests.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 344779

5 years ago[OpenCL] Remove unwanted signedness conversion from tests
Marco Antognini [Fri, 19 Oct 2018 09:01:37 +0000 (09:01 +0000)]
[OpenCL] Remove unwanted signedness conversion from tests

The get_kernel_* functions used in cl20-device-side-enqueue.cl all return
unsigned integers. This patch avoids undesired implicit conversions on the
returned values.

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

llvm-svn: 344778

5 years ago[clangd] Remove the overflow log.
Haojian Wu [Fri, 19 Oct 2018 08:35:24 +0000 (08:35 +0000)]
[clangd] Remove the overflow log.

Summary:
LLVM codebase has generated files (all are build/Target/XXX/*.inc) that
exceed the MaxLine & MaxColumn. Printing these log would be noisy.

Reviewers: sammccall

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 344777

5 years ago[COFF] Fix error handling on duplicates for import library symbols
Martin Storsjo [Fri, 19 Oct 2018 06:39:36 +0000 (06:39 +0000)]
[COFF] Fix error handling on duplicates for import library symbols

Normally one wouldn't run into that case, but it is possible with
a little creative ordering of special libraries.

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

llvm-svn: 344776

5 years ago[pipeliner] Fix test added in rL344748 to require asserts
Fangrui Song [Fri, 19 Oct 2018 06:20:01 +0000 (06:20 +0000)]
[pipeliner] Fix test added in rL344748 to require asserts

llvm-svn: 344775

5 years agoUse llvm::{all,any,none}_of instead std::{all,any,none}_of. NFC
Fangrui Song [Fri, 19 Oct 2018 06:12:02 +0000 (06:12 +0000)]
Use llvm::{all,any,none}_of instead std::{all,any,none}_of. NFC

llvm-svn: 344774

5 years ago[clangd] Fix msan failure after r344735 by initializing bitfields
Krasimir Georgiev [Fri, 19 Oct 2018 06:05:32 +0000 (06:05 +0000)]
[clangd] Fix msan failure after r344735 by initializing bitfields

That revision changed integer members to bitfields; the integers were
default initialized before and the bitfields lost that default
initialization. This started causing msan use-of-uninitialized memory in
clangd tests.

llvm-svn: 344773

5 years ago[clang-tidy] readability-uppercase-literal-suffix: specify target for ms test too
Roman Lebedev [Fri, 19 Oct 2018 06:04:07 +0000 (06:04 +0000)]
[clang-tidy] readability-uppercase-literal-suffix: specify target for ms test too

Apparently the bots were still failing with this.
Sadly, i did not see *this* failure when i last looked.

llvm-svn: 344772

5 years agoRevert commit r344670 as the test fails on a bot http://lab.llvm.org:8011/builders...
Douglas Yung [Fri, 19 Oct 2018 04:09:32 +0000 (04:09 +0000)]
Revert commit r344670 as the test fails on a bot lab.llvm.org:8011/builders/clang-cmake-armv7-full/builds/2683/.

llvm-svn: 344771

5 years ago[CodeGen] Fix for PR39094.
Hsiangkai Wang [Fri, 19 Oct 2018 01:52:54 +0000 (01:52 +0000)]
[CodeGen] Fix for PR39094.

When using MachineInstr to get SlotIndex, the MI could not be a debug
instruction. mi2iMap does not contain debug instructions in it.

After enabling DBG_LABEL in the generated code, the first instruction in
the bundle may be a debug instruction. In this patch, I use the first
non-debug instruction in the bundle to query SlotIndex in mi2iMap.

Bugzilla report: https://bugs.llvm.org/show_bug.cgi?id=39094

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

llvm-svn: 344770

5 years ago[TI removal] Remove `TerminatorInst` from the IR type system!
Chandler Carruth [Fri, 19 Oct 2018 00:22:37 +0000 (00:22 +0000)]
[TI removal] Remove `TerminatorInst` from the IR type system!

llvm-svn: 344769

5 years ago[TI removal] Switch some newly added code over to use `Instruction`
Chandler Carruth [Fri, 19 Oct 2018 00:22:10 +0000 (00:22 +0000)]
[TI removal] Switch some newly added code over to use `Instruction`
directly.

llvm-svn: 344768

5 years ago[COFF, ARM64] Enable unit test arm64-microsoft-status-reg.cpp only for aarch64 target
Mandeep Singh Grang [Fri, 19 Oct 2018 00:05:26 +0000 (00:05 +0000)]
[COFF, ARM64] Enable unit test arm64-microsoft-status-reg.cpp only for aarch64 target

This should unbreak bots broken here:
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/14391
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/38288

llvm-svn: 344767

5 years agoUpdate the project name in README.md
Greg Bedwell [Fri, 19 Oct 2018 00:03:01 +0000 (00:03 +0000)]
Update the project name in README.md

Per llvm.org: "The name "LLVM" itself is not an acronym; it is the full
name of the project."

llvm-svn: 344766

5 years ago[COFF, ARM64] Add _ReadStatusReg and_WriteStatusReg intrinsics
Mandeep Singh Grang [Thu, 18 Oct 2018 23:35:35 +0000 (23:35 +0000)]
[COFF, ARM64] Add _ReadStatusReg and_WriteStatusReg intrinsics

Reviewers: rnk, compnerd, mstorsjo, efriedma, TomTan, haripul, javed.absar

Reviewed By: efriedma

Subscribers: dmajor, kristof.beyls, chrib, cfe-commits

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

llvm-svn: 344765

5 years ago[TI removal] Update the C API for the move away from `TerminatorInst`.
Chandler Carruth [Thu, 18 Oct 2018 23:03:55 +0000 (23:03 +0000)]
[TI removal] Update the C API for the move away from `TerminatorInst`.

This updates the C API for the removal of `TerminatorInst`. It converts
the type query to a predicate query and moves the generic methods to
work on `Instruction` instances that satisfy this predicate rather than
requiring a specific type. It also clarifies that the C API wrapping
`BasicBlock::getTerminator` just returns an `Instruction`. Because this
was always wrapped opaquely as a value and the functions consuming these
values will work on `Instruction` objects, this shouldn't break any
clients.

This is a completely compatible change to the C API.

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

llvm-svn: 344764

5 years ago[ORC] Add a createJITDylib method to LLJIT.
Lang Hames [Thu, 18 Oct 2018 22:42:32 +0000 (22:42 +0000)]
[ORC] Add a createJITDylib method to LLJIT.

Because I'm about to get on stage at the dev meeting and claim that it exists.

This method creates a JITDylib instance with the given name and returns a
reference to it.

llvm-svn: 344763

5 years ago[Test] Fix test file for C++98 mode
David Bolvansky [Thu, 18 Oct 2018 21:26:01 +0000 (21:26 +0000)]
[Test] Fix test file for C++98 mode

llvm-svn: 344762

5 years ago[Diagnostics] Add missing expected warning to test file
David Bolvansky [Thu, 18 Oct 2018 21:06:14 +0000 (21:06 +0000)]
[Diagnostics] Add missing expected warning to test file

llvm-svn: 344761

5 years ago[clang-tidy] readability-uppercase-literal-suffix: specify target for opencl test
Roman Lebedev [Thu, 18 Oct 2018 20:59:03 +0000 (20:59 +0000)]
[clang-tidy] readability-uppercase-literal-suffix: specify target for opencl test

I'm not sure if it will actually help or not.
ppc64be-clang-lnt-test bot is failing.

llvm-svn: 344760

5 years ago[Diagnostics] Check for integer overflow in array size expressions
David Bolvansky [Thu, 18 Oct 2018 20:49:06 +0000 (20:49 +0000)]
[Diagnostics] Check for integer overflow in array size expressions

Summary: Fixes PR27439

Reviewers: rsmith, Rakete1111

Reviewed By: rsmith

Subscribers: Rakete1111, cfe-commits

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

llvm-svn: 344759

5 years ago[clang-tidy] readability-uppercase-literal-suffix: specify target for fp tests
Roman Lebedev [Thu, 18 Oct 2018 20:27:10 +0000 (20:27 +0000)]
[clang-tidy] readability-uppercase-literal-suffix: specify target for fp tests

__float128 isn't universally avaliable.

llvm-svn: 344758

5 years ago[clang-tidy] Non-private member variables in classes (MISRA, CppCoreGuidelines, HICPP)
Roman Lebedev [Thu, 18 Oct 2018 20:16:44 +0000 (20:16 +0000)]
[clang-tidy] Non-private member variables in classes (MISRA, CppCoreGuidelines, HICPP)

Summary:
Finds classes that not only contain the data (non-static member variables),
but also have logic (non-static member functions), and diagnoses all member
variables that have any other scope other than `private`. They should be
made `private`, and manipulated exclusively via the member functions.

Optionally, classes with all member variables being `public` could be
ignored, and optionally all `public` member variables could be ignored.

Options
-------

* IgnoreClassesWithAllMemberVariablesBeingPublic

  Allows to completely ignore classes if **all** the member variables in that
  class have `public` visibility.

* IgnorePublicMemberVariables

  Allows to ignore (not diagnose) **all** the member variables with `public`
  visibility scope.

References:
* MISRA 11-0-1 Member data in non-POD class types shall be private.
* https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c2-use-class-if-the-class-has-an-invariant-use-struct-if-the-data-members-can-vary-independently
* https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rc-private
* https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-protected

Reviewers: JonasToth, aaron.ballman, alexfh, hokein, xazax.hun

Reviewed By: aaron.ballman

Subscribers: Eugene.Zelenko, zinovy.nis, cfe-commits, rnkovacs, nemanjai, mgorny, xazax.hun, kbarton

Tags: #clang-tools-extra

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

llvm-svn: 344757

5 years agoSupport of hurd in llvm-shlib
Sylvestre Ledru [Thu, 18 Oct 2018 20:07:44 +0000 (20:07 +0000)]
Support of hurd in llvm-shlib

Svante Signell

llvm-svn: 344756

5 years ago[clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C,...
Roman Lebedev [Thu, 18 Oct 2018 20:06:40 +0000 (20:06 +0000)]
[clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4)

Summary:
Detects when the integral literal or floating point (decimal or hexadecimal)
literal has non-uppercase suffix, and suggests to make the suffix uppercase,
with fix-it.

All valid combinations of suffixes are supported.

```
  auto x = 1;  // OK, no suffix.

  auto x = 1u; // warning: integer literal suffix 'u' is not upper-case

  auto x = 1U; // OK, suffix is uppercase.

  ...
```

References:
* [[ https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152241 | CERT DCL16-C ]]
* MISRA C:2012, 7.3 - The lowercase character "l" shall not be used in a literal suffix
* MISRA C++:2008, 2-13-4 - Literal suffixes shall be upper case

Reviewers: JonasToth, aaron.ballman, alexfh, hokein, xazax.hun

Reviewed By: aaron.ballman

Subscribers: Eugene.Zelenko, mgorny, rnkovacs, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 344755

5 years agoMake Function::getInstructionCount const
Mircea Trofin [Thu, 18 Oct 2018 19:49:44 +0000 (19:49 +0000)]
Make Function::getInstructionCount const

Summary: Function::getInstructionCount can be const.

Reviewers: davidxl, paquette

Reviewed By: davidxl

Subscribers: llvm-commits

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

llvm-svn: 344754

5 years agoRevert r344693 ("[ARM] bottom-top mul support in ARMParallelDSP")
Eli Friedman [Thu, 18 Oct 2018 19:34:30 +0000 (19:34 +0000)]
Revert r344693 ("[ARM] bottom-top mul support in ARMParallelDSP")

Still causing failures on the polly-aosp buildbot; I'll follow up
with a reduced testcase.

llvm-svn: 344752

5 years ago[compiler-rt] Don't explicitly set CMAKE_CXX_FLAGS.
Dan Albert [Thu, 18 Oct 2018 18:04:28 +0000 (18:04 +0000)]
[compiler-rt] Don't explicitly set CMAKE_CXX_FLAGS.

Summary:
C++ flags should not be used for not-C++ files as it may trigger
-Werror=unused-command-line-argument. CMake will use CMAKE_C_FLAGS,
CMAKE_CXX_FLAGS, and CMAKE_ASM_FLAGS as appropriate implicitly, so
this does not need to be explicitly handled here.

This change depends on https://reviews.llvm.org/D53301, since one of
the builders depended on this behavior because it was not configuring
CMAKE_ASM_FLAGS.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis, vitalybuka

Subscribers: dberris, mgorny, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 344751

5 years agoAdd check-clang-python to the Clang tests directory in IDEs; NFC.
Aaron Ballman [Thu, 18 Oct 2018 17:47:18 +0000 (17:47 +0000)]
Add check-clang-python to the Clang tests directory in IDEs; NFC.

llvm-svn: 344750

5 years agoAdd language standard aliases for -std=c18, -std=gnu18, and -std=iso9899:2018.
Aaron Ballman [Thu, 18 Oct 2018 17:42:41 +0000 (17:42 +0000)]
Add language standard aliases for -std=c18, -std=gnu18, and -std=iso9899:2018.

As described in D40225, the C17 standard was balloted and approved in 2017, but the ISO publication process delayed the actual publication until 2018. WG14 considers the release to be C17 and describes it as such, but users can still be confused by the publication year which is why -std=c18 adds value. These aliases map to c17 and are all supported by GCC 8.x with the same behavior. Note that the value of __STDC_VERSION__ remains at 201710L.

llvm-svn: 344749

5 years ago[Pipeliner] copyToPhi DAG Mutation to improve scheduling.
Sumanth Gundapaneni [Thu, 18 Oct 2018 15:51:16 +0000 (15:51 +0000)]
[Pipeliner] copyToPhi DAG Mutation to improve scheduling.

In a loop, create artificial dependences between the source of a
COPY/REG_SEQUENCE to the use in next iteration.

Eg:
SRC ----Data Dep--> COPY
COPY ---Anti Dep--> PHI (implies, to be used in next iteration)
PHI ----Data Dep--> USE

This patches creates
USE ----Artificial Dep---> SRC

This will effectively schedule the COPY late to eliminate additional copies.
Before this patch, the schedule can be
SRC, COPY, USE : The COPY is used in next iteration and it needs to be
preserved.

After this patch, the schedule can be
USE, SRC, COPY : The COPY is used in next iteration and the live interval is
reduced.

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

llvm-svn: 344748