platform/upstream/llvm.git
4 years ago[libc++] Proper fix for libc++'s modulemap after D68480
Louis Dionne [Mon, 24 Feb 2020 23:12:44 +0000 (18:12 -0500)]
[libc++] Proper fix for libc++'s modulemap after D68480

Summary:
In libc++, we normally #ifdef out header content instead of #erroring
out when the Standard in use is insufficient for the requirements of
the header.

Reviewers: EricWF

Subscribers: jkorous, dexonsmith, libcxx-commits, teemperor

Tags: #libc

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

4 years agoAMDGPU/GlobalISel: Use packed for G_ADD/G_SUB/G_MUL v2s16
Matt Arsenault [Tue, 18 Feb 2020 03:10:27 +0000 (22:10 -0500)]
AMDGPU/GlobalISel: Use packed for G_ADD/G_SUB/G_MUL v2s16

4 years ago[remark][diagnostics] [codegen] Fix PR44896
Rong Xu [Tue, 25 Feb 2020 16:04:01 +0000 (08:04 -0800)]
[remark][diagnostics] [codegen] Fix PR44896

This patch fixes PR44896. For IR input files, option fdiscard-value-names
should be ignored as we need named values in loadModule().
Commit 60d3947922 sets this option after loadModule() where valued names
already created. This creates an inconsistent state in setNameImpl()
that leads to a seg fault.
This patch forces fdiscard-value-names to be false for IR input files.

This patch also emits a warning of "ignoring -fdiscard-value-names" if
option fdiscard-value-names is explictly enabled in the commandline for
IR input files.

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

4 years ago[Sema][C++] Propagate conversion kind to specialize the diagnostics
Anastasia Stulova [Tue, 25 Feb 2020 14:49:59 +0000 (14:49 +0000)]
[Sema][C++] Propagate conversion kind to specialize the diagnostics

Compute and propagate conversion kind to diagnostics helper in C++
to provide more specific diagnostics about incorrect implicit
conversions in assignments, initializations, params, etc...

Duplicated some diagnostics as errors because C++ is more strict.

Tags: #clang

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

4 years agoMake builtbot happy.
Haojian Wu [Tue, 25 Feb 2020 16:02:08 +0000 (17:02 +0100)]
Make builtbot happy.

Disable the failing rename test, it should not be failed, needs further
investigation.

4 years agoAMDGPU/GlobalISel: Legalize s64 min/max by lowering
Jay Foad [Tue, 25 Feb 2020 10:31:37 +0000 (10:31 +0000)]
AMDGPU/GlobalISel: Legalize s64 min/max by lowering

Reviewers: arsenm, rampitec

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

Tags: #llvm

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

4 years ago[ELF] Support archive:file syntax in input section descriptions
Fangrui Song [Tue, 25 Feb 2020 05:52:47 +0000 (21:52 -0800)]
[ELF] Support archive:file syntax in input section descriptions

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

https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html#Input-Section-Basics
The following two rules are not implemented.

* `archive:` matches every file in the archive.
* `:file` matches a file not in an archive.

Reviewed By: grimar, ruiu

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

4 years ago[clang-rename] Add the USR of incomplete decl to the USRSet.
Haojian Wu [Tue, 25 Feb 2020 15:32:22 +0000 (16:32 +0100)]
[clang-rename] Add the USR of incomplete decl to the USRSet.

Summary:
This fixes a clangd rename issue, which is missing the reference of
an incomplete specialization.

Unfortunately, I didn't reproduce this issue in clang-rename, I guess
the input `FoundDecl` of AdditionalUSRFinder is different in clangd vs
clang-rename, clang-rename uses the underlying CXXRecordDecl of the
ClassTemplateDecl, which is fixed in https://github.com/llvm/llvm-project/commit/5d862c042b52ae2aad37471d0b83b6c678a520e3;
while clangd-rename uses the ClassTemplateDecl.

Reviewers: kbobyrev

Reviewed By: kbobyrev

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

Tags: #clang

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

4 years ago[analyzer] Add support for CXXInheritedCtorInitExpr.
Artem Dergachev [Mon, 17 Feb 2020 18:42:50 +0000 (21:42 +0300)]
[analyzer] Add support for CXXInheritedCtorInitExpr.

So far we've been dropping coverage every time we've encountered
a CXXInheritedCtorInitExpr. This patch attempts to add some
initial support for it.

Constructors for arguments of a CXXInheritedCtorInitExpr are still
not fully supported.

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

4 years ago[DWARFDebugLine] Avoid dumping prologue members we did not parse
Pavel Labath [Mon, 24 Feb 2020 12:32:31 +0000 (13:32 +0100)]
[DWARFDebugLine] Avoid dumping prologue members we did not parse

Summary:
This patch if motivated by D74560, specifically the subthread about what
to print upon encountering reserved initial length values.

If the debug_line prologue has an unsupported version, we skip parsing
the rest of the data. If we encounter an reserved initial length field,
we don't even parse the version. However, we still print out all members
(with value 0) in the dump function.

This patch introduces early exits in the Prologue::dump function so that
we print only the fields that were parsed successfully. In case of an
unsupported version, we skip printing all subsequent prologue fields --
because we don't even know if this version has those fields. In case of a
reserved unit length, we don't print anything -- if the very first field
of the prologue is invalid, it's hard to say if we even have a prologue
to begin with.

Note that the user will still be able to see the invalid/reserved
initial length value in the error message. I've modified (reordered)
debug_line_invalid.test to show that the error message comes straight
after the debug_line offset. I've also added some flush() calls to the
dumping code to ensure this is the case in all situations (without that,
the warnings could get out of sync if the output was not a terminal -- I
guess this is why std::iostreams have the tie() function).

Reviewers: jhenderson, ikudrin, dblaikie

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[LLDB] Let DataExtractor deal with two-byte addresses
Ayke van Laethem [Tue, 4 Feb 2020 15:29:01 +0000 (16:29 +0100)]
[LLDB] Let DataExtractor deal with two-byte addresses

AVR usually uses two byte addresses. By making DataExtractor deal with
this, it is possible to load AVR binaries that don't have debug info
associated with them.

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

4 years ago[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): fix miscompile (PR44802)
Roman Lebedev [Tue, 25 Feb 2020 14:24:27 +0000 (17:24 +0300)]
[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): fix miscompile (PR44802)

Much like with reassociateShiftAmtsOfTwoSameDirectionShifts(),
as input, we have the following pattern:
  icmp eq/ne (and ((x shift Q), (y oppositeshift K))), 0
We want to rewrite that as:
  icmp eq/ne (and (x shift (Q+K)), y), 0  iff (Q+K) u< bitwidth(x)

While we know that originally (Q+K) would not overflow
(because  2 * (N-1) u<= iN -1), we may have looked past extensions of
shift amounts. so it may now overflow in smaller bitwidth.

To ensure that does not happen, we need to ensure that the total maximal
shift amount is still representable in that smaller bitwidth.
If the overflow would happen, (Q+K) u< bitwidth(x) check would be bogus.

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

4 years ago[NFC][InstCombine] Add shift amount reassociation in bittest miscompile example from...
Roman Lebedev [Tue, 25 Feb 2020 14:14:43 +0000 (17:14 +0300)]
[NFC][InstCombine] Add shift amount reassociation in bittest miscompile example from PR44802

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

4 years ago[InstCombine] reassociateShiftAmtsOfTwoSameDirectionShifts(): fix miscompile (PR44802)
Roman Lebedev [Tue, 25 Feb 2020 13:48:36 +0000 (16:48 +0300)]
[InstCombine] reassociateShiftAmtsOfTwoSameDirectionShifts(): fix miscompile (PR44802)

As input, we have the following pattern:
  Sh0 (Sh1 X, Q), K
We want to rewrite that as:
  Sh x, (Q+K)  iff (Q+K) u< bitwidth(x)
While we know that originally (Q+K) would not overflow
(because  2 * (N-1) u<= iN -1), we may have looked past extensions of
shift amounts. so it may now overflow in smaller bitwidth.

To ensure that does not happen, we need to ensure that the total maximal
shift amount is still representable in that smaller bitwidth.
If the overflow would happen, (Q+K) u< bitwidth(x) check would be bogus.

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

4 years ago[NFC][InstCombine] Add shift amount reassociation miscompile example from PR44802
Roman Lebedev [Tue, 25 Feb 2020 13:06:13 +0000 (16:06 +0300)]
[NFC][InstCombine] Add shift amount reassociation miscompile example from PR44802

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

4 years agoMake test not write to the source directory
Benjamin Kramer [Tue, 25 Feb 2020 15:03:06 +0000 (16:03 +0100)]
Make test not write to the source directory

4 years ago[AMDGPU] Precommit some test updates for D68338 "Remove dubious logic in bidirectiona...
Jay Foad [Tue, 25 Feb 2020 14:38:57 +0000 (14:38 +0000)]
[AMDGPU] Precommit some test updates for D68338 "Remove dubious logic in bidirectional list scheduler"

4 years agoclang-cl: Add a `/showIncludes:user` flag.
Nico Weber [Mon, 24 Feb 2020 21:07:16 +0000 (16:07 -0500)]
clang-cl: Add a `/showIncludes:user` flag.

This flag is like /showIncludes, but it only includes user headers and
omits system headers (similar to MD and MMD). The motivation is that
projects that already track system includes though other means can use
this flag to get consistent behavior on Windows and non-Windows, and it
saves tools that output /showIncludes output (e.g. ninja) some work.

implementation-wise, this makes `HeaderIncludesCallback` honor the
existing `IncludeSystemHeaders` bit, and changes the three clients of
`HeaderIncludesCallback` (`/showIncludes`, `-H`, `CC_PRINT_HEADERS=1`)
to pass `-sys-header-deps` to set that bit -- except for
`/showIncludes:user`, which doesn't pass it.

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

4 years ago[analyzer][MallocChecker][NFC] Change the use of IdentifierInfo* to CallDescription
Kristóf Umann [Fri, 20 Sep 2019 09:01:45 +0000 (11:01 +0200)]
[analyzer][MallocChecker][NFC] Change the use of IdentifierInfo* to CallDescription

Exactly what it says on the tin! I decided not to merge this with the patch that
changes all these to a CallDescriptionMap object, so the patch is that much more
trivial.

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

4 years ago[clangd] Migrate Lexer usages in TypeHierarchy to TokenBuffers
Kadir Cetinkaya [Wed, 19 Feb 2020 18:11:01 +0000 (19:11 +0100)]
[clangd] Migrate Lexer usages in TypeHierarchy to TokenBuffers

Summary:
Also fixes a bug, resulting from directly using ND.getEndLoc() for end
location of the range. As ND.getEndLoc() points to the begining of the last
token, whereas it should point one past the end, since LSP ranges are half open
(exclusive on the end).

Reviewers: sammccall

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

Tags: #clang

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

4 years agoStop including sys/param.h from Unix.h
Joerg Sonnenberger [Tue, 25 Feb 2020 14:22:18 +0000 (15:22 +0100)]
Stop including sys/param.h from Unix.h

4 years ago[OpenMP][cmake] ignore warning on unknown CUDA version
Kelvin Li [Mon, 24 Feb 2020 21:11:05 +0000 (16:11 -0500)]
[OpenMP][cmake] ignore warning on unknown CUDA version

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

4 years ago[clang-format] Wrap lines for C# property accessors
Jonathan Coe [Tue, 25 Feb 2020 13:59:52 +0000 (13:59 +0000)]
[clang-format]  Wrap lines for C# property accessors

Summary: Ensure that auto-implemented properties `{ get; private set }` are wrapped on to one line for C# code.

Reviewers: MyDeveloperDay, krasimir

Reviewed By: MyDeveloperDay, krasimir

Subscribers: cfe-commits

Tags: #clang-format, #clang

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

4 years agoFix DfaEmitter::visitDfaState() crash in MSVC x86 debug builds (PR44945)
Hans Wennborg [Tue, 25 Feb 2020 14:15:25 +0000 (15:15 +0100)]
Fix DfaEmitter::visitDfaState() crash in MSVC x86 debug builds (PR44945)

No functionality change (intended), but this seems to make the code a
bit clearer for the compiler and maybe for human readers too.

4 years ago[RISCV] Fix sysroot tests without GCC on RISC-V hosts with GCC
Luís Marques [Tue, 25 Feb 2020 14:15:16 +0000 (14:15 +0000)]
[RISCV] Fix sysroot tests without GCC on RISC-V hosts with GCC

D68391 added tests that check scenarios where no RISC-V GCC toolchain is
supposed to be detected. When running the tests on RISC-V hosts the system's
GCC toolchain will be detected, and the tests will fail. This patch adds a
`--gcc-toolchain` option pointing to a path where no GCC toolchain is
present, ensuring that the tests are run under the expected conditions, and
therefore are able to pass in all test environments.

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

4 years ago[mlir] NFC: update documentation in ConvertLinalgToLLVM
Alex Zinenko [Tue, 25 Feb 2020 14:14:59 +0000 (15:14 +0100)]
[mlir] NFC: update documentation in ConvertLinalgToLLVM

The documentation was describing an obsolete version of the
transformation.

4 years ago[CodeGen] fix clang test that runs the optimizer pipeline; NFC
Sanjay Patel [Tue, 25 Feb 2020 14:12:12 +0000 (09:12 -0500)]
[CodeGen] fix clang test that runs the optimizer pipeline; NFC

There's already a FIXME note on this file; it can break when the
underlying LLVM behavior changes independently of anything in clang.

4 years ago[PhaseOrdering] add test for missing vector/CSE transforms (PR45015); NFC
Sanjay Patel [Tue, 25 Feb 2020 13:54:58 +0000 (08:54 -0500)]
[PhaseOrdering] add test for missing vector/CSE transforms (PR45015); NFC

4 years ago[Analyzer] Fix for iterator modeling and checkers: handle negative numbers correctly
Adam Balogh [Tue, 18 Feb 2020 10:22:08 +0000 (11:22 +0100)]
[Analyzer] Fix for iterator modeling and checkers: handle negative numbers correctly

Currently, using negative numbers in iterator operations (additions and
subractions) results in advancements with huge positive numbers due to
an error. This patch fixes it.

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

4 years ago[ASTImporter] Improved variable template redecl chain handling.
Balázs Kéri [Tue, 25 Feb 2020 13:47:38 +0000 (14:47 +0100)]
[ASTImporter] Improved variable template redecl chain handling.

Reviewers: martong, a.sidorin, shafik

Reviewed By: martong

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

Tags: #clang

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

4 years ago[VectorCombine] add tests for possible extract->shuffle; NFC
Sanjay Patel [Mon, 24 Feb 2020 22:16:57 +0000 (17:16 -0500)]
[VectorCombine] add tests for possible extract->shuffle; NFC

4 years ago[VectorCombine] make cost calc consistent for binops and cmps
Sanjay Patel [Mon, 24 Feb 2020 22:05:44 +0000 (17:05 -0500)]
[VectorCombine] make cost calc consistent for binops and cmps

Code duplication (subsequently removed by refactoring) allowed
a logic discrepancy to creep in here.

We were being conservative about creating a vector binop -- but
not a vector cmp -- in the case where a vector op has the same
estimated cost as the scalar op. We want to be more aggressive
here because that can allow other combines based on reduced
instruction count/uses.

We can reverse the transform in DAGCombiner (potentially with a
more accurate cost model) if this causes regressions.

AFAIK, this does not conflict with InstCombine. We have a
scalarize transform there, but it relies on finding a constant
operand or a matching insertelement, so that means it eliminates
an extractelement from the sequence (so we won't have 2 extracts
by the time we get here if InstCombine succeeds).

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

4 years ago[DSE,MSSA] Do not attempt to remove un-removable memdefs.
Florian Hahn [Tue, 25 Feb 2020 13:27:22 +0000 (13:27 +0000)]
[DSE,MSSA] Do not attempt to remove un-removable memdefs.

We have to skip MemoryDefs that cannot be removed. This fixes a crash in
the newly added test case and fixes a wrong case in
memset-and-memcpy.ll.

4 years ago[MLIR][GPU] Properly model step in parallel loop to gpu conversion.
Stephan Herhut [Mon, 24 Feb 2020 15:02:50 +0000 (16:02 +0100)]
[MLIR][GPU] Properly model step in parallel loop to gpu conversion.

Summary:
The original patch had TODOs to add support for step computations,
which this commit addresses. The computations are expressed using
affine expressions so that the affine canonicalizers can simplify
the full bound and index computations.

Also cleans up the code a little and exposes the pass in the
header file.

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

4 years ago[mlir] NFC: move AffineOps tests from test/ to test/Dialect
Alex Zinenko [Tue, 25 Feb 2020 13:18:12 +0000 (14:18 +0100)]
[mlir] NFC: move AffineOps tests from test/ to test/Dialect

AffineOps dialect lives under lib/Dialect/AffineOps and so should its
tests.

4 years ago[debuginfo-tests] Warn, not error, if we can't delete working directory
Jeremy Morse [Tue, 25 Feb 2020 13:12:13 +0000 (13:12 +0000)]
[debuginfo-tests] Warn, not error, if we can't delete working directory

On Windows, an error running the debugger typically leaves a process
hanging around in the working directory. When Dexter exits, it can't then
delete the working directory and produces an exception, masking the problem
in the debugger. (This can be worked around by specifying --save-temps).
Rather than hard-erroring, print a warning when we can't delete the working
directory instead.

It'd be much better to improve our error handling, and make the
WorkingDirectory class aware that something's wrong when it enters exit.
However, this is something that's going to mask genuine errors and make
everyones lives harder right now, so I think this non-ideal fix is
important to get in first.

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

4 years ago[lldb][NFC] Move filling namespace map in ClangASTSource to own function
Raphael Isemann [Tue, 25 Feb 2020 12:43:11 +0000 (13:43 +0100)]
[lldb][NFC] Move filling namespace map in ClangASTSource to own function

4 years ago[lldb] Initialize NameSearchContext::m_namespace_map in constructor
Raphael Isemann [Tue, 25 Feb 2020 12:11:28 +0000 (13:11 +0100)]
[lldb] Initialize NameSearchContext::m_namespace_map in constructor

This member is for some reason initialized in ClangASTSource::FindExternalVisibleDecls
so all other functions using this member dereference a nullptr unless we
call this function before that. Let's just initialize this in the constructor.

This should be NFC as the only side effect is that we don't reset the namespace map
when calling ClangASTSource::FindExternalVisibleDecls multiple times (and we never
call this function multiple times for one NameSearchContext from what I can see).

4 years ago[gn build] (manually) merge fee41517fe0f
Nico Weber [Tue, 25 Feb 2020 12:19:49 +0000 (07:19 -0500)]
[gn build] (manually) merge fee41517fe0f

4 years agoRemove myself from CODE_OWNERS.
whitequark [Tue, 25 Feb 2020 11:59:29 +0000 (11:59 +0000)]
Remove myself from CODE_OWNERS.

4 years ago[lldb][NFC] Make NameSearchContext::m_found members bools instead of bitfields
Raphael Isemann [Tue, 25 Feb 2020 11:28:48 +0000 (12:28 +0100)]
[lldb][NFC] Make NameSearchContext::m_found members bools instead of bitfields

The size of NameSearchContext isn't important as we never store it and rarely
allocate more than a few. This way we also don't have to use the memset to
initialize these fields to zero.

4 years ago[lldb][NFC] Move NameSearchContext to own header/source files
Raphael Isemann [Tue, 25 Feb 2020 11:05:46 +0000 (12:05 +0100)]
[lldb][NFC] Move NameSearchContext to own header/source files

The class is large enough to be in its own file. This patch also removes the cyclic
dependency between ClangASTSource <-> NameSearchContext.

4 years ago[clangd] Disable ExtractVariable for C
Kadir Cetinkaya [Mon, 24 Feb 2020 15:38:57 +0000 (16:38 +0100)]
[clangd] Disable ExtractVariable for C

Summary:
Currently extract variable doesn't spell the type explicitly and just
uses an `auto` instead, which is not available in C.

Reviewers: usaxena95

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

Tags: #clang

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

4 years agobuild_llvm_package.bat: Produce zip files in addition to the installers
Hans Wennborg [Tue, 25 Feb 2020 11:13:09 +0000 (12:13 +0100)]
build_llvm_package.bat: Produce zip files in addition to the installers

Now that the Windows installer no longer does anything besides
self-extract, maybe it would make sense to distribute the toolchain as a
plain zip file in addition to the current installer.

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

4 years ago[MLIR][GPU] Fix forward declaration of Region class.
Stephan Herhut [Tue, 25 Feb 2020 11:05:30 +0000 (12:05 +0100)]
[MLIR][GPU] Fix forward declaration of Region class.

I forward declared mlir::Region as a struct by mistake :(

4 years ago[AArch64][SVE] Update names and comments for gathers/scatters (NFC)
Andrzej Warzynski [Wed, 19 Feb 2020 12:25:30 +0000 (12:25 +0000)]
[AArch64][SVE] Update names and comments for gathers/scatters (NFC)

Summary:
This patch renames functions and TableGen classes for SVE gathers and
scatters. The original names implied that the corresponding
methods/classes are only suited for regular gathers/scatters (i.e. LD1
and ST1), which is not the case. Indeed, we will be re-using them for
non-temporal and first-faulting gathers/scatters in the forthcoming
patches. The new names also highlight the split into Vector-Scalar (VS)
and Scalar-Vector (SV) cases.

List of changes:
* `performLD1GatherCombine` and `performST1ScatterCombine` are renamed
  as `performGatherLoadCombine` and `performScatterStoreCombine`,
  respectively.
* Selection DAG types for scatters and gathers from
  AArch64SVEInstrInfo.td are renamed. For example, `SDT_AArch64_GLD1` is
  renamed as `SDT_AArch64_GATHER_SV`. SV stands for Scalar-Vector, as
  opposed to Vector-Scalar (VS).
* The intrinsic classes from IntrinsicsAArch64.td are renamed. For
  example, `AdvSIMD_GatherLoad_64bitOffset_Intrinsic` is renamed as
  `AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic`.
* Updated comments in `performGatherLoadCombine` and
  `performScatterStoreCombine`.

Reviewers: sdesmalen, rengolin, efriedma

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[lldb][NFC] Modernize logging in ClangASTSource/ExpressionDeclMap
Raphael Isemann [Tue, 25 Feb 2020 10:49:36 +0000 (11:49 +0100)]
[lldb][NFC] Modernize logging in ClangASTSource/ExpressionDeclMap

4 years ago[mlir] simplify affine maps and operands in affine.min/max
Alex Zinenko [Mon, 24 Feb 2020 16:43:01 +0000 (17:43 +0100)]
[mlir] simplify affine maps and operands in affine.min/max

Affine dialect already has a map+operand simplification infrastructure in
place. Plug the recently added affine.min/max operations into this
infrastructure and add a simple test. More complex behavior of the simplifier
is already tested by other ops.

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

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

4 years ago[mlir] Intrinsics generator: use TableGen-defined builder function
Alex Zinenko [Fri, 21 Feb 2020 13:46:14 +0000 (14:46 +0100)]
[mlir] Intrinsics generator: use TableGen-defined builder function

Originally, intrinsics generator for the LLVM dialect has been producing
customized code fragments for the translation of MLIR operations to LLVM IR
intrinsics. LLVM dialect ODS now provides a generalized version of the
translation code, parameterizable with the properties of the operation.
Generate ODS that uses this version of the translation code instead of
generating a new version of it for each intrinsic.

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

4 years ago[mlir] Generalize intrinsic builders in the LLVM dialect definition
Alex Zinenko [Fri, 21 Feb 2020 13:45:51 +0000 (14:45 +0100)]
[mlir] Generalize intrinsic builders in the LLVM dialect definition

All LLVM IR intrinsics are constructed in a similar way. The ODS definition of
the LLVM dialect in MLIR also lists multiple intrinsics, many of which
reproduce the same (or similar enough) code stanza to translate the MLIR
operation into the LLVM IR intrinsic. Provide a single base class containing
parameterizable code to build LLVM IR intrinsics given their name and the lists
of overloadable operands and results. Use this class to remove (almost)
duplicate translations for intrinsics defined in LLVMOps.td.

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

4 years agoDon't generate libcalls for wide shift on Windows ARM (PR42711)
Hans Wennborg [Tue, 25 Feb 2020 10:50:03 +0000 (11:50 +0100)]
Don't generate libcalls for wide shift on Windows ARM (PR42711)

The previous patch (cff90f07cb5cc3c3bc58277926103af31caef308) didn't
cover ARM.

4 years ago[MLIR][GPU] Implement a simple greedy loop mapper.
Stephan Herhut [Fri, 21 Feb 2020 15:18:22 +0000 (16:18 +0100)]
[MLIR][GPU] Implement a simple greedy loop mapper.

Summary:
The mapper assigns annotations to loop.parallel operations that
are compatible with the loop to gpu mapping pass. The outermost
loop uses the grid dimensions, followed by block dimensions. All
remaining loops are mapped to sequential loops.

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

4 years ago[yaml2obj] - Address post commit comments for D74764
Georgii Rymar [Tue, 25 Feb 2020 10:20:08 +0000 (13:20 +0300)]
[yaml2obj] - Address post commit comments for D74764

It removes a stale comment and fixes the comment in the test
and section names related accordingly.

4 years ago[AArch64][SVE] Add predicate reinterpret intrinsics
Cullen Rhodes [Tue, 11 Feb 2020 22:43:45 +0000 (22:43 +0000)]
[AArch64][SVE] Add predicate reinterpret intrinsics

Summary:
Implements the following intrinsics:

    * llvm.aarch64.sve.convert.to.svbool
    * llvm.aarch64.sve.convert.from.svbool

For converting the ACLE svbool_t type (<n x 16 x i1>) to and from the
other predicate types: <n x 8 x i1>, <n x 4 x i1> and <n x 2 x i1>.

Reviewers: sdesmalen, kmclaughlin, efriedma, dancgr, rengolin

Reviewed By: sdesmalen, efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[analyzer][MallocChecker][NFC] Communicate the allocation family to auxiliary functio...
Kristóf Umann [Thu, 26 Sep 2019 11:36:29 +0000 (13:36 +0200)]
[analyzer][MallocChecker][NFC] Communicate the allocation family to auxiliary functions with parameters

The following series of refactoring patches aim to fix the horrible mess that MallocChecker.cpp is.

I genuinely hate this file. It goes completely against how most of the checkers
are implemented, its by far the biggest headache regarding checker dependencies,
checker options, or anything you can imagine. On top of all that, its just bad
code. Its seriously everything that you shouldn't do in C++, or any other
language really. Bad variable/class names, in/out parameters... Apologies, rant
over.

So: there are a variety of memory manipulating function this checker models. One
aspect of these functions is their AllocationFamily, which we use to distinguish
between allocation kinds, like using free() on an object allocated by operator
new. However, since we always know which function we're actually modeling, in
fact we know it compile time, there is no need to use tricks to retrieve this
information out of thin air n+1 function calls down the line. This patch changes
many methods of MallocChecker to take a non-optional AllocationFamily template
parameter (which also makes stack dumps a bit nicer!), and removes some no
longer needed auxiliary functions.

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

4 years ago[DebugInfo] Fix printing CIE offsets in EH FDEs.
Igor Kudrin [Thu, 13 Feb 2020 11:20:14 +0000 (18:20 +0700)]
[DebugInfo] Fix printing CIE offsets in EH FDEs.

While the value of the CIE pointer field in a DWARF FDE record is
an offset to the corresponding CIE record from the beginning of
the section, for EH FDE records it is relative to the current offset.
Previously, we did not make that distinction when dumped both kinds
of FDE records and just printed the same value for the CIE pointer
field and the CIE offset; that was acceptable for DWARF FDEs but was
wrong for EH FDEs.

This patch fixes the issue by explicitly printing the offset of the
linked CIE object.

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

4 years agoAdd llvm-cov to LLVM_TOOLCHAIN_TOOLS
Hans Wennborg [Tue, 25 Feb 2020 09:59:32 +0000 (10:59 +0100)]
Add llvm-cov to LLVM_TOOLCHAIN_TOOLS

See https://github.com/llvm/llvm-project/issues/141

4 years ago[profile] gcov_mutex must be static
Calixte Denizet [Mon, 24 Feb 2020 22:29:12 +0000 (23:29 +0100)]
[profile] gcov_mutex must be static

Summary: Forget static keyword for gcov_mutex in https://reviews.llvm.org/D74953 and that causes test failure on mac.

Reviewers: erik.pilkington, vsk

Reviewed By: vsk

Subscribers: vsk, dexonsmith, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years agoGlobalISel: NFC minor cleanup to avoid a couple of fixed size local arrays
Jay Foad [Tue, 25 Feb 2020 09:42:33 +0000 (09:42 +0000)]
GlobalISel: NFC minor cleanup to avoid a couple of fixed size local arrays

4 years agoAMDGPU/GlobalISel: add legalize tests for s64 max/min
Jay Foad [Mon, 24 Feb 2020 23:21:00 +0000 (23:21 +0000)]
AMDGPU/GlobalISel: add legalize tests for s64 max/min

4 years agolibclc: cmake configure should depend on file list
Jan Vesely [Sat, 15 Feb 2020 03:29:04 +0000 (22:29 -0500)]
libclc: cmake configure should depend on file list

This makes sure targets are rebuilt if a file is added or removed.
Reviewer: tstellar
Differential Revision: https://reviews.llvm.org/D74662

4 years ago[lldb][NFC] Move namespace lookup in ClangASTSource to own function.
Raphael Isemann [Tue, 25 Feb 2020 07:47:41 +0000 (08:47 +0100)]
[lldb][NFC] Move namespace lookup in ClangASTSource to own function.

Beside being cleaner we can probably reuse that logic elsewhere.

4 years ago[NFC][PowerPC] Add a new test case scalar_cmp.ll
Kang Zhang [Tue, 25 Feb 2020 09:19:27 +0000 (09:19 +0000)]
[NFC][PowerPC] Add a new test case scalar_cmp.ll

4 years ago[lldb] s/CHECK-NEXT/CHECK-DAG in dwp-debug-types.s
Pavel Labath [Tue, 25 Feb 2020 08:57:42 +0000 (09:57 +0100)]
[lldb] s/CHECK-NEXT/CHECK-DAG in dwp-debug-types.s

These can come out nondeterministically for two reasons:
- sorting based on ConstStringified pointer values
- different relative speeds of the indexing threads

Making these nondeterministic without incurring performance penalties is
hard, so I just make the test expect them in any order (the order is not
important in this test anyway.

4 years ago[lldb][NFC] Make ArrayRef initialization more obvious in lldb-test.cpp
Raphael Isemann [Tue, 25 Feb 2020 08:11:13 +0000 (09:11 +0100)]
[lldb][NFC] Make ArrayRef initialization more obvious in lldb-test.cpp

Seems like this code raised some alarm bells as it looks like an ArrayRef
to a temporary initializer list, but it's actually just calling the ArrayRef(T*, T*)
constructor. Let's clarify this and directly call the right ArrayRef constructor here.

Fixes rdar://problem/59176052

4 years ago[libc] [UnitTest] Give UnitTest gtest like colors
Alex Brachet [Tue, 25 Feb 2020 08:46:09 +0000 (03:46 -0500)]
[libc] [UnitTest] Give UnitTest gtest like colors

Summary:
This is a quality of life change to make it a little nicer to look at, NFC.
This patch makes the RUN and OK lines green and FAILED lines red to match gtest's output.

Reviewers: sivachandra, gchatelet, PaulkaToast

Reviewed By: gchatelet

Subscribers: MaskRay, tschuett, libc-commits

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

4 years ago[X86] Pass parameters into selectVectorAddr to remove dependency on X86MaskedGatherSc...
Craig Topper [Tue, 25 Feb 2020 07:17:48 +0000 (23:17 -0800)]
[X86] Pass parameters into selectVectorAddr to remove dependency on X86MaskedGatherScatterSDNode.

Might be able to get rid of X86ISD::SCATTER and some uses of
X86ISD::GATHER. Which require isel to use ISD::SCATTER and
ISD::GATHER as well.

4 years ago[X86] Remove mask output from X86 gather/scatter ISD opcodes.
Craig Topper [Tue, 25 Feb 2020 06:54:20 +0000 (22:54 -0800)]
[X86] Remove mask output from X86 gather/scatter ISD opcodes.

Instead add it when we make the machine nodes during instruction
selections.

This makes this ISD node closer to ISD::MGATHER. Trying to see
if we remove the X86 specific ones.

4 years ago[ASTMatchers] Adds a matcher called `hasAnyOperatorName`
Nathan James [Tue, 25 Feb 2020 07:51:07 +0000 (07:51 +0000)]
[ASTMatchers] Adds a matcher called `hasAnyOperatorName`

Summary:
Acts on `BinaryOperator` and `UnaryOperator` and functions the same as `anyOf(hasOperatorName(...), hasOperatorName(...), ...)`

Documentation generation isn't perfect but I feel that the python doc script needs updating for that

Reviewers: aaron.ballman, gribozavr2

Reviewed By: aaron.ballman, gribozavr2

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[ASTMatchers] Matcher macros with params move params instead of copying
Nathan James [Tue, 25 Feb 2020 02:07:45 +0000 (02:07 +0000)]
[ASTMatchers] Matcher macros with params move params instead of copying

Summary: Use move semantics instead of copying for AST Matchers with parameters

Reviewers: aaron.ballman, gribozavr2

Reviewed By: gribozavr2

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[lldb] Fix that a crashing test is marked as unsupported when it prints UNSUPPORTED...
Raphael Isemann [Tue, 25 Feb 2020 07:20:41 +0000 (08:20 +0100)]
[lldb] Fix that a crashing test is marked as unsupported when it prints UNSUPPORTED before crashing

Summary:
I added an `abort()` call to some code and noticed that the test suite was still passing and it just marked my test as "UNSUPPORTED".

It seems the reason for that is that we expect failing tests to print "FAIL:" which doesn't happen when we crash. If we then also
have an unsupported because we skipped some debug information in the output, we just mark the test passing because it is unsupported
on the current platform.

This patch marks any test that has a non-zero exit code as failing even if it doesn't print "FAIL:" (e.g., because it crashed).

Reviewers: labath, JDevlieghere

Reviewed By: labath, JDevlieghere

Subscribers: aprantl, lldb-commits

Tags: #lldb

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

4 years ago[lldb] Mark ObjectFileBreakpad test inputs as non-text
Pavel Labath [Tue, 25 Feb 2020 07:26:55 +0000 (08:26 +0100)]
[lldb] Mark ObjectFileBreakpad test inputs as non-text

These are technically text files, but the object file layer treats them
as binary, and the relevant tests verify the parsed contents byte for
byte. Git's crlf conversion can make those tests fail. Marking the files
as non-text disables that.

4 years ago[Sparc][NFC] Remove trailing space
Jim Lin [Tue, 25 Feb 2020 06:37:36 +0000 (14:37 +0800)]
[Sparc][NFC] Remove trailing space

4 years ago[lldb/Utility] Fix unspecified behavior.
Jonas Devlieghere [Tue, 25 Feb 2020 05:25:55 +0000 (21:25 -0800)]
[lldb/Utility] Fix unspecified behavior.

Order of evaluation of the operands of any C++ operator [...] is
unspecified. This patch fixes the issue in Stream::Indent by calling the
function consecutively.

On my Windows setup, TestSettings.py fails because the function prints
the value first, followed by the indentation.

Expected result:
  MY_FILE=this is a file name with spaces.txt

Actual result:
MY_FILE  =this is a file name with spaces.txt

4 years ago[Attributor] Use AssumptionCache in AANonNullFloating::initialize
Hideto Ueno [Tue, 25 Feb 2020 03:32:50 +0000 (12:32 +0900)]
[Attributor] Use AssumptionCache in AANonNullFloating::initialize

4 years agoGlobalISel: Remove unneeded initialiation
Matt Arsenault [Mon, 24 Feb 2020 18:22:51 +0000 (13:22 -0500)]
GlobalISel: Remove unneeded initialiation

Removes implicit unsigned->Register conversion.

4 years agoAMDGPU/GlobalISel: Introduce post-legalize combiner
Matt Arsenault [Mon, 17 Feb 2020 16:47:45 +0000 (11:47 -0500)]
AMDGPU/GlobalISel: Introduce post-legalize combiner

The current set of custom combines are only really useful after
legalization, so move them there. There is a lot of overlap in the
boilerplate here, but I think we do want a pretty different set of
combines before and after legalize. I think we will want a lot of
overlap between the post-legalize and a post-regbankselect combiner.

4 years agoRevert "Unwind past an interrupt handler correctly on arm or at pc==0"
Jason Molenda [Tue, 25 Feb 2020 03:01:51 +0000 (19:01 -0800)]
Revert "Unwind past an interrupt handler correctly on arm or at pc==0"

The aarcht64-ubuntu bot is showing a test failure in TestHandleAbort.py
with this patch.  Adding some logging to that file, it looks like
the saved register context above the trap handler does not have
save state for $pc, but it does have it for $lr on that platform.
I need to fall back to looking for $lr if the $pc cannot be retrieved.
I'll update the patch and re-commit once that's fixed.

This reverts commit edc4f4c9c9d90b2a4f8831ba4c873f08eaa5395a.

4 years agoRevert "My prevous commit to RegisterContextLLDB is causing a test fail"
Jason Molenda [Tue, 25 Feb 2020 03:01:12 +0000 (19:01 -0800)]
Revert "My prevous commit to RegisterContextLLDB is causing a test fail"

This reverts commit 082f1a3b15999c803265fabcb555ad253a00d477.

4 years ago[MachineVerifier] Doing ::calcRegsPassed over faster sets: ~15-20% faster MV, NFC
Roman Tereshin [Mon, 24 Feb 2020 05:53:53 +0000 (21:53 -0800)]
[MachineVerifier] Doing ::calcRegsPassed over faster sets: ~15-20% faster MV, NFC

MachineVerifier still takes 45-50% of total compile time with
-verify-machineinstrs, with calcRegsPassed dataflow taking ~50-60% of
MachineVerifier.

The majority of that time is spent in BBInfo::addPassed, mostly within
DenseSet implementing the sets the dataflow is operating over.

In particular, 1/4 of that DenseSet time is spent just iterating over it
(operator++), 40-50% on insertions, and most of the rest in ::count.

Given that, we're implementing custom sets just for this analysis here,
focusing on cheap insertions and O(n) iteration time (as opposed to
O(U), where U is the universe).

As it's based _mostly_ on BitVector for sparse and SmallVector for
dense, it may remotely resemble SparseSet. The difference is, our
solution is a lot less clever, doesn't have constant time `clear` that
we won't use anyway as reusing these sets across analyses is cumbersome,
and thus more space efficient and safer (got a resizable Universe and a
fallback to DenseSet for sparse if it gets too big).

With this patch MachineVerifier gets ~15-20% faster, its contribution to
total compile time drops from 45-50% to ~35%, while contribution of
calcRegsPassed to MachineVerifier drops from 50-60% to ~35% as well.

calcRegsPassed itself gets another 2x faster here.

All measured on a large suite of shaders targeting a number of GPUs.

Reviewers: bogner, stoklund, rudkx, qcolombet

Reviewed By: rudkx

Tags: #llvm

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

4 years agoSupport output constraints on "asm goto"
Bill Wendling [Tue, 25 Feb 2020 02:32:50 +0000 (18:32 -0800)]
Support output constraints on "asm goto"

Summary:
Clang's "asm goto" feature didn't initially support outputs constraints. That
was the same behavior as gcc's implementation. The decision by gcc not to
support outputs was based on a restriction in their IR regarding terminators.
LLVM doesn't restrict terminators from returning values (e.g. 'invoke'), so
it made sense to support this feature.

Output values are valid only on the 'fallthrough' path. If an output value's used
on an indirect branch, then it's 'poisoned'.

In theory, outputs *could* be valid on the 'indirect' paths, but it's very
difficult to guarantee that the original semantics would be retained. E.g.
because indirect labels could be used as data, we wouldn't be able to split
critical edges in situations where two 'callbr' instructions have the same
indirect label, because the indirect branch's destination would no longer be
the same.

Reviewers: jyknight, nickdesaulniers, hfinkel

Reviewed By: jyknight, nickdesaulniers

Subscribers: MaskRay, rsmith, hiraditya, llvm-commits, cfe-commits, craig.topper, rnk

Tags: #clang, #llvm

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

4 years agoAllow "callbr" to return non-void values
Bill Wendling [Tue, 25 Feb 2020 02:28:32 +0000 (18:28 -0800)]
Allow "callbr" to return non-void values

Summary:
Terminators in LLVM aren't prohibited from returning values. This means that
the "callbr" instruction, which is used for "asm goto", can support "asm goto
with outputs."

This patch removes all restrictions against "callbr" returning values. The
heavy lifting is done by the code generator. The "INLINEASM_BR" instruction's
a terminator, and the code generator doesn't allow non-terminator instructions
after a terminator. In order to correctly model the feature, we need to copy
outputs from "INLINEASM_BR" into virtual registers. Of course, those copies
aren't terminators.

To get around this issue, we split the block containing the "INLINEASM_BR"
right before the "COPY" instructions. This results in two cheats:

  - Any physical registers defined by "INLINEASM_BR" need to be marked as
    live-in into the block with the "COPY" instructions. This violates an
    assumption that physical registers aren't marked as "live-in" until after
    register allocation. But it seems as if the live-in information only
    needs to be correct after register allocation. So we're able to get away
    with this.

  - The indirect branches from the "INLINEASM_BR" are moved to the "COPY"
    block. This is to satisfy PHI nodes.

I've been told that MLIR can support this handily, but until we're able to
use it, we'll have to stick with the above.

Reviewers: jyknight, nickdesaulniers, hfinkel, MaskRay, lattner

Reviewed By: nickdesaulniers, MaskRay, lattner

Subscribers: rriddle, qcolombet, jdoerfert, MatzeB, echristo, MaskRay, xbolva00, aaron.ballman, cfe-commits, JonChesterfield, hiraditya, llvm-commits, rnk, craig.topper

Tags: #llvm, #clang

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

4 years ago[DebugInfo]: Refactored Macinfo section consumption part to allow future
Sourabh Singh Tomar [Mon, 24 Feb 2020 10:21:36 +0000 (15:51 +0530)]
[DebugInfo]: Refactored Macinfo section consumption part to allow future
macro section dumping.

Summary: Previously macinfo infrastructure was using functions
names that were ambiguous i.e `getMacro/getMacroDWO` in a sense
of conveying stated intentions. This patch refactored them into more
reasonable `getDebugMacinfo/getDebugMacinfoDWO` names thus making
room for macro implementation.

Reviewers: aprantl, probinson, jini.susan.george, dblaikie

Reviewed By: dblaikie

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

4 years agoAMDGPU/GlobalISel: Fix incorrect VOP3P fneg folding
Matt Arsenault [Wed, 19 Feb 2020 17:35:12 +0000 (12:35 -0500)]
AMDGPU/GlobalISel: Fix incorrect VOP3P fneg folding

We use some s32 values in VOP3P operands, and won't see any
intervening casts from a 32-bit fneg. Make sure it's really a packed
fneg before folding.

4 years agoGlobalISel: Reimplement fewerElementsVectorBasic
Matt Arsenault [Tue, 4 Feb 2020 14:24:01 +0000 (09:24 -0500)]
GlobalISel: Reimplement fewerElementsVectorBasic

Changes the handling of odd breakdowns, and avoids using
G_EXTRACT/G_INSERT. Pad with undef to a wider size, and unmerge. Also
avoid introducing instructions for the fully undef components.

4 years ago[NFC] Cleaned up ASTMatchersInternal Code
Nathan James [Tue, 25 Feb 2020 01:47:51 +0000 (01:47 +0000)]
[NFC] Cleaned up ASTMatchersInternal Code

4 years ago[AArch64] SVE implies fullfp16
Eli Friedman [Fri, 21 Feb 2020 23:05:41 +0000 (15:05 -0800)]
[AArch64] SVE implies fullfp16

This is explicitly guaranteed in ARMARM. And it makes reasoning about
vectors easier: we can assume that if a vector operation is legal, the
corresponding scalar operation is also legal.

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

4 years agoMy prevous commit to RegisterContextLLDB is causing a test fail
Jason Molenda [Tue, 25 Feb 2020 01:18:08 +0000 (17:18 -0800)]
My prevous commit to RegisterContextLLDB is causing a test fail
on aarch64-ubuntu - collect a little information about what
is happening on this target before I revert my change; I don't
have access to this target.

4 years ago[polly] Don't count scops in a global variable.
Eli Friedman [Mon, 24 Feb 2020 23:40:06 +0000 (15:40 -0800)]
[polly] Don't count scops in a global variable.

This can cause issues with thread safety.

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

4 years ago[MLIR] Add std.atomic_rmw op
Frank Laub [Tue, 25 Feb 2020 00:49:52 +0000 (16:49 -0800)]
[MLIR] Add std.atomic_rmw op

Summary:
The RFC for this op is here: https://llvm.discourse.group/t/rfc-add-std-atomic-rmw-op/489

The std.atmomic_rmw op provides a way to support read-modify-write
sequences with data race freedom. It is intended to be used in the lowering
of an upcoming affine.atomic_rmw op which can be used for reductions.

A lowering to LLVM is provided with 2 paths:
- Simple patterns: llvm.atomicrmw
- Everything else: llvm.cmpxchg

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

4 years agoPrefer PATH_MAX to MAXPATHLEN
Joerg Sonnenberger [Tue, 25 Feb 2020 00:37:29 +0000 (01:37 +0100)]
Prefer PATH_MAX to MAXPATHLEN

The former is part of POSIX and requires less heavy headers. They are
practically functionally equivalent.

4 years agoAdjust max_align_t handling
Joerg Sonnenberger [Tue, 4 Feb 2020 14:04:42 +0000 (15:04 +0100)]
Adjust max_align_t handling

Depend on the compiler to provide a correct implementation of
max_align_t. If __STDCPP_NEW_ALIGNMENT__ is missing and C++03 mode has
been explicitly enabled, provide a minimal fallback in <new> as
alignment of the largest primitive types.

4 years ago[arcconfig] Delete subproject arcconfigs
Shoaib Meenai [Fri, 21 Feb 2020 23:44:08 +0000 (15:44 -0800)]
[arcconfig] Delete subproject arcconfigs

From https://secure.phabricator.com/book/phabricator/article/arcanist_new_project/:

> An .arcconfig file is a JSON file which you check into your project's root.

I've done some experimentation, and it looks like the subproject
.arcconfigs just get ignored, as the documentation says. Given that
we're fully on the monorepo now, it's safe to remove them.

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

4 years ago[arcconfig] Default base to previous revision
Shoaib Meenai [Fri, 21 Feb 2020 19:59:53 +0000 (11:59 -0800)]
[arcconfig] Default base to previous revision

When you run `arc diff`, arc defaults to uploading all the changes you
have against the upstream branch into a single patch. This is almost
never what you want for stacked commits (patch series); you only want to
submit the changes done by the current patch. It's also come up as a
point of confusion in the Phabricator vs. GitHub PRs discussion, for
example. Configure arc to only upload your current patch by default,
which I think is a much more suitable default for LLVM developers.

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

4 years agoUnwind past an interrupt handler correctly on arm or at pc==0
Jason Molenda [Tue, 25 Feb 2020 00:05:01 +0000 (16:05 -0800)]
Unwind past an interrupt handler correctly on arm or at pc==0

Fix RegisterContextLLDB::InitializeNonZerothFrame so that it
will fetch a FullUnwindPlan instead of falling back to the
architectural default unwind plan -- GetFullUnwindPlan knows
how to spot a jmp 0x0 that results in a fault, which may be
the case when we see a trap handler on the stack.

Fix RegisterContextLLDB::SavedLocationForRegister so that when
the pc value is requested from a trap handler frame, where we
have a complete register context available to us, don't provide
the Return Address register (lr) instead of the pc.  We have
an actual pc value here, and it's pointing to the instruction
that faulted.

Differential revision: https://reviews.llvm.org/D75007
<rdar://problem/59416588>

4 years ago[docs] dump_ast_matchers strips internal::(Bindable)?Matcher from Result_type
Nathan James [Mon, 24 Feb 2020 23:59:45 +0000 (23:59 +0000)]
[docs] dump_ast_matchers strips internal::(Bindable)?Matcher from Result_type

Summary: Remove `internal::Matcher` and `internal::BindableMatcher` from Result Type when dumping AST Matchers

Reviewers: joerg, gribozavr2, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[lldb] Color the line marker
Jonas Devlieghere [Mon, 24 Feb 2020 23:34:58 +0000 (15:34 -0800)]
[lldb] Color the line marker

Highlight the color marker similar to what we do for the column marker.
The default color matches the color of the current PC marker (->) in the
default disassembly format.

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

4 years ago[LegalizeTypes] Scalarize non-byte sized loads in WidenRecRes_Load and SplitVecResLoad
Craig Topper [Mon, 24 Feb 2020 22:08:05 +0000 (14:08 -0800)]
[LegalizeTypes] Scalarize non-byte sized loads in WidenRecRes_Load and SplitVecResLoad

Should fix PR42803 and PR44902

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

4 years agoAMDGPU/GlobalISel: Lower 64-bit uaddo/usubo
Jay Foad [Fri, 24 Jan 2020 09:02:47 +0000 (09:02 +0000)]
AMDGPU/GlobalISel: Lower 64-bit uaddo/usubo

Summary: Add more test cases for signed and unsigned add/sub with overflow.

Reviewers: arsenm, rampitec, kerbowa

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

Tags: #llvm

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

4 years ago[libc] [UnitTest] Create death tests
Alex Brachet [Mon, 24 Feb 2020 22:53:43 +0000 (17:53 -0500)]
[libc] [UnitTest] Create death tests

Summary: This patch adds `EXPECT_EXITS` and `EXPECT_DEATH` macros for testing exit codes and deadly signals. They are less convoluted than their analogs in GTEST and don't have matchers but just take an int for either the exit code or the signal respectively. Nor do they have any regex match against the stdout/stderr of the child process.

Reviewers: sivachandra, gchatelet

Reviewed By: sivachandra

Subscribers: mgorny, MaskRay, tschuett, libc-commits

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