Commit Graph

386633 Commits

Author SHA1 Message Date
Chris Lattner f0c22c3d58 [Verifier] Tidy up the code a bit, NFC.
This tidies up the code a bit:
 * Eliminate the ctx member, which doesn't need to be stored.
 * Rename verify(Operation) to make it more clear that it is
   doing more than verifyOperation and that the dominance check
   isn't being done multiple times.
 * Rename mayNotHaveTerminator which was confusing about whether
   it wasn't known whether it had a terminator, when it is really
   about whether it is legal to have a terminator.
 * Some minor optimizations: don't check for RegionKindInterface
   if there are no regions.  Don't do two passes over the
   operations in a block in OperationVerifier::verifyDominance when
   one will do.

The optimizations are actually a measurable (but minor) win in some
CIRCT cases.

Differential Revision: https://reviews.llvm.org/D101267
2021-04-26 11:54:02 -07:00
Chris Lattner abd860eaef Remove obsolete using declaration that was just kept around to help with API adoption.
Differential Revision: https://reviews.llvm.org/D101269
2021-04-26 11:53:24 -07:00
Alex Lorenz 6cc62043c8 [clang][driver] Use the provided arch name for a Darwin target triple
This ensures that the Darwin driver uses a consistent target triple
representation when the triple is printed out to the user.

Differential Revision: https://reviews.llvm.org/D100807
2021-04-26 11:31:50 -07:00
Joseph Huber 077fe0f739 [OpenMP][Documentation] Add FAQ entry for dynamically linked libraries
Summary:
Add an FAW entry detailing the support for using dynamically linked libraries
with OpenMP Offloading
2021-04-26 14:21:17 -04:00
Tim Renouf 1128311a19 [AMDGPU][llvm-objdump] Fix memory leak in recent commit
Hopefully stops sanitizer fail in AMDGPU llvm-objdump test.

Change-Id: I7331151d1cb65292bd06b6ae283349fe7231cf6b
2021-04-26 18:50:21 +01:00
Stephen Kelly 50b523cb2c [AST] Fix DeclarationNameInfo introspection
Some AST classes return `const DeclarationNameInfo &` instead of
returning by value (eg CXXDependentScopeMemberExpr).
2021-04-26 18:49:13 +01:00
Moritz Sichert 10038d0b3d [RuntimeDyld] Fixed buffer overflows with absolute symbols
Differential Revision: https://reviews.llvm.org/D95596
2021-04-26 19:24:03 +02:00
Jin Lin cedfa38fc4 Preserve the lexical order for global variables during llvm-link merge
The order of global variables is generated in the order of recursively materializing variables if the global variable has the attribute of hasLocalLinkage or hasLinkOnceLinkage during the module merging. In practice, it is often the exact reverse of source order. This new order may cause performance regression.

The change is to preserve the original lexical order for global variables.

Reviewed By: jdoerfert, dexonsmith

Differential Revision: https://reviews.llvm.org/D94202
2021-04-26 10:11:34 -07:00
Sebastian Neubauer 9579af2bd7 [AMDGPU] Fix autogenerated wwm-reserved-spill.ll
Due to a bug in update_llc_test_checks.py, the test is wrongly
coalesced between run lines. Remove common check prefix to fix that.
NFC.
2021-04-26 19:09:09 +02:00
Wael Yehia 91db11c98d XFAIL thinlto testcases on AIX
In D100350, we switched off thinLTO on the AIX OS. So, XFAIL tests that
invoke clang with -flto=thin on AIX.
2021-04-26 17:02:06 +00:00
Raphael Isemann a0c735e29a [lldb] Skip TestPointerToMemberTypeDependingOnParentSize on Windows and GCC
The test added in D100977 is failing to compile on these platforms. This seems
to be caused by GCC, MSVC and Clang@Windows rejecting the code because
`ToLayout` isn't complete when pointer_to_member_member is declared (even though
that seems to be valid code).

This also reverts the test changes in the lazy-loading test from D100977 as
that failed for the same reason.
2021-04-26 18:55:54 +02:00
William S. Moses 494e77138c [Lexer] Allow LLLexer to be used as an API
Explose LLVM Lexer for usage externally as an API

Differential Revision: https://reviews.llvm.org/D100920
2021-04-26 12:43:14 -04:00
Frederik Gossen 88b8b88035 [MLIR] Remove empty shape operands from `cstr_broadcastable` ops
Differential Revision: https://reviews.llvm.org/D101170
2021-04-26 18:34:18 +02:00
Jonas Devlieghere 7d850db6b6 [lldb] Don't use ::fork or ::vfork on watchOS or tvOS
Update lldb-server to not use fork or vfork on watchOS and tvOS as these
functions are explicitly marked unavailable there.

llvm-project/lldb/test/API/tools/lldb-server/main.cpp:304:11:
error: 'fork' is unavailable: not available on watchOS
      if (fork() == 0)
          ^
WatchSimulator6.2.sdk/usr/include/unistd.h:447:8: note: 'fork' has been
explicitly marked unavailable here
pid_t    fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
llvm-project/lldb/test/API/tools/lldb-server/main.cpp:307:11:
error: 'vfork' is unavailable: not available on watchOS
      if (vfork() == 0)
          ^
WatchSimulator6.2.sdk/usr/include/unistd.h:602:8: note: 'vfork' has been
explicitly marked unavailable here
pid_t    vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
2021-04-26 09:31:35 -07:00
Peter Steinfeld f9c0859e96 [flang] Check for attributes specific to dummy arguments
We were not checking that attributes that are supposed to be specific to
dummy arguments were not being used for local entities.  I added the checks
along with tests for them.

After implementing these new checks, I found that one of the tests in
separate-mp02.f90 was erroneous, and I fixed it.

Differential Revision: https://reviews.llvm.org/D101126
2021-04-26 09:27:55 -07:00
Alexey Bader b2bb13a761 [Doc] Add SYCLSupport.rst to index toctree. 2021-04-26 16:16:10 +03:00
Wenlei He b2d079379b [CSSPGO] Explicitly disallow Binary and Compact Binary profile format for CSSPGO
CSSPGO only supports text and extended binary profile now. Raw binary does not have the metadata section CSSPGO needs, and Compact binary profile needs special handling for GUID based context names, which is not yet implemented.

Disasslow these two format for CSSPGO profile writing to avoid silently generating invalid profiles.

Differential Revision: https://reviews.llvm.org/D101300
2021-04-26 09:10:24 -07:00
Michael Kruse 153144be40 [SimplifyCFG] Preserve metadata when unconditionalizing branches (constant condition).
When replacing a conditional branch by an unconditional one because the condition is a constant, transfer the metadata to the new branch instruction.

Part of fix for llvm.org/PR50060

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D101141
2021-04-26 10:57:31 -05:00
Frederik Gossen 858d4885dc [MLIR][Shape] Ensure to preserve op type of `shape.broadcast`
Ensure to preserve the correct type during when folding and canonicalization.
`shape.broadcast` of of a single operand can only be folded away if the argument
type is correct.

Differential Revision: https://reviews.llvm.org/D101158
2021-04-26 17:55:39 +02:00
Mark de Wever 18b03b0085 [libc++][NFC] Remove non-ASCII from comment.
Seems our check-generated-output doesn't work as intended. Will
investigate it further.
2021-04-26 17:53:20 +02:00
Sebastian Neubauer fcc40d9c17 [AMDGPU] Use MapVector for WWMReservedRegs
Use MapVector instead of SmallDenseMap because it has a deterministic
iteration order.

Differential Revision: https://reviews.llvm.org/D101299
2021-04-26 17:43:00 +02:00
OCHyams 40df6bac9c [dexter] Update failing regression test
Commit 7deb970ef added REQUIRES and UNSUPPORTED lines to a test which is
sensitive to line number changes. Update the line number reference in the test.
2021-04-26 16:41:35 +01:00
Alexey Bader b52e69c426 [SYCL][Doc] Add design document for SYCL mode
Initial version of the document covers address space handling

Differential Revision: https://reviews.llvm.org/D99488
2021-04-26 15:39:43 +03:00
Simon Pilgrim a0677ff5eb [X86] Rename multiclass ATOMIC_LOAD_BINOP -> ATOMIC_RMW_BINOP. NFCI.
Noticed while triaging the rG2149aa73f640c96 regressions - the LXADD ops are load+store RMW instructions, not just loads.
2021-04-26 15:17:30 +01:00
Greg McGary c2419aae76 [lld-macho] Add option --error-limit=N
Add option to limit (or remove limits) on the number of errors printed before exiting. This option exists in the other lld ports: COFF & ELF.

Differential Revision: https://reviews.llvm.org/D101274
2021-04-26 07:10:12 -07:00
Dávid Bolvanský 942d2e19e1 Revert "Only ignore -Wdeprecated-copy if the used compiler supports the warning"
This reverts commit b125c034af.

Some bots say " missing binary operator before token "(" "
2021-04-26 16:09:02 +02:00
Nigel Perks e7b6c0f398 [clang][XCore] Define __xcore__ for XCore target.
The headers shipped with the XMOS XCore compiler expect __xcore__ to be defined.
The __XS1B__ macro, already defined, is for the default subtarget.

No other targets affected.
2021-04-26 15:06:04 +01:00
Paul C. Anagnostopoulos ff0ddd5ce4 [TableGen] Remove a TODO comment that is no longer relevant [NFC] 2021-04-26 10:03:12 -04:00
Dávid Bolvanský b125c034af Only ignore -Wdeprecated-copy if the used compiler supports the warning
This is needed after
  https://reviews.llvm.org/rG9658d045926545e62cc3f963fe611d7c5d0c9d98
which introduced code that at least didn't compile clean with clang 8.

Reviewed By: xbolva00

Differential Revision: https://reviews.llvm.org/D101288
2021-04-26 16:00:54 +02:00
Paul C. Anagnostopoulos 2d4c4d3c54 [TableGen] Change assertion information from a tuple to a struct [NFC]
Differential Revision: https://reviews.llvm.org/D100854
2021-04-26 09:57:16 -04:00
Alexey Bader 7818906ca1 [SYCL] Implement SYCL address space attributes handling
Default address space (applies when no explicit address space was
specified) maps to generic (4) address space.

Added SYCL named address spaces `sycl_global`, `sycl_local` and
`sycl_private` defined as sub-sets of the default address space.

Static variables without address space now reside in global address
space when compile for SPIR target, unless they have an explicit address
space qualifier in source code.

Differential Revision: https://reviews.llvm.org/D89909
2021-04-26 13:44:10 +03:00
Dávid Bolvanský 691badc3d6 [InstCombine] C - ctpop(a) - > ctpop(~a)) if C is bitwidth (PR50104)
Proof: https://alive2.llvm.org/ce/z/mncA9K
Solves https://bugs.llvm.org/show_bug.cgi?id=50104

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D101257
2021-04-26 15:40:54 +02:00
Tim Northover 8705399d01 AArch64: support atomics in GISel 2021-04-26 14:38:06 +01:00
Emre Kultursay e439a463a3 [lldb] Use forward type in pointer-to-member
This change is similar in spirit to the change at:
https://reviews.llvm.org/rG34c697c85e9d0af11a72ac4df5578aac94a627b3

It fixes the problem where the layout of a type was being accessed
while its base classes were not populated yet; which caused an
incorrect layout to be produced and cached.

This fixes PR50054

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D100977
2021-04-26 15:23:58 +02:00
Tim Renouf 18adf4bb0d [AMDGPU][llvm-objdump] Add lit.local.cfg missing from recent commit
Stops llvm-objdump tests failing when AMDGPU target is not supported.

Change-Id: Ic4ae443958c41c303ff6bee0966e5f21ab7a1851
2021-04-26 14:07:04 +01:00
Tim Renouf 8710eff6c3 [MC][AMDGPU][llvm-objdump] Synthesized local labels in disassembly
1. Add an accessor function to MCSymbolizer to retrieve addresses
   referenced by a symbolizable operand, but not resolved to a symbol.
   That way, the caller can synthesize labels at those addresses and
   then retry disassembling the section.

2. Implement that in AMDGPU -- a failed symbol lookup results in the
   address being added to a vector returned by the new function.

3. Use that in llvm-objdump when using MCSymbolizer (which only happens
   on AMDGPU) and SymbolizeOperands is on.

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

Change-Id: I19087c3bbfece64bad5a56ee88bcc9110d83989e
2021-04-26 13:56:36 +01:00
Sanjay Patel 9e8cde590f [IndVars] avoid 'tmp' names in test file with auto-generated CHECK lines; NFC
The script warns that this could be buggy when updating.
2021-04-26 08:32:25 -04:00
Yuanbo Li cc7803ee3f [LSR][DebugInfo] Don't unnecessarily drop DebugLocs
When transforming a loop terminating condition into a "max" comparison,
the DebugLoc from the old condition should be set on the newly created
comparison. They are the same operation, just optimized. Fixes PR48067.

Differential Revision: https://reviews.llvm.org/D98218
2021-04-26 13:14:42 +01:00
Bradley Smith 2040d20df2 [AArch64][SVE] Add missing patterns for scalar versions of SQSHL/UQSHL
Differential Revision: https://reviews.llvm.org/D101058
2021-04-26 13:07:12 +01:00
Dávid Bolvanský 819d35e6e9 [InstCombine] Added testcases for PR50104, NFC 2021-04-26 14:00:30 +02:00
David Green 94c7bd7eb2 [ARM] Expand VMOVRRD simplification pattern
This expands the VMOVRRD(extract(..(build_vector(a, b, c, d)))) pattern,
to also handle insert_vectors. Providing we can find the correct insert,
this helps further simplify patterns by removing the redundant VMOVRRD.

Differential Revision: https://reviews.llvm.org/D100245
2021-04-26 12:27:38 +01:00
David Green b1a919d51c [ARM] Additional soft float BE test. NFC 2021-04-26 11:44:10 +01:00
David Sherwood cf7276820c [NFC] Add scalable vectorisation tests for int/FP <> int/FP conversions
We can already vectorize loops that involve int<>int, fp<>fp, int<>fp
and fp<>int conversions, however we didn't previously have any tests
for them. This patch adds some tests for each conversion type.

Differential Revision: https://reviews.llvm.org/D99951
2021-04-26 11:01:14 +01:00
David Sherwood a458b7855e [AArch64] Add AArch64TTIImpl::getMaskedMemoryOpCost function
When vectorising for AArch64 targets if you specify the SVE attribute
we automatically then treat masked loads and stores as legal. Also,
since we have no cost model for masked memory ops we believe it's
cheap to use the masked load/store intrinsics even for fixed width
vectors. This can lead to poor code quality as the intrinsics will
currently be scalarised in the backend. This patch adds a basic
cost model that marks fixed-width masked memory ops as significantly
more expensive than for scalable vectors.

Tests for the cost model are added here:

  Transforms/LoopVectorize/AArch64/masked-op-cost.ll

Differential Revision: https://reviews.llvm.org/D100745
2021-04-26 11:00:03 +01:00
Florian Hahn 7302fe4328
[VPlan] Make blocksOnly work properly with ranges over const pointers.
When iterating over const blocks, the base type in the lambdas needs
to use const VPBlockBase *, otherwise it cannot be used with input
iterators over const VPBlockBase.

Also adjust the type of the input iterator range to const &, as it
does not take ownership of the input range.
2021-04-26 10:52:35 +01:00
Andrzej Warzynski 499f1ed548 [flang][driver] Fine-tune `-fdebug-dump-symbols`
When generating output for `-fdebug-dump-symbols`, make sure that
BuildRuntimeDerivedTypeTables is also run. This change is needed in
order to make the implementation of `-fdebug-dump-symbols` in
`flang-new` consistent with `f18`. It also allows us to port more tests
to use the new driver whenever it is enabled.

Differential Revision: https://reviews.llvm.org/D100649
2021-04-26 09:20:50 +00:00
Jeremy Morse 3c9bcf0e35 [Clang][Coroutine][DebugInfo] Relax test ordering requirement
The test added in D97533 (and modified by this patch) has some overly
strict printed metadata ordering requirements, specifically the
interleaving of DILocalVariable nodes and DILocation nodes. Slight changes
in metadata emission can easily break this unfortunately.

This patch stops after clang codegen rather than allowing the coro splitter
to run,  and reduces the need for ordering: it picks out the
DILocalVariable nodes being sought, in any order (CHECK-DAG), and doesn't
examine any DILocations. The implicit CHECK-NOT is what's important: the
test seeks to ensure a duplicate set of DILocalVariables aren't emitted in
the same scope.

Differential Revision: https://reviews.llvm.org/D100298
2021-04-26 10:07:22 +01:00
Krasimir Georgiev 5987d7c59d [clang-format] fix indent in alignChainedConditionals
Clang-format was indenting the lines following the `?` in the added test
case by +5 instead of +4. This only happens in a very specific
situation, where the `?` is followed by a multiline block comment, as in
the example. This fix addresses this without regressing any of the
existing tests.

Differential Revision: https://reviews.llvm.org/D101033
2021-04-26 11:06:29 +02:00
David Green 258e2e9a0b [ARM] Ensure loop invariant active.lane.mask operands
CGP can move instructions like a ptrtoint into a loop, but the
MVETailPredication when converting them will currently assume invariant
trip counts. This tries to ensure the operands are loop invariant, and
bails if not.

Differential Revision: https://reviews.llvm.org/D100550
2021-04-26 10:04:33 +01:00
Hsiangkai Wang 16dc9afa09 [RISCV] Add REQUIRES: riscv-registered-target for RISC-V test cases. 2021-04-26 17:02:27 +08:00