Commit Graph

343582 Commits

Author SHA1 Message Date
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
Bill Wendling
50cac24877 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
2020-02-24 18:51:29 -08:00
Bill Wendling
23c2a5ce33 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
2020-02-24 18:29:06 -08:00
Sourabh Singh Tomar
226bddce45 [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
2020-02-25 07:56:48 +05:30
Matt Arsenault
0b46b078b6 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.
2020-02-24 21:20:35 -05:00
Matt Arsenault
11e3dde625 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.
2020-02-24 21:19:47 -05:00
Nathan James
5522e8296f [NFC] Cleaned up ASTMatchersInternal Code 2020-02-25 01:47:51 +00:00
Eli Friedman
248eaff823 [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
2020-02-24 17:19:35 -08:00
Jason Molenda
082f1a3b15 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.
2020-02-24 17:19:06 -08:00
Eli Friedman
888b12b270 [polly] Don't count scops in a global variable.
This can cause issues with thread safety.

Differential Revision: https://reviews.llvm.org/D75089
2020-02-24 17:12:08 -08:00
Frank Laub
fe210a1ff2 [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
2020-02-24 16:54:21 -08:00
Joerg Sonnenberger
4e45ef4d77 Prefer PATH_MAX to MAXPATHLEN
The former is part of POSIX and requires less heavy headers. They are
practically functionally equivalent.
2020-02-25 01:37:29 +01:00
Joerg Sonnenberger
03dd205c15 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.
2020-02-25 01:36:43 +01:00
Shoaib Meenai
e34ddc09f4 [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
2020-02-24 16:20:36 -08:00
Shoaib Meenai
915e769924 [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
2020-02-24 16:20:25 -08:00
Jason Molenda
edc4f4c9c9 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>
2020-02-24 16:11:15 -08:00
Nathan James
e6f9cb025c [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
2020-02-25 00:00:39 +00:00
Jonas Devlieghere
841be9854c [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
2020-02-24 15:40:31 -08:00
Craig Topper
a5fa778882 [LegalizeTypes] Scalarize non-byte sized loads in WidenRecRes_Load and SplitVecResLoad
Should fix PR42803 and PR44902

Differential Revision: https://reviews.llvm.org/D74590
2020-02-24 15:14:33 -08:00
Jay Foad
0ed4744bb5 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
2020-02-24 23:08:14 +00:00
Alex Brachet
0368997402 [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
2020-02-24 17:53:43 -05:00
Med Ismail Bennani
eefda18227 [lldb/Plugins] Move SBTarget::GetExtendedCrashInformation to SBProcess
This patch moves the SB API method GetExtendedCrashInformation from
SBTarget to SBProcess since it only makes sense to call this method on a
sane process which might not be the case on a SBTarget object.

It also addresses some feedbacks received after landing the first patch
for the 'crash-info' feature.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-02-24 23:37:04 +01:00
zoecarver
6980782572 Revert "Validate argument passed to __builtin_frame_address and __builtin_return_address"
This reverts commit c93112dc4f.
2020-02-24 14:35:02 -08:00
Bardia Mahjour
cf9dae122e [NFC] [DA] Refactoring getIndexExpressionsFromGEP
Summary:
This patch moves the getIndexExpressionsFromGEP function from polly
into ScalarEvolution so that both polly and DependenceAnalysis can
use it for the purpose of subscript delinearization when the array
sizes are not parametric.

Authored By: bmahjour

Reviewer: Meinersbur, sebpop, fhahn, dmgreen, grosser, etiotto, bollu

Reviewed By: Meinersbur

Subscribers: hiraditya, arphaman, Whitney, ppc-slack, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73995
2020-02-24 17:32:30 -05:00
zoecarver
c93112dc4f Validate argument passed to __builtin_frame_address and __builtin_return_address
Verifies that the argument passed to __builtin_frame_address and __builtin_return_address is within the range [0, 0xFFFF].
2020-02-24 14:23:41 -08:00
Greg Clayton
df8dda67ed Add methods to data extractor for extracting bytes and fixed length C strings.
Summary:
These modificaitons will be used in D74883.

Fixed length C strings can have trailing NULLs or sometimes spaces (BSD archive files), so the fixed length C string defaults to stripping trailing NULLs, but can have the arguments specify to remove one or more kinds of spaces if needed. This is used to extract fixed length C strings from ELF NOTEs in D74883.

Reviewers: labath, dblaikie, aprantl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74991
2020-02-24 14:17:43 -08:00
Jonas Devlieghere
7f9f027c62 [lldb/Test] Update TestDisassemblyFormat for new format 2020-02-24 14:08:16 -08:00
Ikhlas Ajbar
820df6e679 [Hexagon] Lower vector predicate store
This patch lowers store of vector predicate of type v128i1.
2020-02-24 15:43:04 -06:00
Eric Astor
95291a0e34 Reland "[ms] [llvm-ml] Improve data support, adding names and complex initializers."
This reverts commit 9fe769a961, and re-lands commit c2e272f8cf.

Summary: Add support for ?, DUP, and string initializers, as well as MASM syntax for named data locations.

This version avoids the use of a C++17-only feature, if-statements with initializer.

Reviewers: rnk, thakis

Reviewed By: thakis

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73226
2020-02-24 16:40:25 -05:00
Roman Tereshin
6f87b162e6 [MachineVerifier] Doing ::calcRegsPassed in RPO: ~35% faster MV, NFC
Depending on the target, test suite, pipeline config and perhaps other
factors machine verifier when forced on with -verify-machineinstrs can
increase compile time 2-2.5 times over (Release, Asserts On), taking up
~60% of the time. An invaluable tool, it significantly slows down
machine verifier-enabled testing.

Nearly 75% of its time MachineVerifier spends in the calcRegsPassed
method. It's a classic forward dataflow analysis executed over sets, but
visiting MBBs in arbitrary order. We switch that to RPO here.

This speeds up MachineVerifier by about 35%, decreasing the overall
compile time with -verify-machineinstrs by 20-25% or so.

calcRegsPassed itself gets 2x faster here.

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

Reviewers: bogner, stoklund, rudkx, qcolombet

Reviewed By: bogner

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75032
2020-02-24 13:30:01 -08:00
Ikhlas Ajbar
a8a4f99afb [Hexagon] Lower bitcast of a vector predicate
This patch lowers bitcast of vector predicate of type v32i1/v64i1
to i32/i64 type.
2020-02-24 15:25:51 -06:00