platform/upstream/llvm.git
4 years agoRevert "gn build: Merge r368021"
Dmitri Gribenko [Tue, 6 Aug 2019 13:39:27 +0000 (13:39 +0000)]
Revert "gn build: Merge r368021"

This reverts commit r368025, which depends on r368021, which needs to be
reverted.

llvm-svn: 368034

4 years agoUpdate LLDB to follow changes in llvm::DWARFDebugNames::NameIndex (4/5)
Igor Kudrin [Tue, 6 Aug 2019 13:38:27 +0000 (13:38 +0000)]
Update LLDB to follow changes in llvm::DWARFDebugNames::NameIndex (4/5)

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

llvm-svn: 368033

4 years ago[MachO] Update LLD to use 64-bit offsets with DataExtractor (3/5)
Igor Kudrin [Tue, 6 Aug 2019 13:37:34 +0000 (13:37 +0000)]
[MachO] Update LLD to use 64-bit offsets with DataExtractor (3/5)

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

llvm-svn: 368032

4 years agoAArch64: bail instead of asserting on unexpected type in G_CONSTANT 0.
Tim Northover [Tue, 6 Aug 2019 13:34:08 +0000 (13:34 +0000)]
AArch64: bail instead of asserting on unexpected type in G_CONSTANT 0.

llvm-svn: 368031

4 years agoFixed failing test cases
Alex Brachet [Tue, 6 Aug 2019 13:29:55 +0000 (13:29 +0000)]
Fixed failing test cases

llvm-svn: 368030

4 years agoImprove MSVC visualizations so the parser shows where we are in the code
Mike Spertus [Tue, 6 Aug 2019 13:29:35 +0000 (13:29 +0000)]
Improve MSVC visualizations so the parser shows where we are in the code

Also provide a visualizer for lambda introducers

llvm-svn: 368029

4 years ago[InstCombine] add tests for binop with FMF with select operands; NFC
Sanjay Patel [Tue, 6 Aug 2019 13:19:13 +0000 (13:19 +0000)]
[InstCombine] add tests for binop with FMF with select operands; NFC

Baseline coverage for D65658.

llvm-svn: 368028

4 years agogn build: Merge r368024
Nico Weber [Tue, 6 Aug 2019 13:12:26 +0000 (13:12 +0000)]
gn build: Merge r368024

llvm-svn: 368027

4 years ago[X86][SSE] Call SimplifyMultipleUseDemandedBits on PACKSS/PACKUS arguments.
Simon Pilgrim [Tue, 6 Aug 2019 13:10:42 +0000 (13:10 +0000)]
[X86][SSE] Call SimplifyMultipleUseDemandedBits on PACKSS/PACKUS arguments.

This mainly helps to replace unused arguments with UNDEF in the case where they have multiple users.

llvm-svn: 368026

4 years agogn build: Merge r368021
Nico Weber [Tue, 6 Aug 2019 13:08:54 +0000 (13:08 +0000)]
gn build: Merge r368021

llvm-svn: 368025

4 years ago[AArch64] NFC: Add generic StackOffset to describe scalable offsets.
Sander de Smalen [Tue, 6 Aug 2019 13:06:40 +0000 (13:06 +0000)]
[AArch64] NFC: Add generic StackOffset to describe scalable offsets.

To support spilling/filling of scalable vectors we need a more generic
representation of a stack offset than simply 'int'.

For this we introduce the StackOffset struct, which comprises multiple
offsets sized by their respective MVTs. Byte-offsets will thus be a simple
tuple such as { offset, MVT::i8 }. Adding two byte-offsets will result in a
byte offset { offsetA + offsetB, MVT::i8 }. When two offsets have different
types, we can canonicalise them to use the same MVT, as long as their
runtime sizes are guaranteed to have the same size-ratio as they would have
at compile-time.

When we have both scalable- and fixed-size objects on the stack, we can
create an offset that is:

  ({ offset_fixed, MVT::i8 } + { offset_scalable, MVT::nxv1i8 })

The struct also contains a getForFrameOffset() method that is specific to
AArch64 and decomposes the frame-offset to be used directly in instructions
that operate on the stack or index into the stack.

Note: This patch adds StackOffset as an AArch64-only concept, but we would
like to make this a generic concept/struct that is supported by all
interfaces that take or return stack offsets (currently as 'int'). Since
that would be a bigger change that is currently pending on D32530 landing,
we thought it makes sense to first show/prove the concept in the AArch64
target before proposing to roll this out further.

Reviewers: thegameg, rovka, t.p.northover, efriedma, greened

Reviewed By: rovka, greened

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

llvm-svn: 368024

4 years ago[llvm/test/Object] Remove redundant test case. NFC
Simon Atanasyan [Tue, 6 Aug 2019 12:41:43 +0000 (12:41 +0000)]
[llvm/test/Object] Remove redundant test case. NFC

Remove redundant `yaml2obj-elf-file-headers-with-e_flags.yaml` test
case. The same functionality is checked by the `Mips/elf-flags.yaml`.

llvm-svn: 368023

4 years ago[X86] SimplifyMultipleUseDemandedBits - target shuffles might not be identity
Simon Pilgrim [Tue, 6 Aug 2019 12:41:29 +0000 (12:41 +0000)]
[X86] SimplifyMultipleUseDemandedBits - target shuffles might not be identity

If we don't demand any non-undef shuffle elements then the assert will fail as all shuffle inputs would still be flagged as 'identity' safe.

Exposed by an incoming patch.

llvm-svn: 368022

4 years ago[yaml2obj] Move core yaml2obj code into lib and include for use in unit tests
Alex Brachet [Tue, 6 Aug 2019 12:15:18 +0000 (12:15 +0000)]
[yaml2obj] Move core yaml2obj code into lib and include for use in unit tests

Reviewers: jhenderson, rupprecht, MaskRay, grimar, labath

Reviewed By: rupprecht

Subscribers: seiya, mgorny, sbc100, hiraditya, aheejin, jakehehrlich, llvm-commits

Tags: #llvm

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

llvm-svn: 368021

4 years ago[CrossTU] Handle case when no USR could be generated during Decl search.
Balazs Keri [Tue, 6 Aug 2019 12:10:16 +0000 (12:10 +0000)]
[CrossTU] Handle case when no USR could be generated during Decl search.

Summary:
When searching for a declaration to be loaded the "lookup name" for every
other Decl is computed. If the USR can not be determined here should be
not an assert, instead skip this Decl.

Reviewers: martong

Reviewed By: martong

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 368020

4 years ago[clangd] Compute scopes eagerly in IncludeFixer
Ilya Biryukov [Tue, 6 Aug 2019 11:37:50 +0000 (11:37 +0000)]
[clangd] Compute scopes eagerly in IncludeFixer

Summary:
Computing lazily leads to crashes. In particular, computing scopes may
produce diagnostics (from inside template instantiations) and we
currently do it when processing another diagnostic, which leads to
crashes.

Moreover, we remember and access 'Scope*' when computing scopes. This
might lead to invalid memory access if the Scope is deleted by the time
we run the delayed computation. We did not actually construct an example
when this happens, though.

From the VCS and review history, it seems the optimization was
introduced in the initial version without a mention of any performance
benchmarks justifying the performance gains. This led me to a
conclusion that the optimization was premature, so removing it to avoid
crashes seems like the right trade-off at that point.

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

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

llvm-svn: 368019

4 years agoTry to unbreak buildbots after r368014
Igor Kudrin [Tue, 6 Aug 2019 11:12:13 +0000 (11:12 +0000)]
Try to unbreak buildbots after r368014

llvm-svn: 368018

4 years ago[X86][SSE] Enable min/max partial reduction
Simon Pilgrim [Tue, 6 Aug 2019 11:00:34 +0000 (11:00 +0000)]
[X86][SSE] Enable min/max partial reduction

As mentioned on D65047 / rL366933 the plan is to enable partial reduction handling wherever possible.

llvm-svn: 368016

4 years ago[X86][SSE] Add tests for min/max partial reduction
Simon Pilgrim [Tue, 6 Aug 2019 10:52:44 +0000 (10:52 +0000)]
[X86][SSE] Add tests for min/max partial reduction

As mentioned on D65047 / rL366933 the plan is to enable partial reduction handling wherever possible.

llvm-svn: 368015

4 years agoSwitch LLVM to use 64-bit offsets (2/5)
Igor Kudrin [Tue, 6 Aug 2019 10:49:40 +0000 (10:49 +0000)]
Switch LLVM to use 64-bit offsets (2/5)

This updates all libraries and tools in LLVM Core to use 64-bit offsets
which directly or indirectly come to DataExtractor.

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

llvm-svn: 368014

4 years agoSupport 64-bit offsets in utility classes (1/5)
Igor Kudrin [Tue, 6 Aug 2019 10:47:20 +0000 (10:47 +0000)]
Support 64-bit offsets in utility classes (1/5)

Using 64-bit offsets is required to fully implement 64-bit DWARF.
As these classes are used in many different libraries they should
temporarily support both 32- and 64-bit offsets.

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

llvm-svn: 368013

4 years ago[Strict FP] Allow custom operation actions
Ulrich Weigand [Tue, 6 Aug 2019 10:43:13 +0000 (10:43 +0000)]
[Strict FP] Allow custom operation actions

This patch changes the DAG legalizer to respect the operation actions
set by the target for strict floating-point operations. (Currently, the
legalizer will usually fall back to mutate to the non-strict action
(which is assumed to be legal), and only skip mutation if the strict
operation is marked legal.)

With this patch, if whenever a strict operation is marked as Legal or
Custom, it is passed to the target as usual. Only if it is marked as
Expand will the legalizer attempt to mutate to the non-strict operation.
Note that this will now fail if the non-strict operation is itself
marked as Custom -- the target will have to provide a Custom definition
for the strict operation then as well.

Reviewed By: hfinkel

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

llvm-svn: 368012

4 years agoChange two unnecessary uses of llvm::size(C) to C.size()
Fangrui Song [Tue, 6 Aug 2019 10:24:36 +0000 (10:24 +0000)]
Change two unnecessary uses of llvm::size(C) to C.size()

llvm-svn: 368011

4 years agoObjectFileELF: permit thread-local sections with overlapping file addresses
Pavel Labath [Tue, 6 Aug 2019 10:04:27 +0000 (10:04 +0000)]
ObjectFileELF: permit thread-local sections with overlapping file addresses

Summary:
In an attempt to make file-address-based lookups more predictable, in D55998
we started ignoring sections which would result in file address
overlaps. It turns out this was too aggressive because thread-local
sections typically will have file addresses which apear to overlap
regular data/code. This does not cause a problem at runtime because
thread-local sections are loaded into memory using special logic, but it
can cause problems for lldb when trying to lookup objects by their file
address.

This patch changes ObjectFileELF to permit thread-local sections to
overlap regular ones by essentially giving them a separate address
space. It also makes them more symmetrical to regular sections by
creating container sections from PT_TLS segments.

Simultaneously, the patch changes the regular file address lookup logic
to ignore sections with the thread-specific bit set. I believe this is
what the users looking up file addresses would typically expect, as
looking up thread-local data generally requires more complex logic (e.g.
DWARF has a special opcode for that).

Reviewers: clayborg, jingham, MaskRay

Subscribers: emaste, aprantl, arichardson, lldb-commits

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

llvm-svn: 368010

4 years agoAdd User docs for ASTImporter
Gabor Marton [Tue, 6 Aug 2019 09:52:21 +0000 (09:52 +0000)]
Add User docs for ASTImporter

Summary:
This document includes the description of the ASTImporter from the user/client
perspective.
A subsequent patch will describe the development internals.

Reviewers: a_sidorin, shafik, gamesh411, balazske, a.sidorin

Subscribers: rnkovacs, dkrupp, arphaman, Szelethus, cfe-commits

Tags: #clang

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

llvm-svn: 368009

4 years ago[SelectionDAG] Extend base addressing modes supported by MGATHER/MSCATTER
Cullen Rhodes [Tue, 6 Aug 2019 09:46:13 +0000 (09:46 +0000)]
[SelectionDAG] Extend base addressing modes supported by MGATHER/MSCATTER

Summary:
Before this patch MGATHER/MSCATTER is capable of representing all
common addressing modes, but only when illegal types are used.
This patch adds an IndexType property so more representations
are available when using legal types only.

Original modes:
 vector of bases
 base + vector of signed scaled offsets

New modes:
 base + vector of signed unscaled offsets
 base + vector of unsigned scaled offsets
 base + vector of unsigned unscaled offsets

The current behaviour of addressing modes for gather/scatter remains
unchanged.

Patch by Paul Walker.

Reviewed By: craig.topper

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

llvm-svn: 368008

4 years ago[UpdateTestChecks] Fix an incorrect %s added in r368006
Fangrui Song [Tue, 6 Aug 2019 09:44:18 +0000 (09:44 +0000)]
[UpdateTestChecks] Fix an incorrect %s added in r368006

llvm-svn: 368007

4 years ago[UpdateTestChecks] Apply some string concatenation cleanup
Fangrui Song [Tue, 6 Aug 2019 09:42:00 +0000 (09:42 +0000)]
[UpdateTestChecks] Apply some string concatenation cleanup

Some were what I suggested in D65610.

llvm-svn: 368006

4 years agotest-release.sh: Reorder sed commands for the binary comparison
Hans Wennborg [Tue, 6 Aug 2019 09:30:10 +0000 (09:30 +0000)]
test-release.sh: Reorder sed commands for the binary comparison

llvm-svn: 368004

4 years agoAArch64: use xzr/wzr for constant 0 in GlobalISel.
Tim Northover [Tue, 6 Aug 2019 09:18:41 +0000 (09:18 +0000)]
AArch64: use xzr/wzr for constant 0 in GlobalISel.

COPYs from xzr and wzr can often be folded away entirely during register
allocation, unlike a movz.

llvm-svn: 368003

4 years ago[LLVM][Alignment] Introduce Alignment In Attributes
Guillaume Chatelet [Tue, 6 Aug 2019 09:16:33 +0000 (09:16 +0000)]
[LLVM][Alignment] Introduce Alignment In Attributes

Summary:
This is patch is part of a serie to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: jfb

Subscribers: hiraditya, dexonsmith, llvm-commits, courbet

Tags: #llvm

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

llvm-svn: 368002

4 years agoSymbolVendor: Remove passthrough methods
Pavel Labath [Tue, 6 Aug 2019 09:12:42 +0000 (09:12 +0000)]
SymbolVendor: Remove passthrough methods

After the recent refactorings the SymbolVendor passthrough no longer
serve any purpose. This patch removes those methods, and updates all
callsites to go to the symbol file directly -- in most cases that just
means calling GetSymbolFile()->foo() instead of
GetSymbolVendor()->foo().

llvm-svn: 368001

4 years ago[LLVM][Alignment] Introduce Alignment In GlobalObject
Guillaume Chatelet [Tue, 6 Aug 2019 09:03:21 +0000 (09:03 +0000)]
[LLVM][Alignment] Introduce Alignment In GlobalObject

Summary:
This is patch is part of a serie to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: jfb

Subscribers: hiraditya, dexonsmith, llvm-commits, courbet

Tags: #llvm

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

Address comments

llvm-svn: 368000

4 years ago[compiler-rt] Implement getrandom interception
Vitaly Buka [Tue, 6 Aug 2019 08:41:53 +0000 (08:41 +0000)]
[compiler-rt] Implement getrandom interception

Summary:
Straightforward implementation of `getrandom` syscall and libc
hooks.

Test Plan: Local MSAN failures caused by uninstrumented `getrandom`
calls stop failing.

Patch by Andrew Krieger.

Reviewers: eugenis, vitalybuka

Reviewed By: vitalybuka

Subscribers: srhines, kubamracek, dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 367999

4 years agoRevert r367941 "Add a note to the release not about a potentially breaking optimization"
Hans Wennborg [Tue, 6 Aug 2019 08:32:33 +0000 (08:32 +0000)]
Revert r367941 "Add a note to the release not about a potentially breaking optimization"

The note was moved to the release_90 branch in r367997.

llvm-svn: 367998

4 years agoSymbolVendorELF: Perform build-id lookup even without a debug link
Pavel Labath [Tue, 6 Aug 2019 08:18:39 +0000 (08:18 +0000)]
SymbolVendorELF: Perform build-id lookup even without a debug link

Summary:
The debug link and build-id lookups are two independent ways one can
search for a separate symbol file. However, our implementation in
SymbolVendorELF was tying the two together and refusing to look up the
symbol file based on a build id if the file did not contain a debug
link.

This patch makes it possible to search for the symbol file with
just one of the two methods available. To demonstrate, I split the
build-id-case test into two, so that we test the search using both
methods.

Reviewers: jankratochvil, mgorny, clayborg, espindola, alexshap

Subscribers: emaste, arichardson, MaskRay, lldb-commits

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

llvm-svn: 367994

4 years ago[compiler-rt] Reverting r367962 due to Fuchsia bot build-breakage.
Puyan Lotfi [Tue, 6 Aug 2019 08:08:07 +0000 (08:08 +0000)]
[compiler-rt] Reverting r367962 due to Fuchsia bot build-breakage.

llvm-svn: 367990

4 years ago[lldb][NFC] Remove unnecessary cast in ClangUserExpression
Raphael Isemann [Tue, 6 Aug 2019 08:07:45 +0000 (08:07 +0000)]
[lldb][NFC] Remove unnecessary cast in ClangUserExpression

llvm-svn: 367989

4 years ago[llvm/test/Object] - Cleanup and move out the yaml2obj tests.
George Rimar [Tue, 6 Aug 2019 08:02:25 +0000 (08:02 +0000)]
[llvm/test/Object] - Cleanup and move out the yaml2obj tests.

There are multiple yaml2obj-* tests in llvm/test/Object
folder. This is not correct place to have them and my intention
was to move them out to test\tools\yaml2obj folder. I reviewed
them, made some changes, and my comments are below.

For all tests I:

Added comments when needed.
Moved them from llvm/test/Object to yaml2obj tests.
Another changes performed:

1) yaml2obj-invalid.yaml. It was a test for an invalid YAML input.
I just moved it.

2) yaml2obj-coff-multi-doc.test/yaml2obj-elf-multi-doc.test:
these were a tests for testing --docnum=x functionality,
one was for COFF and one for ELF. I merged them into one.

3) yaml2obj-elf-bits-endian.test:
I removed its 4 YAML inputs (merged into the main test).

4) yaml2obj-readobj.test:
This file has a long history. It was added to check the
"parsing of header charactestics" initially. Then was used to test
how yaml2obj writes the relocations. Then was upgraded to check how
yaml2obj handle "-o" option. I think it should be heavily splitted
and refactored in a separate patch. For now I leaved it as is, but restyled
to reduce the changes in a follow-ups.

5) yaml2obj-elf-alignment.yaml: its intention was to check we
can set sh-addralign field. I moved, renamed (to elf-sh-addralign.yaml)
and updated this test.

6) yaml2obj-elf-file-headers.yaml: I removed it.
It's intention was to check that
yaml2obj handles OS/ABI and ELF type (e.g Relocatable).
We are testing this already, for example in D64800. We might want
to add a better (more complete) test, but keeping the existent test
does not have much sense I think.

7) yaml2obj-elf-file-headers-with-e_flags.yaml: I would describe its intention
as "testing MIPS e_flags". It is far from being complete and tests only
a few flags. I leaved it alone for now.

8) yaml2obj-elf-rel.yaml: its intention is to check the MIPS32 relocations.
We have a version for MIPS64 here: test\Object\Mips\elf-mips64-rel.yaml
Seems them both are incomplete. I leaved them alone for now.

9) yaml2obj-elf-rel-noref.yaml: was introduced to check the support of arm32
R_ARM_V4BX relocatiion. I leaved it alone for now.

10) yaml2obj-elf-section-basic.yaml: it just checked that we are able to recognise
trivial fields like section 'Name', 'Type', 'Flags' and others. All of our yaml2obj
tests are heavily using it. I just removed this test.

11) yaml2obj-elf-section-invalid-size.yaml: its intention was to check the
"Section size must be greater than or equal to the content size" error.
I moved this test to `tools\yaml2obj\section-size-content.yaml'

12) yaml2obj-elf-symbol-basic.yaml: its intention seems was to support declarations
of the symbols in yaml2obj. I removed it. We use this in almost each test we already have.

13) yaml2obj-elf-symbol-LocalGlobalWeak.yaml: its intention was to check that we can
declare different symbol bindings. I moved it to tools\yaml2obj\elf-symbol-binding.yaml.

14) yaml2obj-coff-invalid-alignment.test: check that error is reported for a too large coff
section alignment. Moved it to tools\yaml2obj\coff-invalid-alignment.test

15) yaml2obj-elf-symbol-visibility.yaml: tests ELF symbols visibility. I improved it and
moved to tools\yaml2obj\elf-symbol-visibility.yaml and tools\obj2yaml\elf-symbol-visibility.yaml

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

llvm-svn: 367988

4 years agoUse "isa" since the variable isn't used.
Bill Wendling [Tue, 6 Aug 2019 07:27:26 +0000 (07:27 +0000)]
Use "isa" since the variable isn't used.

llvm-svn: 367985

4 years ago[DirectoryWatcher] Fix asserts Mac builds
Shoaib Meenai [Tue, 6 Aug 2019 07:13:53 +0000 (07:13 +0000)]
[DirectoryWatcher] Fix asserts Mac builds

Add a missing semicolon after an assert. Remove the period from the
assert message while I'm here, because we don't usually have those.

llvm-svn: 367984

4 years agoFix line table resolution near the end of a section
Pavel Labath [Tue, 6 Aug 2019 06:52:05 +0000 (06:52 +0000)]
Fix line table resolution near the end of a section

Summary:
lld r367537 changed the way the linker organizes sections and segments.
This exposed an lldb bug and caused some tests to fail.

In all of the failing tests the root cause was the same -- when we were
trying to resolve the last address in the line_table section, we failed
because it pointed past the end of the section.

This patch changes the line table address resolution code to back up the
address by one for end-of-sequence entries. This ensures the address
still points inside a section/module even if the line table sequence
ends at the very end of a section.

It also reverts the linker flags which were added to the failing tests
to restore previous behavior.

Reviewers: clayborg, jingham

Subscribers: mgorny, MaskRay, lldb-commits

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

llvm-svn: 367983

4 years ago[Driver] Introduce -stdlib++-isystem
Shoaib Meenai [Tue, 6 Aug 2019 06:48:43 +0000 (06:48 +0000)]
[Driver] Introduce -stdlib++-isystem

There are times when we wish to explicitly control the C++ standard
library search paths used by the driver. For example, when we're
building against the Android NDK, we might want to use the NDK's C++
headers (which have a custom inline namespace) even if we have C++
headers installed next to the driver. We might also be building against
a non-standard directory layout and wanting to specify the C++ standard
library include directories explicitly.

We could accomplish this by passing -nostdinc++ and adding an explicit
-isystem for our custom search directories. However, users of our
toolchain may themselves want to use -nostdinc++ and a custom C++ search
path (libc++'s build does this, for example), and our added -isystem
won't respect the -nostdinc++, leading to multiple C++ header
directories on the search path, which causes build failures.

Add a new driver option -stdlib++-isystem to support this use case.
Passing this option suppresses adding the default C++ library include
paths in the driver, and it also respects -nostdinc++ to allow users to
still override the C++ library paths themselves.

It's a bit unfortunate that we end up with both -stdlib++-isystem and
-cxx-isystem, but their semantics differ significantly. -cxx-isystem is
unaffected by -nostdinc++ and is added to the end of the search path
(which is not appropriate for C++ standard library headers, since they
often #include_next into other system headers), while -stdlib++-isystem
respects -nostdinc++, is added to the beginning of the search path, and
suppresses the default C++ library include paths.

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

llvm-svn: 367982

4 years ago[Driver] Prioritize SYSROOT/usr/include over RESOURCE_DIR/include on linux-musl
Fangrui Song [Tue, 6 Aug 2019 06:25:32 +0000 (06:25 +0000)]
[Driver] Prioritize SYSROOT/usr/include over RESOURCE_DIR/include on linux-musl

On a musl-based Linux distribution, stdalign.h stdarg.h stdbool.h stddef.h stdint.h stdnoreturn.h are expected to be provided by musl (/usr/include), instead of RESOURCE_DIR/include.
Reorder RESOURCE_DIR/include to fix the search order problem.
(Currently musl doesn't provide stdatomic.h. stdatomic.h is still found in RESOURCE_DIR/include.)

gcc on musl has a similar search order:

```
 /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0
 /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/x86_64-alpine-linux-musl
 /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/backward
 /usr/local/include
 /usr/include/fortify
 /usr/include
 /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/include
```

This is different from a glibc-based distribution where RESOURCE_DIR/include is placed before SYSROOT/usr/include.

According to the maintainer of musl:

> musl does not support use/mixing of compiler-provided std headers with its headers, and intentionally has no mechanism for communicating with such headers as to which types have already been defined or still need to be defined. If the current include order, with clang's headers before the libc ones, works in some situations, it's only by accident.

Reviewed by: phosek

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

llvm-svn: 367981

4 years ago[LV][NFC] Share the LV illegality reporting with LoopVectorize.
Hideki Saito [Tue, 6 Aug 2019 06:08:48 +0000 (06:08 +0000)]
[LV][NFC] Share the LV illegality reporting with LoopVectorize.

Reviewers: hsaito, fhahn, rengolin

Reviewed By: rengolin

Patch by psamolysov, thanks!

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

llvm-svn: 367980

4 years ago[clang][DirectoryWatcher] Adding llvm::Expected error handling to create.
Puyan Lotfi [Tue, 6 Aug 2019 05:12:23 +0000 (05:12 +0000)]
[clang][DirectoryWatcher] Adding llvm::Expected error handling to create.

Prior to this patch Unix style errno error reporting from the inotify layer was
used by DirectoryWatcher::create to simply return a nullptr on error. This
would generally be ok, except that in LLVM we have much more robust error
reporting through the facilities of llvm::Expected.

The other critical thing I stumbled across was that the unit tests for
DirectoryWatcher were not failing abruptly when inotify_init() was reporting an
error, but would continue with the testing and eventually hit a deadlock in a
pathological machine state (ie in the unit test, the return nullptr on ::create
was ignored).

Generally this pathological state never happens on any build bot, so it is
totally understandable that it was overlooked, but on a Linux desktop running
a dubious desktop environment (which I will not name) there is a chance that
said desktop environment could use up enough inotify instances to exceed the
user's limit. These are the conditions that led me to hit the deadlock I am
addressing in this patch with more robust error handling.

With the new llvm::Expected error handling when your system runs out of inotify
instances for your user, the unit test will be forced to handle the error or
crash and report the issue to the user instead of weirdly deadlocking on a
condition variable wait.

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

llvm-svn: 367979

4 years ago[Gardening] Remove dead code from ASTDumper (NFC)
Jonas Devlieghere [Tue, 6 Aug 2019 04:46:02 +0000 (04:46 +0000)]
[Gardening] Remove dead code from ASTDumper (NFC)

These functions are not referenced.

llvm-svn: 367978

4 years ago[Gardening] Remove dead code from ScriptInterpreterPython (NFC)
Jonas Devlieghere [Tue, 6 Aug 2019 04:45:59 +0000 (04:45 +0000)]
[Gardening] Remove dead code from ScriptInterpreterPython (NFC)

The terminal state is never saved or restored.

llvm-svn: 367977

4 years ago[Gardening] Remove dead code from IOHandler (NFC)
Jonas Devlieghere [Tue, 6 Aug 2019 04:45:55 +0000 (04:45 +0000)]
[Gardening] Remove dead code from IOHandler (NFC)

These functions are not referenced.

llvm-svn: 367976

4 years agoRemove unused function 'SetMangledCounterparts' (NFC)
Jonas Devlieghere [Tue, 6 Aug 2019 04:01:58 +0000 (04:01 +0000)]
Remove unused function 'SetMangledCounterparts' (NFC)

This function is not referenced.

llvm-svn: 367975

4 years agoCodeGen: Migration to using Register
Matt Arsenault [Tue, 6 Aug 2019 03:59:31 +0000 (03:59 +0000)]
CodeGen: Migration to using Register

llvm-svn: 367974

4 years agoBuiltins: Start adding half versions of math builtins
Matt Arsenault [Tue, 6 Aug 2019 03:28:37 +0000 (03:28 +0000)]
Builtins: Start adding half versions of math builtins

The implementation of the OpenCL builtin currently library uses 2
different hacks to get to the corresponding IR intrinsics from the
source. This will allow removal of those.

This is the set that is currently used (minus a few vector ones).

llvm-svn: 367973

4 years agogn build: Add AMDGPU target
Nico Weber [Tue, 6 Aug 2019 02:25:49 +0000 (02:25 +0000)]
gn build: Add AMDGPU target

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

llvm-svn: 367972

4 years agogn build: Leave a comment why "-gen-searchable-table" tablegen()s are not called...
Nico Weber [Tue, 6 Aug 2019 02:21:50 +0000 (02:21 +0000)]
gn build: Leave a comment why "-gen-searchable-table" tablegen()s are not called FooGenSearchableTable

llvm-svn: 367971

4 years agogn build: Merge r367917
Nico Weber [Tue, 6 Aug 2019 02:17:05 +0000 (02:17 +0000)]
gn build: Merge r367917

llvm-svn: 367970

4 years agoRe-commit: [AMDGPU] Use S_DENORM_MODE for gfx10
Austin Kerbow [Tue, 6 Aug 2019 02:16:11 +0000 (02:16 +0000)]
Re-commit: [AMDGPU] Use S_DENORM_MODE for gfx10

Summary: During fdiv32 lowering use S_DENORM_MODE to select denorm mode in gfx10.

Reviewers: arsenm, rampitec

Reviewed By: arsenm, rampitec

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367969

4 years ago[NFC][DirectoryWatchedTests] Unlocks mutexes before signaling condition variable
Puyan Lotfi [Tue, 6 Aug 2019 01:26:46 +0000 (01:26 +0000)]
[NFC][DirectoryWatchedTests] Unlocks mutexes before signaling condition variable

This should not affect actual behavior, but should pessimize the threading less
by avoiding the situation where:

  * mutex is still locked
  * T1 notifies on condition variable
  * T2 wakes to check mutex
  * T2 sees mutex is still locked
  * T2 waits
  * T1 unlocks mutex
  * T2 tries again, acquires mutex.

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

llvm-svn: 367968

4 years agoFix another MSVC issue after 367965
Daniel Sanders [Tue, 6 Aug 2019 01:16:29 +0000 (01:16 +0000)]
Fix another MSVC issue after 367965

Repeated the fix for MCRegister in Register

This reverts r367932 (git commit eac86ec25f5cd5d7a973c913d3c2ca8c90b24115)

llvm-svn: 367967

4 years ago[Attributor][NFC] Outline common pattern into helper method
Johannes Doerfert [Tue, 6 Aug 2019 00:55:11 +0000 (00:55 +0000)]
[Attributor][NFC] Outline common pattern into helper method

This helper will also allow to also place logic to determine if an
abstract attribute is necessary in the first place.

llvm-svn: 367966

4 years agoRe-commit Register/MCRegister: Add conversion operators to avoid use of implicit...
Daniel Sanders [Tue, 6 Aug 2019 00:53:47 +0000 (00:53 +0000)]
Re-commit Register/MCRegister: Add conversion operators to avoid use of implicit convert to unsigned. NFC

Added two more conversions to satisfy MSVC and moved the declaration of
MCPhysReg to MCRegister.h to enable that

This reverts r367932 (git commit eac86ec25f5cd5d7a973c913d3c2ca8c90b24115)

llvm-svn: 367965

4 years ago[Attributor][Fix] Add const qualifier
Johannes Doerfert [Tue, 6 Aug 2019 00:46:02 +0000 (00:46 +0000)]
[Attributor][Fix] Add const qualifier

I forgot to add this as part of the last commit.

llvm-svn: 367964

4 years agoRevert "[CompilerType] Simplify the interface a bit more.."
Davide Italiano [Tue, 6 Aug 2019 00:42:11 +0000 (00:42 +0000)]
Revert "[CompilerType] Simplify the interface a bit more.."

There's actually a test downstream that fails with this.
I think we can still get rid of it, but I need to do some work
there first.

llvm-svn: 367963

4 years ago[compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (3)
Puyan Lotfi [Tue, 6 Aug 2019 00:34:34 +0000 (00:34 +0000)]
[compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (3)

Third landing attempt: Added "if (HAVE_LIBCXX)" to keep Green Dragon green.

Haven't found a better way to pass the libcxx include path for building
compiler-rt with libcxx; this seems to be missing only for xray.

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

llvm-svn: 367962

4 years ago[Attributor] Provide a generic interface to check live instructions
Johannes Doerfert [Tue, 6 Aug 2019 00:32:43 +0000 (00:32 +0000)]
[Attributor] Provide a generic interface to check live instructions

Summary:
Similar to `Attributor::checkForAllCallSites`, we now provide such
functionality for instructions of a certain opcode through
`Attributor::checkForAllInstructions` and the convenient wrapper
`Attributor::checkForAllCallLikeInstructions`. This cleans up code,
avoids duplication, and simplifies the usage of liveness information.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367961

4 years ago[RISCV] Custom legalize i32 operations for RV64 to reduce signed extensions
Shiva Chen [Tue, 6 Aug 2019 00:24:00 +0000 (00:24 +0000)]
[RISCV] Custom legalize i32 operations for RV64 to reduce signed extensions

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

llvm-svn: 367960

4 years agoSilence ubsan after r367926.
Peter Collingbourne [Tue, 6 Aug 2019 00:21:30 +0000 (00:21 +0000)]
Silence ubsan after r367926.

Fixes e.g.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/14273

We can't left shift here because left shifting of a negative number is UB.
The same doesn't apply to unsigned arithmetic, but switching to unsigned
doesn't appear to stop ubsan from complaining, so we need to mask out the
high bits.

llvm-svn: 367959

4 years ago[clang-doc] Fix link generation
Diego Astiazaran [Tue, 6 Aug 2019 00:11:34 +0000 (00:11 +0000)]
[clang-doc] Fix link generation

Before making a link to a reference it is required to check that the
reference has a path (eg. primitives won't have paths).
This was done by checking if the path was empty; that worked because
when generating paths the outdirectory was included, so if the path was
assigned it had that outdirectory at least.
The path generation was changed, it's now only the composite of the
namespaces without the outdirectory. So if the info is in the global
namespace the path would be empty and the old check wouldn't work as expected.
A new attribute has been added to the Reference struct that indicates if
the info's parent is the global namespace.
Paths generation now fails if the path is empty and if the info
is not in the global namespace.

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

llvm-svn: 367958

4 years ago[CompilerType] Simplify the interface a bit more..
Davide Italiano [Tue, 6 Aug 2019 00:01:52 +0000 (00:01 +0000)]
[CompilerType] Simplify the interface a bit more..

Summary:
.. removing IsMeaninglessWithoutTypeResolution(). I'm fairly
confident this was introduced to support swift, where
static types [without dynamic counterpart] don't carry a lot
of value. Since then, the formatters and dynamic type resolution
has been rewritten, and we employ different solutions. This function
is unused here too, so let's get read of it.

<rdar://problem/36377967>

Reviewers: shafik, JDevlieghere, alex, compnerd, teemperor

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 367957

4 years ago[CMake] Remove check for the readline target.
Jonas Devlieghere [Mon, 5 Aug 2019 23:54:13 +0000 (23:54 +0000)]
[CMake] Remove check for the readline target.

This was introduced when we were building a custom readline Python
module on Linux [1]. Now that the readline  target doesn't exist
anymore, it's safe to remove this dependency.

This fixes https://llvm.org/PR25136

[1] https://reviews.llvm.org/D13268

llvm-svn: 367956

4 years ago[NFC] Remove useless static
JF Bastien [Mon, 5 Aug 2019 23:52:38 +0000 (23:52 +0000)]
[NFC] Remove useless static

The function is already inline in the header, static isn't what we want.

llvm-svn: 367955

4 years agoReverting D65760/r367944 due to buildbot failure.
Puyan Lotfi [Mon, 5 Aug 2019 23:47:07 +0000 (23:47 +0000)]
Reverting D65760/r367944 due to buildbot failure.

http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/15952/steps/build/logs/stdio

JITTargetMachineBuilder.cpp fails to build.

llvm-svn: 367954

4 years ago[Attributor] Introduce the IRAttribute helper struct
Johannes Doerfert [Mon, 5 Aug 2019 23:35:12 +0000 (23:35 +0000)]
[Attributor] Introduce the IRAttribute helper struct

Summary:
Certain properties, e.g., an AttrKind, are not shared among all abstract
attributes. This patch extracts the functionality into a helper struct.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367953

4 years ago[Attributor] Make abstract attributes stateless
Johannes Doerfert [Mon, 5 Aug 2019 23:32:31 +0000 (23:32 +0000)]
[Attributor] Make abstract attributes stateless

To remove boilerplate, mostly passing through values to the
AbstractAttriubute base class, we extract the state into an IRPosition
helper. There is no function change intended but the IRPosition struct
will provide more functionality down the line.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 367952

4 years ago[Attributor] Use proper ID for attribute lookup
Johannes Doerfert [Mon, 5 Aug 2019 23:30:01 +0000 (23:30 +0000)]
[Attributor] Use proper ID for attribute lookup

Summary:
The new scheme is similar to the pass manager and dyn_cast scheme where
we identify classes by the address of a static member. This is better
than the old scheme in which we had to "invent" new Attributor enums if
there was no corresponding one.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367951

4 years ago[Attributor][NFCI] Avoid duplication of the InformationCache reference
Johannes Doerfert [Mon, 5 Aug 2019 23:26:06 +0000 (23:26 +0000)]
[Attributor][NFCI] Avoid duplication of the InformationCache reference

Summary:
Instead of storing the reference to the InformationCache we now pass it
whenever it might be needed.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367950

4 years ago[OpenMP] Add support for GOMP_*_nonmonotonic_* functions
Jonathan Peyton [Mon, 5 Aug 2019 23:23:52 +0000 (23:23 +0000)]
[OpenMP] Add support for GOMP_*_nonmonotonic_* functions

Patch by Isuru Fernando

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

llvm-svn: 367949

4 years ago[Attributor] Deduce the "no-return" attribute for functions
Johannes Doerfert [Mon, 5 Aug 2019 23:22:05 +0000 (23:22 +0000)]
[Attributor] Deduce the "no-return" attribute for functions

A function is "no-return" if we never reach a return instruction, either
because there are none or the ones that exist are dead.

Test have been adjusted:
  - either noreturn was added, or
  - noreturn was avoided by modifying the code.

The new noreturn_{sync,async} test make sure we do handle invoke
instructions with a noreturn (and potentially nowunwind) callee
correctly, even in the presence of potential asynchronous exceptions.

llvm-svn: 367948

4 years ago[Sema] attempt to appease buildbots after r367940
George Burgess IV [Mon, 5 Aug 2019 23:19:15 +0000 (23:19 +0000)]
[Sema] attempt to appease buildbots after r367940

A buildbot got angry about this new test, with error messages like:

warn-nullchar-nullptr.c Line 16: use of undeclared identifier 'u'

It looks like this `u'c'` syntax was introduced in C11; I'm guessing
some bots may default to something before that. Let's see if explicitly
specifying the standard version makes it happy...

llvm-svn: 367947

4 years ago[CompilerType] Remove an unused function.
Davide Italiano [Mon, 5 Aug 2019 23:18:00 +0000 (23:18 +0000)]
[CompilerType] Remove an unused function.

Summary:
This simplifies the interface, as I'm trying to understand how
we can upstream swift support.

<rdar://problem/36377967>

Reviewers: teemperor, JDevlieghere, xiaobai, compnerd, friss

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 367946

4 years ago[GlobalISel][CallLowering] Rename isArgumentHandler() -> isIncomingArgumentHandler()
Amara Emerson [Mon, 5 Aug 2019 23:05:28 +0000 (23:05 +0000)]
[GlobalISel][CallLowering] Rename isArgumentHandler() -> isIncomingArgumentHandler()

Previous name and comment incorrectly implied it was just for formal arg handlers,
which is not true.

llvm-svn: 367945

4 years ago[ORC] Add CPU name and sub-target features to detectHost
Diego Caballero [Mon, 5 Aug 2019 23:02:12 +0000 (23:02 +0000)]
[ORC] Add CPU name and sub-target features to detectHost

This commit adds host CPU name and sub-target features to the
`JITTargetMachineBuilder` created by `JITTargetMachineBuilder::detectHost()`.

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

llvm-svn: 367944

4 years agoBuild libfuzzer libcxx-static with PIC
Yi Kong [Mon, 5 Aug 2019 22:55:17 +0000 (22:55 +0000)]
Build libfuzzer libcxx-static with PIC

r356153 changed default build option of static libcxx to no PIC. We now
need to explicitly specify CMAKE_POSITION_INDEPENDENT_CODE to get PIC
libcxx.

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

llvm-svn: 367943

4 years ago[llvm-readelf] Support dumping of stack sizes sections with readelf --stack-sizes
Wolfgang Pieb [Mon, 5 Aug 2019 22:47:07 +0000 (22:47 +0000)]
[llvm-readelf] Support dumping of stack sizes sections with readelf --stack-sizes

Reviewers: jhenderson, grimar, rupprecht

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

llvm-svn: 367942

4 years agoAdd a note to the release not about a potentially breaking optimization
Philip Reames [Mon, 5 Aug 2019 22:34:59 +0000 (22:34 +0000)]
Add a note to the release not about a potentially breaking optimization

This has come up twice already (once in pr42763 and once in the commit thread), so give warning of a new way in which UB can result in unexpected program behavior.

llvm-svn: 367941

4 years ago[Sema] Add -Wpointer-compare
George Burgess IV [Mon, 5 Aug 2019 22:15:40 +0000 (22:15 +0000)]
[Sema] Add -Wpointer-compare

This patch adds a warning that diagnoses comparisons of pointers to
'\0'. This is often indicative of a bug (e.g. the user might've
forgotten to dereference the pointer).

Patch by Elaina Guan!

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

llvm-svn: 367940

4 years ago[OpenMP] Fix broken build due to new OMPT tests
Hansang Bae [Mon, 5 Aug 2019 21:46:13 +0000 (21:46 +0000)]
[OpenMP] Fix broken build due to new OMPT tests

New OMPT tests with teams construct should be disabled for GCC as it
emits code with a GOMP entry not supported in the LLVM runtime.

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

llvm-svn: 367939

4 years agohwasan: Untag global variable addresses in tests.
Peter Collingbourne [Mon, 5 Aug 2019 21:46:10 +0000 (21:46 +0000)]
hwasan: Untag global variable addresses in tests.

Once we start instrumenting globals, all addresses including those of string literals
that we pass to the operating system will start being tagged. Since we can't rely
on the operating system to be able to cope with these addresses, we need to untag
them before passing them to the operating system. This change introduces a macro
that does so and uses it everywhere it is needed.

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

llvm-svn: 367938

4 years agoAdd "REQUIRES: x86-registered-target" to test.
Peter Collingbourne [Mon, 5 Aug 2019 21:44:45 +0000 (21:44 +0000)]
Add "REQUIRES: x86-registered-target" to test.

llvm-svn: 367937

4 years ago[lldb][NFC] Document and refactor ClangPersistentVariables::RemovePersistentVariable
Raphael Isemann [Mon, 5 Aug 2019 21:43:53 +0000 (21:43 +0000)]
[lldb][NFC] Document and refactor ClangPersistentVariables::RemovePersistentVariable

llvm-svn: 367936

4 years ago[WebAssembly] Fix conflict between ret legalization and sjlj
Keno Fischer [Mon, 5 Aug 2019 21:36:09 +0000 (21:36 +0000)]
[WebAssembly] Fix conflict between ret legalization and sjlj

Summary:
When the WebAssembly backend encounters a return type that doesn't
fit within i32, SelectionDAG performs sret demotion, adding an
additional argument to the start of the function that contains
a pointer to an sret buffer to use instead. However, this conflicts
with the emscripten sjlj lowering pass. There we translate calls like:

```
call {i32, i32} @foo()
```

into (in pseudo-llvm)
```
%addr = @foo
call {i32, i32} @__invoke_{i32,i32}(%addr)
```

i.e. we perform an indirect call through an extra function.
However, the sret transform now transforms this into
the equivalent of
```
        %addr = @foo
        %sret = alloca {i32, i32}
        call {i32, i32} @__invoke_{i32,i32}(%sret, %addr)
```
(while simultaneously translation the implementation of @foo as well).
Unfortunately, this doesn't work out. The __invoke_ ABI expected
the function address to be the first argument, causing crashes.

There is several possible ways to fix this:
1. Implementing the sret rewrite at the IR level as well and performing
   it as part of lowering to __invoke
2. Fixing the wasm backend to recognize that __invoke has a special ABI
3. A change to the binaryen/emscripten ABI to recognize this situation

This revision implements the middle option, teaching the backend to
treat __invoke_ functions specially in sret lowering. This is achieved
by
1) Introducing a new CallingConv ID for invoke functions
2) When this CallingConv ID is seen in the backend and the first argument
   is marked as sret (a function pointer would never be marked as sret),
   swapping the first two arguments.

Reviewed By: tlively, aheejin
Differential Revision: https://reviews.llvm.org/D65463

llvm-svn: 367935

4 years ago[Attributor][Fix] Do not remove instructions during manifestation
Johannes Doerfert [Mon, 5 Aug 2019 21:35:02 +0000 (21:35 +0000)]
[Attributor][Fix] Do not remove instructions during manifestation

When we remove instructions cached references could still be live. This
patch avoids removing invoke instructions that are replaced by calls and
instead keeps them around but in a dead block.

llvm-svn: 367933

4 years agoRevert Register/MCRegister: Add conversion operators to avoid use of implicit convert...
Daniel Sanders [Mon, 5 Aug 2019 21:34:45 +0000 (21:34 +0000)]
Revert Register/MCRegister: Add conversion operators to avoid use of implicit convert to unsigned. NFC

MSVC finds ambiguity where clang doesn't and it looks like it's not going to be an easy fix
Reverting while I figure out how to fix it

This reverts r367916 (git commit aa15ec3c231717826e3c262b5ef9813d2fb5cadb)
This reverts r367920 (git commit 5d14efe279b5db9f4746ff834ab5c70e249d3871)

llvm-svn: 367932

4 years ago[Attributor][Fix] Keep invokes if handlers catch asynchronous exceptions
Johannes Doerfert [Mon, 5 Aug 2019 21:34:45 +0000 (21:34 +0000)]
[Attributor][Fix] Keep invokes if handlers catch asynchronous exceptions

Similar to other places where we transform invokes to calls we need to
be careful if the handler (=personality) can catch asynchronous
exceptions as they are not modeled as part of nounwind.

This is tested with D59978.

llvm-svn: 367931

4 years ago[libc++] Accept any non-zero return for .fail.cpp tests
Louis Dionne [Mon, 5 Aug 2019 21:26:50 +0000 (21:26 +0000)]
[libc++] Accept any non-zero return for .fail.cpp tests

llvm-svn: 367930

4 years agoBMI2 support is indicated in bit eight of EBX, not nine.
Eric Christopher [Mon, 5 Aug 2019 21:25:59 +0000 (21:25 +0000)]
BMI2 support is indicated in bit eight of EBX, not nine.
See Intel SDM, Vol 2A, Table 3-8:
https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf#page=296

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

llvm-svn: 367929

4 years ago[NFC][pstl] Remove stray semi-colon
Louis Dionne [Mon, 5 Aug 2019 21:20:42 +0000 (21:20 +0000)]
[NFC][pstl] Remove stray semi-colon

llvm-svn: 367928

4 years agollvm-symbolizer: Untag addresses in object files by default.
Peter Collingbourne [Mon, 5 Aug 2019 20:59:25 +0000 (20:59 +0000)]
llvm-symbolizer: Untag addresses in object files by default.

Any addresses that we pass to llvm-symbolizer are going to be untagged,
while any HWASAN instrumented globals are going to be tagged in the
symbol table. Therefore we need to untag the addresses before using them.

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

llvm-svn: 367926

4 years ago[Sanitizer] Linux refactor shadow huge page mode handling
David Carlier [Mon, 5 Aug 2019 20:54:36 +0000 (20:54 +0000)]
[Sanitizer] Linux refactor shadow huge page mode handling

Disabling Transparent huge page mode refactored in one function.

Reviewers: vitalybuka

Reviewed By: vitalybuka

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

llvm-svn: 367925

4 years ago[lldb][NFC] Refactor ClangUserExpression::UpdateLanguageForExpr
Raphael Isemann [Mon, 5 Aug 2019 20:31:47 +0000 (20:31 +0000)]
[lldb][NFC] Refactor ClangUserExpression::UpdateLanguageForExpr

The UpdateLanguageForExpr should only update the language, but over
time it started to do also do different things related to the generation
of the expression source code. This patch refactors all the source code
generation part into its own function.

llvm-svn: 367922

4 years ago[ORC] Work around broken GCC/libstdc++ by adding an explicit conversion.
Lang Hames [Mon, 5 Aug 2019 20:30:35 +0000 (20:30 +0000)]
[ORC] Work around broken GCC/libstdc++ by adding an explicit conversion.

This should fix the bots that have been failing due to r367712.

llvm-svn: 367921