Commit Graph

343612 Commits

Author SHA1 Message Date
Sanjay Patel e0568ef2c5 [VectorCombine] add tests for possible extract->shuffle; NFC 2020-02-25 08:41:59 -05:00
Sanjay Patel 10ea01d80d [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
2020-02-25 08:41:59 -05:00
Florian Hahn b8d638d337 [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.
2020-02-25 13:31:46 +00:00
Stephan Herhut 5e6d724633 [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
2020-02-25 14:22:50 +01:00
Alex Zinenko 305320b005 [mlir] NFC: move AffineOps tests from test/ to test/Dialect
AffineOps dialect lives under lib/Dialect/AffineOps and so should its
tests.
2020-02-25 14:20:40 +01:00
Jeremy Morse 0a3b083791 [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
2020-02-25 13:15:07 +00:00
Raphael Isemann bdb24faa2a [lldb][NFC] Move filling namespace map in ClangASTSource to own function 2020-02-25 13:59:21 +01:00
Raphael Isemann 93b6e19240 [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).
2020-02-25 13:20:54 +01:00
Nico Weber 3950093951 [gn build] (manually) merge fee41517fe 2020-02-25 07:19:49 -05:00
whitequark 60a2db5986 Remove myself from CODE_OWNERS. 2020-02-25 11:59:29 +00:00
Raphael Isemann 2ad7b6fba0 [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.
2020-02-25 12:45:00 +01:00
Raphael Isemann defd0e24aa [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.
2020-02-25 12:25:36 +01:00
Kadir Cetinkaya 555d5ad85a
[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
2020-02-25 12:15:15 +01:00
Hans Wennborg 4486aa03c5 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
2020-02-25 12:14:07 +01:00
Stephan Herhut e4e122aa1d [MLIR][GPU] Fix forward declaration of Region class.
I forward declared mlir::Region as a struct by mistake :(
2020-02-25 12:09:42 +01:00
Andrzej Warzynski cff90c938b [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
2020-02-25 11:09:01 +00:00
Raphael Isemann fc0d11c904 [lldb][NFC] Modernize logging in ClangASTSource/ExpressionDeclMap 2020-02-25 12:08:09 +01:00
Alex Zinenko 5f9b543e8e [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
2020-02-25 11:59:04 +01:00
Alex Zinenko 3a1b34ff69 [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
2020-02-25 11:59:04 +01:00
Alex Zinenko 00d4814f49 [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
2020-02-25 11:59:04 +01:00
Hans Wennborg decd021fac Don't generate libcalls for wide shift on Windows ARM (PR42711)
The previous patch (cff90f07cb) didn't
cover ARM.
2020-02-25 11:54:07 +01:00
Stephan Herhut 7a7eacc797 [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
2020-02-25 11:42:42 +01:00
Georgii Rymar 157b3d505f [yaml2obj] - Address post commit comments for D74764
It removes a stale comment and fixes the comment in the test
and section names related accordingly.
2020-02-25 13:26:46 +03:00
Cullen Rhodes 72848f26b4 [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
2020-02-25 10:24:06 +00:00
Kristóf Umann 9fd7ce7f44 [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
2020-02-25 11:17:32 +01:00
Igor Kudrin bd2df13ee0 [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
2020-02-25 17:10:29 +07:00
Hans Wennborg dcd89b3de6 Add llvm-cov to LLVM_TOOLCHAIN_TOOLS
See https://github.com/llvm/llvm-project/issues/141
2020-02-25 10:59:55 +01:00
Calixte Denizet 62c7d84026 [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
2020-02-25 10:54:52 +01:00
Jay Foad ccee390767 GlobalISel: NFC minor cleanup to avoid a couple of fixed size local arrays 2020-02-25 09:49:19 +00:00
Jay Foad dc78190811 AMDGPU/GlobalISel: add legalize tests for s64 max/min 2020-02-25 09:49:19 +00:00
Jan Vesely 814fb658ca 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
2020-02-25 04:43:14 -05:00
Raphael Isemann 05d174d301 [lldb][NFC] Move namespace lookup in ClangASTSource to own function.
Beside being cleaner we can probably reuse that logic elsewhere.
2020-02-25 10:27:47 +01:00
Kang Zhang 27c89ced81 [NFC][PowerPC] Add a new test case scalar_cmp.ll 2020-02-25 09:19:27 +00:00
Pavel Labath eefbff0082 [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.
2020-02-25 10:04:09 +01:00
Raphael Isemann ea6b95dc2f [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
2020-02-25 09:48:17 +01:00
Alex Brachet 29e2cb8749 [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
2020-02-25 03:46:09 -05:00
Craig Topper 89ba4acad6 [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.
2020-02-24 23:56:34 -08:00
Craig Topper 9238dfb4d8 [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.
2020-02-24 23:56:28 -08:00
Nathan James 6a0c066c61 [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
2020-02-25 07:51:20 +00:00
Nathan James 3e9a7b2ba4 [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
2020-02-25 07:50:34 +00:00
Raphael Isemann 55d4b0d7dd [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
2020-02-25 08:46:37 +01:00
Pavel Labath c08a1c7071 [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.
2020-02-25 08:29:41 +01:00
Jim Lin 84c3d3f37a [Sparc][NFC] Remove trailing space 2020-02-25 14:38:58 +08:00
Jonas Devlieghere 35a0614535 [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
2020-02-24 21:25:55 -08:00
Hideto Ueno 2c0edbf19c [Attributor] Use AssumptionCache in AANonNullFloating::initialize 2020-02-25 13:00:03 +09:00
Matt Arsenault 1612d38241 GlobalISel: Remove unneeded initialiation
Removes implicit unsigned->Register conversion.
2020-02-24 22:42:53 -05:00
Matt Arsenault fee41517fe 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.
2020-02-24 22:12:12 -05:00
Jason Molenda 4fdd2edbdb 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 edc4f4c9c9.
2020-02-24 19:03:22 -08:00
Jason Molenda d5a4fa0514 Revert "My prevous commit to RegisterContextLLDB is causing a test fail"
This reverts commit 082f1a3b15.
2020-02-24 19:03:22 -08:00
Roman Tereshin b3bce6a3dd [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
2020-02-24 19:01:21 -08:00