platform/upstream/llvm.git
5 years ago[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors
Simon Pilgrim [Wed, 5 Dec 2018 19:32:19 +0000 (19:32 +0000)]
[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors

llvm-svn: 348403

5 years agoRevert "[RISCV] Mark unit tests as "requires: riscv-registered-target""
Mandeep Singh Grang [Wed, 5 Dec 2018 19:19:38 +0000 (19:19 +0000)]
Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target""

This reverts commit 8908dd12e7bbfc74e264233e900206ad31e285f0.

llvm-svn: 348402

5 years agoDo not use a hash table to uniquify mergeable strings.
Rui Ueyama [Wed, 5 Dec 2018 19:13:31 +0000 (19:13 +0000)]
Do not use a hash table to uniquify mergeable strings.

Previously, we have a hash table containing strings and their offsets
to manage mergeable strings. Technically we can live without that, because
we can do binary search on a vector of mergeable strings to find a mergeable
strings.

We did have both the hash table and the binary search because we thought
that that is faster.

We recently observed that lld tend to consume more memory than gold when
building an output with debug info. A few percent of memory is consumed by
the hash table. So, we needed to reevaluate whether or not having the extra
hash table is a good CPU/memory tradeoff. I run a few benchmarks with and
without the hash table.

I got a mixed result for the benchmark. We observed a regression for some
programs by removing the hash table (that's what we expected), but we also
observed that performance imrpovements for some programs. This is perhaps
due to reduced memory usage.

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

llvm-svn: 348401

5 years agoDo not check for parameters shadowing fields in function declarations.
Aaron Ballman [Wed, 5 Dec 2018 18:56:57 +0000 (18:56 +0000)]
Do not check for parameters shadowing fields in function declarations.

We would issue a false-positive diagnostic for parameters in function declarations shadowing fields; we now only issue the diagnostic on a function definition instead.

llvm-svn: 348400

5 years agoAdding tests for -ast-dump; NFC.
Aaron Ballman [Wed, 5 Dec 2018 18:53:57 +0000 (18:53 +0000)]
Adding tests for -ast-dump; NFC.

This adds tests for various function and class template declarations.

llvm-svn: 348399

5 years ago[AArch64] Reword description of feature (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:42:57 +0000 (18:42 +0000)]
[AArch64] Reword description of feature (NFC)

Reword the description of the feature that enables custom handling of cheap
instructions.

llvm-svn: 348398

5 years agoHonor -fdebug-prefix-map when creating function names for the debug info.
Adrian Prantl [Wed, 5 Dec 2018 18:37:44 +0000 (18:37 +0000)]
Honor -fdebug-prefix-map when creating function names for the debug info.

This adds a callback to PrintingPolicy to allow CGDebugInfo to remap
file paths according to -fdebug-prefix-map. Otherwise the debug info
(particularly function names for C++ lambdas) may contain paths that
should have been remapped in the debug info.

<rdar://problem/46128056>

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

llvm-svn: 348397

5 years ago[analyzer] Attribute for RetainCountChecker for OSObject should propagate with inheri...
George Karpenkov [Wed, 5 Dec 2018 18:34:54 +0000 (18:34 +0000)]
[analyzer] Attribute for RetainCountChecker for OSObject should propagate with inheritance

rdar://46388388

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

llvm-svn: 348396

5 years ago[llvm-mca] Simplify test (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:34:51 +0000 (18:34 +0000)]
[llvm-mca] Simplify test (NFC)

llvm-svn: 348395

5 years agoMention changes to libc++ include dir lookup in release notes.
Ilya Biryukov [Wed, 5 Dec 2018 18:32:05 +0000 (18:32 +0000)]
Mention changes to libc++ include dir lookup in release notes.

Summary: The change itself landed as r348365, see the comment for more details.

Reviewers: arphaman, EricWF

Reviewed By: arphaman

Subscribers: cfe-commits

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

llvm-svn: 348394

5 years ago[llvm-mca] Sort test run lines (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:30:06 +0000 (18:30 +0000)]
[llvm-mca] Sort test run lines (NFC)

llvm-svn: 348393

5 years ago[MachineOutliner][NFC] Use getOccurrenceCount() in getNotOutlinedCost()
Jessica Paquette [Wed, 5 Dec 2018 18:17:40 +0000 (18:17 +0000)]
[MachineOutliner][NFC] Use getOccurrenceCount() in getNotOutlinedCost()

Some more gardening.

llvm-svn: 348392

5 years ago[MachineOutliner][NFC] Make getters in MachineOutliner.h const
Jessica Paquette [Wed, 5 Dec 2018 18:12:52 +0000 (18:12 +0000)]
[MachineOutliner][NFC] Make getters in MachineOutliner.h const

Just some refactoring. A few of the getters in OutlinedFunction weren't const.

llvm-svn: 348391

5 years ago[MachineOutliner][NFC] Don't create outlined sequence from integer mapping
Jessica Paquette [Wed, 5 Dec 2018 17:57:33 +0000 (17:57 +0000)]
[MachineOutliner][NFC] Don't create outlined sequence from integer mapping

Some gardening/refactoring.

It's cleaner to copy the instructions into the MachineFunction using the first
candidate instead of going to the mapper.

Also, by doing this we can remove the Seq member from OutlinedFunction entirely.

llvm-svn: 348390

5 years ago[gold-plugin] allow function/data sections to be toggleable
Nick Desaulniers [Wed, 5 Dec 2018 17:46:24 +0000 (17:46 +0000)]
[gold-plugin] allow function/data sections to be toggleable

Summary:
r336838 allowed these to be toggleable.
r336858 reverted r336838.
r336943 made the generation of these sections conditional on LDPO_REL.

This commit brings back the toggle-ability.  You can specify:
-plugin-opt=-function-sections
-plugin-opt=-data-sections
For your linker flags to disable the changes made in r336943.

Without toggling r336943 off, arm64 linux kernels linked with gold-plugin
see significant boot time regressions, but with r336943 outright reverted
x86_64 linux kernels linked with gold-plugin fail to boot.

Reviewers: pcc, void

Reviewed By: pcc

Subscribers: javed.absar, kristof.beyls, llvm-commits, srhines

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

llvm-svn: 348389

5 years agoAddress a post-commit review comment on r348325.
Erik Pilkington [Wed, 5 Dec 2018 17:43:26 +0000 (17:43 +0000)]
Address a post-commit review comment on r348325.

llvm-svn: 348388

5 years ago[CodeComplete] Fix a crash in access checks of inner classes
Ilya Biryukov [Wed, 5 Dec 2018 17:38:39 +0000 (17:38 +0000)]
[CodeComplete] Fix a crash in access checks of inner classes

Summary: The crash was introduced in r348135.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: cfe-commits

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

llvm-svn: 348387

5 years ago[PDB] Make PDB lit tests use the new builder
Aleksandr Urakov [Wed, 5 Dec 2018 17:35:30 +0000 (17:35 +0000)]
[PDB] Make PDB lit tests use the new builder

Reviewers: zturner, stella.stamenova

Reviewed By: zturner

Tags: #lldb

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

llvm-svn: 348386

5 years agoAMDGPU: Fix using old address spaces in some tests
Matt Arsenault [Wed, 5 Dec 2018 17:34:59 +0000 (17:34 +0000)]
AMDGPU: Fix using old address spaces in some tests

llvm-svn: 348385

5 years ago[Basic] Cleanups in IdentifierInfo following the removal of PTH
Bruno Ricci [Wed, 5 Dec 2018 17:16:55 +0000 (17:16 +0000)]
[Basic] Cleanups in IdentifierInfo following the removal of PTH

The Entry pointer in IdentifierInfo was only null for IdentifierInfo
created from a PTH. Now that PTH support has been removed we can remove
some PTH specific code in IdentifierInfo::getLength and
IdentifierInfo::getNameStart.

Also make the constructor of IdentifierInfo private to make sure that
they are only created by IdentifierTable, and move it to the header so
that it can be inlined in IdentifierTable::get and IdentifierTable::getOwn.

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

Reviewed By: erichkeane

llvm-svn: 348384

5 years ago[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)
Sanjay Patel [Wed, 5 Dec 2018 17:10:30 +0000 (17:10 +0000)]
[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)

Because we're potentially peeking through a bitcast in this transform,
we need to use overall bitwidths rather than number of elements to
determine when it's safe to proceed.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=39893

llvm-svn: 348383

5 years ago[OpenCL] Diagnose conflicting address spaces in templates.
Anastasia Stulova [Wed, 5 Dec 2018 17:02:22 +0000 (17:02 +0000)]
[OpenCL] Diagnose conflicting address spaces in templates.

Added new diagnostic when templates are instantiated with
different address space from the one provided in its definition.

This also prevents deducing generic address space in pointer
type of templates to allow giving them concrete address space
during instantiation.

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

llvm-svn: 348382

5 years agoAllow norecurse attribute on functions that have debug infos.
Christian Bruel [Wed, 5 Dec 2018 16:48:00 +0000 (16:48 +0000)]
Allow norecurse attribute on functions that have debug infos.

Summary: debug intrinsics might be marked norecurse to enable the caller function to be norecurse and optimized if needed. This avoids code gen optimisation differences when -g is used, as in globalOpt.cpp:processInternalGlobal checks.

Reviewers: chandlerc, jmolloy, aprantl

Reviewed By: aprantl

Subscribers: aprantl, llvm-commits

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

llvm-svn: 348381

5 years ago[X86] Add test case to show missed opportunity to combine a concat_vector into a...
Andrea Di Biagio [Wed, 5 Dec 2018 16:23:27 +0000 (16:23 +0000)]
[X86] Add test case to show missed opportunity to combine a concat_vector into a scalar_to_vector. NFC

This is a test for D55274.

llvm-svn: 348380

5 years ago[NFC] Use clang-format on PrintingPolicy::PrintingPolicy() after fd5c386f743
Jan Korous [Wed, 5 Dec 2018 16:19:49 +0000 (16:19 +0000)]
[NFC] Use clang-format on PrintingPolicy::PrintingPolicy() after fd5c386f743

The white-space change was causing conflicts downstream.

rdar://problem/46486841

llvm-svn: 348379

5 years agoRemove XFAIL in get_module_and_offset_for_pc.cc for NetBSD-MSan
Kamil Rytarowski [Wed, 5 Dec 2018 16:05:25 +0000 (16:05 +0000)]
Remove XFAIL in get_module_and_offset_for_pc.cc for NetBSD-MSan

After updating GET_LINK_MAP_BY_DLOPEN_HANDLE() for recent NetBSD
this test no longer fails.

llvm-svn: 348378

5 years ago[Sanitizer] nl_langinfo forgotten bit.
David Carlier [Wed, 5 Dec 2018 16:02:26 +0000 (16:02 +0000)]
[Sanitizer] nl_langinfo forgotten bit.

M    lib/sanitizer_common/sanitizer_platform_interceptors.h

llvm-svn: 348377

5 years ago[Sanitizer] expand nl_langinfo interception to FreeBSD
David Carlier [Wed, 5 Dec 2018 16:01:22 +0000 (16:01 +0000)]
[Sanitizer] expand nl_langinfo interception to FreeBSD

Reviewers: krytarowski

Reviewed By: krytarowski

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

llvm-svn: 348376

5 years agoRevert "[IR] Add NODISCARD to attribute functions"
Brian Gesiak [Wed, 5 Dec 2018 15:56:09 +0000 (15:56 +0000)]
Revert "[IR] Add NODISCARD to attribute functions"

Revert https://reviews.llvm.org/D55217 due to warnings-turned-into-errors in
AMGPU targets. I'll fix the warnings first, then re-commit this patch.

llvm-svn: 348375

5 years ago[SLH] Fix a nasty bug in SLH.
Chandler Carruth [Wed, 5 Dec 2018 15:42:11 +0000 (15:42 +0000)]
[SLH] Fix a nasty bug in SLH.

Whenever we effectively take the address of a basic block we need to
manually update that basic block to reflect that fact or later passes
such as tail duplication and tail merging can break the invariants of
the code. =/ Sadly, there doesn't appear to be any good way of
automating this or even writing a reasonable assert to catch it early.

The change seems trivially and obviously correct, but sadly the only
really good test case I have is 1000s of basic blocks. I've tried
directly writing a test case that happens to make tail duplication do
something that crashes later on, but this appears to require an
*amazingly* complex set of conditions that I've not yet reproduced.

The change is technically covered by the tests because we mark the
blocks as having their address taken, but that doesn't really count as
properly testing the functionality.

llvm-svn: 348374

5 years ago[SLH] Regenerate tests with --no_x86_scrub_rip to restore the higher
Chandler Carruth [Wed, 5 Dec 2018 15:41:13 +0000 (15:41 +0000)]
[SLH] Regenerate tests with --no_x86_scrub_rip to restore the higher
fidelity checking of RIP-based references to basic blocks and other
labels.

These labels are super important for SLH tests so we should keep them
readable in the test cases.

llvm-svn: 348373

5 years ago[IR] Add NODISCARD to attribute functions
Brian Gesiak [Wed, 5 Dec 2018 15:33:55 +0000 (15:33 +0000)]
[IR] Add NODISCARD to attribute functions

Summary:
Many functions on `llvm::AttributeList` and `llvm::AttributeSet` are
documented with "returns a new {list,set} because attribute
{lists,sets} are immutable." This documentation can be aided by the
addition of an attribute, `LLVM_NODISCARD`. Adding this prevents
unsuspecting users of the API from expecting
`AttributeList::setAttributes` from modifying the underlying list.

At the very least, it would have saved me a few hours of debugging, since I
had been doing just that! I had a bug in my program where I was calling
`setAttributes` but then passing in the unmutated `AttributeList`.
I tried adding LLVM_NODISCARD and confirmed that it would have made my bug
immediately obvious.

Reviewers: rnk, javed.absar

Reviewed By: rnk

Subscribers: llvm-commits

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

llvm-svn: 348372

5 years ago[AMDGPU]: Turn on the DPP combiner by default
Valery Pykhtin [Wed, 5 Dec 2018 15:21:17 +0000 (15:21 +0000)]
[AMDGPU]: Turn on the DPP combiner by default

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

llvm-svn: 348371

5 years agoAdd a new interceptor for modctl(2) from NetBSD
Kamil Rytarowski [Wed, 5 Dec 2018 15:13:20 +0000 (15:13 +0000)]
Add a new interceptor for modctl(2) from NetBSD

Summary:
modctl - controls loadable kernel modules.

Skip tests as this call uses privileged operations.

Reviewers: vitalybuka, joerg

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 348370

5 years agoAdd a new interceptor for nl_langinfo(3) from NetBSD
Kamil Rytarowski [Wed, 5 Dec 2018 15:06:53 +0000 (15:06 +0000)]
Add a new interceptor for nl_langinfo(3) from NetBSD

Summary:
nl_langinfo - gets locale information.

Add a dedicated test.

Reviewers: vitalybuka, joerg

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 348369

5 years ago[Haiku] Support __float128 for x86 and x86_64
Kristina Brooks [Wed, 5 Dec 2018 15:05:06 +0000 (15:05 +0000)]
[Haiku] Support __float128 for x86 and x86_64

This patch addresses a compilation error with clang when
running in Haiku being unable to compile code using
float128 (throws compilation error such as 'float128 is
not supported on this target').

Patch by kallisti5 (Alexander von Gluck IV)

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

llvm-svn: 348368

5 years ago[InstCombine] simplify icmps with same operands based on dominating cmp
Sanjay Patel [Wed, 5 Dec 2018 15:04:00 +0000 (15:04 +0000)]
[InstCombine] simplify icmps with same operands based on dominating cmp

The tests here are based on the motivating cases from D54827.

More background:
1. We don't get these cases in general with SimplifyCFG because the root
   of the pattern match is an icmp, not a branch. I'm not sure how often
   we encounter this pattern vs. the seemingly more likely case with
   branches, but I don't see evidence to leave the minimal pattern
   unoptimized.

2. This has a chance of increasing compile-time because we're using a
   ValueTracking call to handle the match. The motivating cases could be
   handled with a simpler pair of calls to isImpliedTrueByMatchingCmp/
   isImpliedFalseByMatchingCmp, but I saw that we have a more
   comprehensive wrapper around those, so we might as well use it here
   unless there's evidence that it's significantly slower.

3. Ideally, we'd handle the fold to constants in InstSimplify, but as
   with the existing code here, we could extend this to handle cases
   where the result is not a constant, but a new combined predicate.
   That would mean splitting the logic across the 2 passes and possibly
   duplicating the pattern-matching cost.

4. As mentioned in D54827, this seems like the kind of thing that should
   be handled in Correlated Value Propagation, but that pass is currently
   limited to dealing with instructions with constant operands, so extending
   this bit of InstCombine is the smallest/easiest way to get these patterns
   optimized.

llvm-svn: 348367

5 years ago[X86][SSE] Begun adding modulo rotate support to LowerRotate
Simon Pilgrim [Wed, 5 Dec 2018 14:46:37 +0000 (14:46 +0000)]
[X86][SSE] Begun adding modulo rotate support to LowerRotate

Prep work for PR38243 - mainly adding comments on where we need to add modulo support (doing so at the moment causes massive codegen regressions).

I've also consistently added support for modulo folding for uniform constants (although at the moment we have no way to trigger this) and removed the old assertions.

llvm-svn: 348366

5 years agoMove detection of libc++ include dirs to Driver on MacOS
Ilya Biryukov [Wed, 5 Dec 2018 14:24:14 +0000 (14:24 +0000)]
Move detection of libc++ include dirs to Driver on MacOS

Summary:
The intention is to make the tools replaying compilations from 'compile_commands.json'
(clang-tidy, clangd, etc.) find the same standard library as the original compiler
specified in 'compile_commands.json'.

Previously, the library detection logic was in the frontend (InitHeaderSearch.cpp) and relied
on the value of resource dir as an approximation of the compiler install dir. The new logic
uses the actual compiler install dir and is performed in the driver. This is consistent with
the C++ standard library detection on other platforms and allows to override the resource dir
in the tools using the compile_commands.json without altering the
standard library detection mechanism. The tools have to override the resource dir to make sure
they use a consistent version of the builtin headers.

There is still logic in InitHeaderSearch that attemps to add the absolute includes for the
the C++ standard library, so we keep passing the -stdlib=libc++ from the driver to the frontend
via cc1 args to avoid breaking that. In the long run, we should move this logic to the driver too,
but it could potentially break the library detection on other systems, so we don't tackle it in this
patch to keep its scope manageable.

This is a second attempt to fix the issue, first one was commited in r346652 and reverted in r346675.
The original fix relied on an ad-hoc propagation (bypassing the cc1 flags) of the install dir from the
driver to the frontend's HeaderSearchOptions. Unsurpisingly, the propagation was incomplete, it broke
the libc++ detection in clang itself, which caused LLDB tests to break.

The LLDB tests pass with new fix.

Reviewers: JDevlieghere, arphaman, EricWF

Reviewed By: arphaman

Subscribers: mclow.lists, ldionne, dexonsmith, ioeric, christof, kadircet, cfe-commits

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

llvm-svn: 348365

5 years agoRevert: Honor -fdebug-prefix-map when creating function names for the debug info.
Renato Golin [Wed, 5 Dec 2018 13:56:26 +0000 (13:56 +0000)]
Revert: Honor -fdebug-prefix-map when creating function names for the debug info.

This commit reverts r348060 and r348062 due to it breaking the AArch64 Full
buildbot: https://bugs.llvm.org/show_bug.cgi?id=39892

llvm-svn: 348364

5 years ago[llvm-rc] Support not expressions.
Martin Storsjo [Wed, 5 Dec 2018 13:22:56 +0000 (13:22 +0000)]
[llvm-rc] Support not expressions.

Patch by Jacek Caban!

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

llvm-svn: 348363

5 years ago[TargetLowering] Remove ISD::ANY_EXTEND/ANY_EXTEND_VECTOR_INREG opcodes from Simplify...
Simon Pilgrim [Wed, 5 Dec 2018 12:20:05 +0000 (12:20 +0000)]
[TargetLowering] Remove ISD::ANY_EXTEND/ANY_EXTEND_VECTOR_INREG opcodes from SimplifyDemandedVectorElts

These have no test coverage and the KnownZero flags can't be guaranteed unlike SIGN/ZERO_EXTEND cases.

llvm-svn: 348361

5 years ago[CMake] Fix side-effect from LLDB_VERSION change in r346668 for framework-enabled...
Stefan Granitz [Wed, 5 Dec 2018 12:18:44 +0000 (12:18 +0000)]
[CMake] Fix side-effect from LLDB_VERSION change in r346668 for framework-enabled builds

llvm-svn: 348360

5 years ago[clangd] Dont provide locations for non-existent files.
Kadir Cetinkaya [Wed, 5 Dec 2018 11:57:15 +0000 (11:57 +0000)]
[clangd] Dont provide locations for non-existent files.

Summary:
We were getting assertion errors when we had bad file names, instead we
should skip those.

Reviewers: hokein

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

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

llvm-svn: 348359

5 years ago[DAG] Add fshl/fshr tblgen opcodes
Simon Pilgrim [Wed, 5 Dec 2018 11:55:33 +0000 (11:55 +0000)]
[DAG] Add fshl/fshr tblgen opcodes

Missed off from https://reviews.llvm.org/D54698

llvm-svn: 348358

5 years agoFix compilation error when using clang 3.6.0
Mikael Holmen [Wed, 5 Dec 2018 11:29:27 +0000 (11:29 +0000)]
Fix compilation error when using clang 3.6.0

llvm-svn: 348357

5 years ago[test] Disable Modules/prune.m on NetBSD as it requires 'touch -a'
Michal Gorny [Wed, 5 Dec 2018 11:17:50 +0000 (11:17 +0000)]
[test] Disable Modules/prune.m on NetBSD as it requires 'touch -a'

llvm-svn: 348356

5 years ago[test] Skip ThinLTO cache tests requiring atime setting on NetBSD
Michal Gorny [Wed, 5 Dec 2018 11:15:50 +0000 (11:15 +0000)]
[test] Skip ThinLTO cache tests requiring atime setting on NetBSD

Skip the ThinLTO cache tests on NetBSD.  They require 'touch' being
able to alter atime of files, while NetBSD inhibits atime updates
when filesystem is mounted noatime.

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

llvm-svn: 348355

5 years ago[test] Split strip-preserve-time.test, and skip atime test on NetBSD
Michal Gorny [Wed, 5 Dec 2018 11:15:46 +0000 (11:15 +0000)]
[test] Split strip-preserve-time.test, and skip atime test on NetBSD

Split timestamp preservation tests into atime and mtime test, and skip
the former on NetBSD.  When the filesystem is mounted noatime, NetBSD
not only inhibits implicit atime updates but also prevents setting atime
via utime(), causing the test to fail.

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

llvm-svn: 348354

5 years ago[SelectionDAG] Initial support for FSHL/FSHR funnel shift opcodes (PR39467)
Simon Pilgrim [Wed, 5 Dec 2018 11:12:12 +0000 (11:12 +0000)]
[SelectionDAG] Initial support for FSHL/FSHR funnel shift opcodes (PR39467)

This is an initial patch to add a minimum level of support for funnel shifts to the SelectionDAG and to begin wiring it up to the X86 SHLD/SHRD instructions.

Some partial legalization code has been added to handle the case for 'SlowSHLD' where we want to expand instead and I've added a few DAG combines so we don't get regressions from the existing DAG builder expansion code.

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

llvm-svn: 348353

5 years ago[clang] - Simplify tools::SplitDebugName.
George Rimar [Wed, 5 Dec 2018 11:09:10 +0000 (11:09 +0000)]
[clang] - Simplify tools::SplitDebugName.

This is an updated version of the D54576, which was reverted.

Problem was that SplitDebugName calls the InputInfo::getFilename
which asserts if InputInfo given is not of type Filename:

const char *getFilename() const {
  assert(isFilename() && "Invalid accessor.");
  return Data.Filename;
}
At the same time at that point, it can be of type Nothing and
we need to use getBaseInput(), like original code did.

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

llvm-svn: 348352

5 years ago[MC] - Fix build bot.
George Rimar [Wed, 5 Dec 2018 11:06:29 +0000 (11:06 +0000)]
[MC] - Fix build bot.

Error was:
/home/buildslave/slave_as-bldslv8/lld-perf-testsuite/llvm/lib/MC/MCFragment.cpp:241:22: error: field 'Offset' will be initialized after field 'LayoutOrder' [-Werror,-Wreorder]
      Atom(nullptr), Offset(~UINT64_C(0)), LayoutOrder(0) {

http://lab.llvm.org:8011/builders/lld-perf-testsuite/builds/9628/steps/build-bin%2Flld/logs/stdio

llvm-svn: 348351

5 years agoRemove superfluous comments. NFCI.
Simon Pilgrim [Wed, 5 Dec 2018 10:45:44 +0000 (10:45 +0000)]
Remove superfluous comments. NFCI.

As requested in D54698.

llvm-svn: 348350

5 years agoRecommit r348243 - "[llvm-mc] - Do not crash when referencing undefined debug sections."
George Rimar [Wed, 5 Dec 2018 10:43:58 +0000 (10:43 +0000)]
Recommit r348243 - "[llvm-mc] - Do not crash when referencing undefined debug sections."

The patch triggered an unrelated msan issue: LayoutOrder variable was not initialized.
(http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/26794/steps/check-llvm%20msan/logs/stdio)
It was fixed.

Original commit message:
MC has code that pre-creates few debug sections:
https://github.com/llvm-mirror/llvm/blob/master/lib/MC/MCObjectFileInfo.cpp#L396

If users code has a reference to such section but does not redefine it,
MC code currently asserts, because still thinks they are normally defined.

The patch fixes the issue.

Differential revision: https://reviews.llvm.org/D55173
----
Modified : /llvm/trunk/lib/MC/ELFObjectWriter.cpp
Added : /llvm/trunk/test/MC/ELF/undefined-debug.s

llvm-svn: 348349

5 years ago[TargetLowering] SimplifyDemandedVectorElts - don't alter DemandedElts mask
Simon Pilgrim [Wed, 5 Dec 2018 10:37:45 +0000 (10:37 +0000)]
[TargetLowering] SimplifyDemandedVectorElts - don't alter DemandedElts mask

Fix potential issue with the ISD::INSERT_VECTOR_ELT case tweaking the DemandedElts mask instead of using a local copy - so later uses of the mask use the tweaked version.....

Noticed while investigating adding zero/undef folding to SimplifyDemandedVectorElts and the altered DemandedElts mask was causing mismatches.

llvm-svn: 348348

5 years ago[ARM GlobalISel] Implement call lowering for Thumb2
Diana Picus [Wed, 5 Dec 2018 10:35:28 +0000 (10:35 +0000)]
[ARM GlobalISel] Implement call lowering for Thumb2

The only things that are different from arm are:
* different opcodes for calls and returns
* Thumb calls take predicate operands

llvm-svn: 348347

5 years agoRevert r348335 "[XRay] Move-only Allocator, FunctionCallTrie, and Array"
Hans Wennborg [Wed, 5 Dec 2018 10:19:55 +0000 (10:19 +0000)]
Revert r348335 "[XRay] Move-only Allocator, FunctionCallTrie, and Array"

.. and also the follow-ups r348336 r348338.

It broke stand-alone compiler-rt builds with GCC 4.8:

In file included from /work/llvm/projects/compiler-rt/lib/xray/xray_function_call_trie.h:20:0,
  Â  Â  Â  Â  Â  Â  Â  Â from /work/llvm/projects/compiler-rt/lib/xray/xray_profile_collector.h:21,
  Â  Â  Â  Â  Â  Â  Â  Â from /work/llvm/projects/compiler-rt/lib/xray/xray_profile_collector.cc:15:
/work/llvm/projects/compiler-rt/lib/xray/xray_segmented_array.h: In instantiation of â€˜T* __xray::Array<T>::AppendEmplace(Args&& ...) [with Args = {const __xray::FunctionCallTrie::mergeInto(__xray::FunctionCallTrie&) const::NodeAndTarget&}; T = __xray::FunctionCallTrie::mergeInto(__xray::FunctionCallTrie&) const::NodeAndTarget]’:
/work/llvm/projects/compiler-rt/lib/xray/xray_segmented_array.h:383:71: Â  required from â€˜T* __xray::Array<T>::Append(const T&) [with T = __xray::FunctionCallTrie::mergeInto(__xray::FunctionCallTrie&) const::NodeAndTarget]’
/work/llvm/projects/compiler-rt/lib/xray/xray_function_call_trie.h:517:54: Â  required from here
/work/llvm/projects/compiler-rt/lib/xray/xray_segmented_array.h:378:5: error: could not convert â€˜{std::forward<const __xray::FunctionCallTrie::mergeInto(__xray::FunctionCallTrie&) const::NodeAndTarget&>((* & args#0))}’ from â€˜<brace-enclosed initializer list>’ to â€˜__xray::FunctionCallTrie::mergeInto(__xray::FunctionCallTrie&) const::NodeAndTarget’
  Â  Â new (AlignedOffset) T{std::forward<Args>(args)...};
  Â  Â ^
/work/llvm/projects/compiler-rt/lib/xray/xray_segmented_array.h: In instantiation of â€˜T* __xray::Array<T>::AppendEmplace(Args&& ...) [with Args = {const __xray::profileCollectorService::{anonymous}::ThreadTrie&}; T = __xray::profileCollectorService::{anonymous}::ThreadTrie]’:
/work/llvm/projects/compiler-rt/lib/xray/xray_segmented_array.h:383:71: Â  required from â€˜T* __xray::Array<T>::Append(const T&) [with T = __xray::profileCollectorService::{anonymous}::ThreadTrie]’
/work/llvm/projects/compiler-rt/lib/xray/xray_profile_collector.cc:98:34: Â  required from here
/work/llvm/projects/compiler-rt/lib/xray/xray_segmented_array.h:378:5: error: could not convert â€˜{std::forward<const __xray::profileCollectorService::{anonymous}::ThreadTrie&>((* & args#0))}’ from
‘<brace-enclosed initializer list>’ to â€˜__xray::profileCollectorService::{anonymous}::ThreadTrie’
/work/llvm/projects/compiler-rt/lib/xray/xray_segmented_array.h: In instantiation of â€˜T* __xray::Array<T>::AppendEmplace(Args&& ...) [with Args = {const __xray::profileCollectorService::{anonymous}::ProfileBuffer&}; T = __xray::profileCollectorService::{anonymous}::ProfileBuffer]’:
/work/llvm/projects/compiler-rt/lib/xray/xray_segmented_array.h:383:71: Â  required from â€˜T* __xray::Array<T>::Append(const T&) [with T = __xray::profileCollectorService::{anonymous}::ProfileBuffer]
’
/work/llvm/projects/compiler-rt/lib/xray/xray_profile_collector.cc:244:44: Â  required from here
/work/llvm/projects/compiler-rt/lib/xray/xray_segmented_array.h:378:5: error: could not convert â€˜{std::forward<const __xray::profileCollectorService::{anonymous}::ProfileBuffer&>((* & args#0))}’ from â€˜<brace-enclosed initializer list>’ to â€˜__xray::profileCollectorService::{anonymous}::ProfileBuffer’

> Summary:
> This change makes the allocator and function call trie implementations
> move-aware and remove the FunctionCallTrie's reliance on a
> heap-allocated set of allocators.
>
> The change makes it possible to always have storage associated with
> Allocator instances, not necessarily having heap-allocated memory
> obtainable from these allocator instances. We also use thread-local
> uninitialised storage.
>
> We've also re-worked the segmented array implementation to have more
> precondition and post-condition checks when built in debug mode. This
> enables us to better implement some of the operations with surrounding
> documentation as well. The `trim` algorithm now has more documentation
> on the implementation, reducing the requirement to handle special
> conditions, and being more rigorous on the computations involved.
>
> In this change we also introduce an initialisation guard, through which
> we prevent an initialisation operation from racing with a cleanup
> operation.
>
> We also ensure that the ThreadTries array is not destroyed while copies
> into the elements are still being performed by other threads submitting
> profiles.
>
> Note that this change still has an issue with accessing thread-local
> storage from signal handlers that are instrumented with XRay. We also
> learn that with the testing of this patch, that there will be cases
> where calls to mmap(...) (through internal_mmap(...)) might be called in
> signal handlers, but are not async-signal-safe. Subsequent patches will
> address this, by re-using the `BufferQueue` type used in the FDR mode
> implementation for pre-allocated memory segments per active, tracing
> thread.
>
> We still want to land this change despite the known issues, with fixes
> forthcoming.
>
> Reviewers: mboerger, jfb
>
> Subscribers: jfb, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D54989

llvm-svn: 348346

5 years ago[LICM] *Actually* disable ControlFlowHoisting.
Alina Sbirlea [Wed, 5 Dec 2018 10:16:21 +0000 (10:16 +0000)]
[LICM] *Actually* disable ControlFlowHoisting.

Summary:
The remaining code paths that ControlFlowHoisting introduced that were
not disabled, increased compile time by 3x for some benchmarks.
The time is spent in DominatorTree updates.

Reviewers: john.brawn, mkazantsev

Subscribers: sanjoy, jlebar, llvm-commits

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

llvm-svn: 348345

5 years agoRevert "[clang-tidy] new check: bugprone-branch-clone"
Jonas Toth [Wed, 5 Dec 2018 09:34:18 +0000 (09:34 +0000)]
Revert "[clang-tidy] new check: bugprone-branch-clone"

The patch broke on buildbot with assertion-failure. Revert until this
is figured out.

llvm-svn: 348344

5 years ago[clang-tidy] new check: bugprone-branch-clone
Jonas Toth [Wed, 5 Dec 2018 09:16:25 +0000 (09:16 +0000)]
[clang-tidy] new check: bugprone-branch-clone

Summary:
Implement a check for detecting if/else if/else chains where two or more
branches are Type I clones of each other (that is, they contain identical code)
and for detecting switch statements where two or more consecutive branches are
Type I clones of each other.

Patch by donat.nagy.

Reviewers: alexfh, hokein, aaron.ballman, JonasToth

Reviewed By: JonasToth

Subscribers: MTC, lebedev.ri, whisperity, xazax.hun, Eugene.Zelenko, mgorny, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 348343

5 years agoHowToBuildWithPGO.rst: Fix a few details in the manual steps
Hans Wennborg [Wed, 5 Dec 2018 08:35:30 +0000 (08:35 +0000)]
HowToBuildWithPGO.rst: Fix a few details in the manual steps

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

llvm-svn: 348342

5 years agoFix a false positive in misplaced-widening-cast
Jonas Toth [Wed, 5 Dec 2018 08:29:56 +0000 (08:29 +0000)]
Fix a false positive in misplaced-widening-cast

Summary:
bugprone-misplaced-widening-cast check
used to give a false warning to the
following example.

 enum DaysEnum{
    MON = 0,
    TUE = 1
    };

 day = (DaysEnum)(day + 1);
 //warning: either cast from 'int' to 'DaysEnum' is ineffective...

But i think int to enum cast is not widening neither ineffective.

Patch by dkrupp.

Reviewers: JonasToth, alexfh

Reviewed By: alexfh

Subscribers: rnkovacs, Szelethus, gamesh411, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 348341

5 years ago[X86] Remove -costmodel-reduxcost=true from the experimental vector reduction intrins...
Craig Topper [Wed, 5 Dec 2018 07:56:50 +0000 (07:56 +0000)]
[X86] Remove -costmodel-reduxcost=true from the experimental vector reduction intrinsic tests as it appears to be unnecessary. NFC

I think this has something to do with matching reductions from extractelement, binops, and shuffles. But we're not matching here.

llvm-svn: 348340

5 years ago[X86] Add more cost model tests for vector reductions with narrow vector types. NFC
Craig Topper [Wed, 5 Dec 2018 07:26:57 +0000 (07:26 +0000)]
[X86] Add more cost model tests for vector reductions with narrow vector types. NFC

llvm-svn: 348339

5 years ago[XRay] Use uptr instead of uintptr_t
Dean Michael Berris [Wed, 5 Dec 2018 07:14:06 +0000 (07:14 +0000)]
[XRay] Use uptr instead of uintptr_t

Follow-up to D54989.

llvm-svn: 348338

5 years agoAArch64: support funclets in fastcall and swift_call
Saleem Abdulrasool [Wed, 5 Dec 2018 07:09:20 +0000 (07:09 +0000)]
AArch64: support funclets in fastcall and swift_call

Functions annotated with `__fastcall` or `__attribute__((__fastcall__))`
or `__attribute__((__swiftcall__))` may contain SEH handlers even on
Win64.  This matches the behaviour of cl which allows for
`__try`/`__except` inside a `__fastcall` function.  This was detected
while trying to self-host clang on Windows ARM64.

llvm-svn: 348337

5 years ago[XRay] Use deallocateBuffer instead of deallocate
Dean Michael Berris [Wed, 5 Dec 2018 07:05:44 +0000 (07:05 +0000)]
[XRay] Use deallocateBuffer instead of deallocate

Follow-up to D54989.

llvm-svn: 348336

5 years ago[XRay] Move-only Allocator, FunctionCallTrie, and Array
Dean Michael Berris [Wed, 5 Dec 2018 06:44:34 +0000 (06:44 +0000)]
[XRay] Move-only Allocator, FunctionCallTrie, and Array

Summary:
This change makes the allocator and function call trie implementations
move-aware and remove the FunctionCallTrie's reliance on a
heap-allocated set of allocators.

The change makes it possible to always have storage associated with
Allocator instances, not necessarily having heap-allocated memory
obtainable from these allocator instances. We also use thread-local
uninitialised storage.

We've also re-worked the segmented array implementation to have more
precondition and post-condition checks when built in debug mode. This
enables us to better implement some of the operations with surrounding
documentation as well. The `trim` algorithm now has more documentation
on the implementation, reducing the requirement to handle special
conditions, and being more rigorous on the computations involved.

In this change we also introduce an initialisation guard, through which
we prevent an initialisation operation from racing with a cleanup
operation.

We also ensure that the ThreadTries array is not destroyed while copies
into the elements are still being performed by other threads submitting
profiles.

Note that this change still has an issue with accessing thread-local
storage from signal handlers that are instrumented with XRay. We also
learn that with the testing of this patch, that there will be cases
where calls to mmap(...) (through internal_mmap(...)) might be called in
signal handlers, but are not async-signal-safe. Subsequent patches will
address this, by re-using the `BufferQueue` type used in the FDR mode
implementation for pre-allocated memory segments per active, tracing
thread.

We still want to land this change despite the known issues, with fixes
forthcoming.

Reviewers: mboerger, jfb

Subscribers: jfb, llvm-commits

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

llvm-svn: 348335

5 years ago[X86] Add narrow vector test cases to vector-reduce* tests. Add copies of the tests...
Craig Topper [Wed, 5 Dec 2018 06:29:44 +0000 (06:29 +0000)]
[X86] Add narrow vector test cases to vector-reduce* tests. Add copies of the tests with -x86-experimental-vector-widening-legalization

llvm-svn: 348334

5 years ago[NFC] Verify memoryssa in test for PR39783
Max Kazantsev [Wed, 5 Dec 2018 05:20:08 +0000 (05:20 +0000)]
[NFC] Verify memoryssa in test for PR39783

llvm-svn: 348333

5 years agogdb-remote: use elaborated type specifier for `Module`
Saleem Abdulrasool [Wed, 5 Dec 2018 04:04:14 +0000 (04:04 +0000)]
gdb-remote: use elaborated type specifier for `Module`

When building with MSVC, the type `Module` is ambiguous due to both the
lldb_private and llvm namespaces being used.  Use the elaborated type
instead to resolve the ambiguity.

llvm-svn: 348332

5 years ago[clang-tidy/checks] Update objc-property-declaration check to allow arbitrary acronym...
Stephane Moore [Wed, 5 Dec 2018 03:44:03 +0000 (03:44 +0000)]
[clang-tidy/checks] Update objc-property-declaration check to allow arbitrary acronyms and initialisms ðŸ”§

Summary:
§1 Description

This changes the objc-property-declaration check to allow arbitrary acronyms and initialisms instead of using whitelisted acronyms. In Objective-C it is relatively common to use project prefixes in property names for the purposes of disambiguation. For example, the CIColor¹ and CGColor² properties on UIColor both represent symbol prefixes being used in proeprty names outside of Apple's accepted acronyms³. The union of Apple's accepted acronyms and all symbol prefixes that might be used for disambiguation in property declarations effectively allows for any arbitrary sequence of capital alphanumeric characters to be acceptable in property declarations. This change updates the check accordingly.

The test variants with custom configurations are deleted as part of this change because their configurations no longer impact behavior. The acronym configurations are currently preserved for backwards compatibility of check configuration.

[1] https://developer.apple.com/documentation/uikit/uicolor/1621951-cicolor?language=objc
[2] https://developer.apple.com/documentation/uikit/uicolor/1621954-cgcolor?language=objc
[3] https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/APIAbbreviations.html#//apple_ref/doc/uid/20001285-BCIHCGAE

§2 Test Notes

Changes verified by:
• Running clang-tidy unit tests.
• Used check_clang_tidy.py to verify expected output of processing objc-property-declaration.m

Reviewers: benhamilton, Wizard

Reviewed By: benhamilton

Subscribers: jfb, cfe-commits

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

llvm-svn: 348331

5 years ago[MachineLICM][X86][AMDGPU] Fix subtle bug in the updating of PhysRegClobbers in post...
Craig Topper [Wed, 5 Dec 2018 03:41:26 +0000 (03:41 +0000)]
[MachineLICM][X86][AMDGPU] Fix subtle bug in the updating of PhysRegClobbers in post-RA LICM

It looks like MCRegAliasIterator can visit the same physical register twice. When this happens in this code in LICM we end up setting the PhysRegDef and then later in the same loop visit the register again. Now we see that PhysRegDef is set from the earlier iteration so now set PhysRegClobber.

This patch splits the loop so we have one that uses the previous value of PhysRegDef to update PhysRegClobber and second loop that updates PhysRegDef.

The X86 atomic test is an improvement. I had to add sideeffect to the two shrink wrapping tests to prevent hoisting from occurring. I'm not sure about the AMDGPU tests. It looks like the branch instruction changed at end the of the loops. And in the branch-relaxation test I think there is now "and vcc, exec, -1" instruction that wasn't there before.

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

llvm-svn: 348330

5 years agoUpdate GET_LINK_MAP_BY_DLOPEN_HANDLE() for NetBSD x86
Kamil Rytarowski [Wed, 5 Dec 2018 03:17:21 +0000 (03:17 +0000)]
Update GET_LINK_MAP_BY_DLOPEN_HANDLE() for NetBSD x86

NetBSD 8.99.26 changed the layout of internal structure
returned by dlopen(3), switch to it.

Set new values for amd64 and i386 based on the results
of &((struct Struct_Obj_Entry*)0)->linkmap.

llvm-svn: 348329

5 years ago[clang-query] Continue if compilation command not found for some files
George Karpenkov [Wed, 5 Dec 2018 02:02:40 +0000 (02:02 +0000)]
[clang-query] Continue if compilation command not found for some files

When searching for a code pattern in an entire project with a
compilation database it's tempting to run

```
clang-query **.cpp
```

And yet, that often breaks because some files are just not in the
compilation database: tests, sample code, etc..
clang-query should not stop when encountering such cases.

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

llvm-svn: 348328

5 years ago[asan] Add clang flag -fsanitize-address-use-odr-indicator
Vitaly Buka [Wed, 5 Dec 2018 01:44:31 +0000 (01:44 +0000)]
[asan] Add clang flag -fsanitize-address-use-odr-indicator

Reviewers: eugenis, m.ostapenko, ygribov

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 348327

5 years ago[TableGen] Preserve order of output operands in DAGISelMatcherGen
Craig Topper [Wed, 5 Dec 2018 00:47:59 +0000 (00:47 +0000)]
[TableGen] Preserve order of output operands in DAGISelMatcherGen

Summary:
This fixes support in DAGISelMatcher backend for DAG nodes with multiple
result values. Previously the order of results in selected DAG nodes always
matched the order of results in ISel patterns. After the change the order of
results matches the order of operands in OutOperandList instead.

For example, given this definition from the attached test case:

  def INSTR : Instruction {
    let OutOperandList = (outs GPR:$r1, GPR:$r0);
    let InOperandList = (ins GPR:$t0, GPR:$t1);
    let Pattern = [(set i32:$r0, i32:$r1, (udivrem i32:$t0, i32:$t1))];
  }

the DAGISelMatcher backend currently produces a matcher that creates INSTR
nodes with the first result `$r0` and the second result `$r1`, contrary to the
order in the OutOperandList. The order of operands in OutOperandList does not
matter at all, which is unexpected (and unfortunate) because the order of
results of a DAG node does matters, perhaps a lot.

With this change, if the order in OutOperandList does not match the order in
Pattern, DAGISelMatcherGen emits CompleteMatch opcodes with the order of
results taken from OutOperandList. Backend writers can use it to express
result reorderings in TableGen.

If the order in OutOperandList matches the order in Pattern, the result of
DAGISelMatcherGen is unaffected.

Patch by Eugene Sharygin

Reviewers: andreadb, bjope, hfinkel, RKSimon, craig.topper

Reviewed By: craig.topper

Subscribers: nhaehnle, craig.topper, llvm-commits

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

llvm-svn: 348326

5 years ago[Sema] Remove some conditions of a failing assert
Erik Pilkington [Wed, 5 Dec 2018 00:43:11 +0000 (00:43 +0000)]
[Sema] Remove some conditions of a failing assert

We should have been checking that this state is consistent, but its
possible for it to be filled later, so it isn't really sound to check
it here anyways.

Fixes llvm.org/PR39742

llvm-svn: 348325

5 years ago[SelectionDAG] Split very large token factors for loads into 64k chunks.
Amara Emerson [Wed, 5 Dec 2018 00:41:30 +0000 (00:41 +0000)]
[SelectionDAG] Split very large token factors for loads into 64k chunks.

There's a 64k limit on the number of SDNode operands, and some very large
functions with 64k or more loads can cause crashes due to this limit being hit
when a TokenFactor with this many operands is created. To fix this, create
sub-tokenfactors if we've exceeded the limit.

No test case as it requires a very large function.

rdar://45196621

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

llvm-svn: 348324

5 years ago[ADT] Add zip_longest iterators.
Michael Kruse [Wed, 5 Dec 2018 00:31:54 +0000 (00:31 +0000)]
[ADT] Add zip_longest iterators.

Like the already existing zip_shortest/zip_first iterators, zip_longest
iterates over multiple iterators at once, but has as many iterations as
the longest sequence.

This means some iterators may reach the end before others do.
zip_longest uses llvm::Optional's None value to mark a
past-the-end value.

zip_longest is not reverse-iteratable because the tuples iterated over
would be different for different length sequences (IMHO for the same
reason neither zip_shortest nor zip_first should be reverse-iteratable;
one can still reverse the ranges individually if that's the expected
behavior).

In contrast to zip_shortest/zip_first, zip_longest tuples contain
rvalues instead of references. This is because llvm::Optional cannot
contain reference types and the value-initialized default does not have
a memory location a reference could point to.

The motivation for these iterators is to use C++ foreach to compare two
lists of ordered attributes in D48100 (SemaOverload.cpp and
ASTReaderDecl.cpp).

Idea by @hfinkel.

This re-commits r348301 which was reverted by r348303.
The compilation error by gcc 5.4 was resolved using make_tuple in the in
the initializer_list.
The compileration error by msvc14 was resolved by splitting
ZipLongestValueType (which already was a workaround for msvc15) into
ZipLongestItemType and ZipLongestTupleType.

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

llvm-svn: 348323

5 years agoLTO: Don't internalize available_externally globals.
Peter Collingbourne [Wed, 5 Dec 2018 00:09:36 +0000 (00:09 +0000)]
LTO: Don't internalize available_externally globals.

This breaks C and C++ semantics because it can cause the address
of the global inside the module to differ from the address outside
of the module.

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

llvm-svn: 348321

5 years ago[AArch64][GlobalISel] Re-enable selection of volatile loads.
Amara Emerson [Wed, 5 Dec 2018 00:03:09 +0000 (00:03 +0000)]
[AArch64][GlobalISel] Re-enable selection of volatile loads.

We previously disabled this in r323371 because of a bug where we selected an
extending load, but didn't delete the old G_LOAD, resulting in two loads being
generated for volatile loads.

Since we now have dedicated G_SEXTLOAD/G_ZEXTLOAD operations, and that the
tablegen patterns should no longer be able to select (ext(load x)) patterns, it
should be safe to re-enable it.

The old test case should still work as expected.

llvm-svn: 348320

5 years ago[build.py] Disable tests on non-Windows.
Zachary Turner [Tue, 4 Dec 2018 23:56:25 +0000 (23:56 +0000)]
[build.py] Disable tests on non-Windows.

This won't work until we get the GCC / clang builder implemented.

llvm-svn: 348319

5 years agoRemove the hash code from CVRecord.
Zachary Turner [Tue, 4 Dec 2018 23:56:07 +0000 (23:56 +0000)]
Remove the hash code from CVRecord.

This is no longer used and is just taking up space in the structure.
Heap allocation of this structure is on the critical path, so space
actually matters.

llvm-svn: 348318

5 years ago[clang-tidy] Ignore namespaced and C++ member functions in google-objc-function-namin...
Stephane Moore [Tue, 4 Dec 2018 23:40:42 +0000 (23:40 +0000)]
[clang-tidy] Ignore namespaced and C++ member functions in google-objc-function-naming check ðŸ™ˆ

Summary: The google-objc-function-naming check applies to functions that are not namespaced and should not be applied to C++ member functions. Such function declarations should be ignored by the check to avoid false positives in Objective-C++ sources.

Reviewers: benhamilton, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 348317

5 years ago[asan] Split -asan-use-private-alias to -asan-use-odr-indicator
Vitaly Buka [Tue, 4 Dec 2018 23:17:41 +0000 (23:17 +0000)]
[asan] Split -asan-use-private-alias to -asan-use-odr-indicator

Reviewers: eugenis, m.ostapenko, ygribov

Subscribers: mehdi_amini, kubamracek, hiraditya, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 348316

5 years ago[asan] Remove use_odr_indicator runtime flag
Vitaly Buka [Tue, 4 Dec 2018 23:17:32 +0000 (23:17 +0000)]
[asan] Remove use_odr_indicator runtime flag

Summary:
Flag was added for testing 3 years ago. Probably it's time
to simplify code and usage by removing it.

Reviewers: eugenis, m.ostapenko

Subscribers: mehdi_amini, kubamracek, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 348315

5 years agoFix LLDB build script.
Zachary Turner [Tue, 4 Dec 2018 22:46:01 +0000 (22:46 +0000)]
Fix LLDB build script.

A local patch was omitted from the original commit.  This makes
the tests pass.

llvm-svn: 348314

5 years agoFix crash if an in-class explicit function specialization has explicit
Richard Smith [Tue, 4 Dec 2018 22:26:32 +0000 (22:26 +0000)]
Fix crash if an in-class explicit function specialization has explicit
template arguments referring to template paramaeters.

llvm-svn: 348313

5 years ago[InstCombine] add tests for implied simplifications; NFC
Sanjay Patel [Tue, 4 Dec 2018 22:25:33 +0000 (22:25 +0000)]
[InstCombine] add tests for implied simplifications; NFC

Ideally, we would fold all of these in InstSimplify in a
similar way to rL347896, but this is a bit awkward when
we're trying to simplify a compare directly because the
ValueTracking API expects the compare as an input, but
in InstSimplify, we just have the operands of the compare.

Given that we can do transforms besides just simplifications,
we might as well just extend the code in InstCombine (which
already does simplifications with constant operands).

llvm-svn: 348312

5 years ago[ELF] Simplify getSectionPiece
Fangrui Song [Tue, 4 Dec 2018 22:25:05 +0000 (22:25 +0000)]
[ELF] Simplify getSectionPiece

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: grimar, emaste, arichardson, llvm-commits

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

llvm-svn: 348311

5 years agoAArch64: clean up some whitespace in Windows CC (NFC)
Saleem Abdulrasool [Tue, 4 Dec 2018 22:19:29 +0000 (22:19 +0000)]
AArch64: clean up some whitespace in Windows CC (NFC)

Drive by clean up for Windows ARM64 variadic CC (NFC).

llvm-svn: 348310

5 years agoAdding tests for -ast-dump; NFC.
Aaron Ballman [Tue, 4 Dec 2018 21:50:08 +0000 (21:50 +0000)]
Adding tests for -ast-dump; NFC.

This adds tests for the definition data of C++ record objects as well as special member functions.

llvm-svn: 348309

5 years agoAdd tests for dumping base classes; NFC.
Aaron Ballman [Tue, 4 Dec 2018 21:49:24 +0000 (21:49 +0000)]
Add tests for dumping base classes; NFC.

llvm-svn: 348308

5 years ago[llvm-pdbutil] Remove the analyze subcommand.
Zachary Turner [Tue, 4 Dec 2018 21:49:04 +0000 (21:49 +0000)]
[llvm-pdbutil] Remove the analyze subcommand.

Nobody has used this since it was introduced, and it doesn't have
test coverage.

llvm-svn: 348307

5 years ago[PDB] Emit S_UDT records in LLD.
Zachary Turner [Tue, 4 Dec 2018 21:48:46 +0000 (21:48 +0000)]
[PDB] Emit S_UDT records in LLD.

Previously these were dropped.  We now understand them sufficiently
well to start emitting them.  From the debugger's perspective, this
now enables us to have debug info about typedefs (both global and
function-locally scoped)

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

llvm-svn: 348306

5 years ago[build.py] A few general improvements.
Zachary Turner [Tue, 4 Dec 2018 21:48:27 +0000 (21:48 +0000)]
[build.py] A few general improvements.

This makes -mode=compile support multiple inputs (and hence
multiple outputs).

It also makes the value of -arch for compiling inferiors default
to the architecture that LLDB is built in.  This can still be
overridden however.

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

llvm-svn: 348305

5 years ago[AVR] Silence fallthrough warning. NFC.
Nirav Dave [Tue, 4 Dec 2018 21:41:52 +0000 (21:41 +0000)]
[AVR] Silence fallthrough warning. NFC.

llvm-svn: 348304

5 years agoRevert "[ADT] Add zip_longest iterators"
Michael Kruse [Tue, 4 Dec 2018 21:38:55 +0000 (21:38 +0000)]
Revert "[ADT] Add zip_longest iterators"

This reverts commit r348301.

Compilation fails on buildbots with older versions of gcc and msvc.

llvm-svn: 348303

5 years ago[Documentation] Make options section in Clang-tidy readability-uppercase-literal...
Eugene Zelenko [Tue, 4 Dec 2018 21:19:08 +0000 (21:19 +0000)]
[Documentation] Make options section in Clang-tidy readability-uppercase-literal-suffix consistent with other checks.

llvm-svn: 348302