Commit Graph

419971 Commits

Author SHA1 Message Date
Louis Dionne 13796495ec [libc++] Fix std::is_array<T[0]> and add tests
Differential Revision: https://reviews.llvm.org/D122810
2022-04-04 13:55:18 -04:00
Aaron Ballman 5d90004874 Require C99 for these tests; NFC intended
The tests are doing -verify and testing a diagnostic behavior, but that
behavior is changing. This ensures the tests continue to run and check
the diagnostic.

The behavior of the tests is expected to remain identical as before.
2022-04-04 13:43:27 -04:00
Johannes Doerfert 79962df386 [Attributor] Allow to reproduce instructions for simplification
When simplify values we might end up with an instruction from a
different scope or just one that does not dominate the use. If the
instruction can be reproduced without side-effect (incl. UB) we can
now do that. For now this is mostly used for speculatable (intrinsic)
calls but as we learn to make things like arguments or loads available
this will become more powerful.

This will also allow us to remove dead stores more easily in a follow
up.
2022-04-04 12:28:08 -05:00
antonio-cortes-perez c2a8a104ec [MLIR][NFC] Remove unnecessary cast.
I was reading this post:
https://www.fluentcpp.com/2017/05/19/crtp-helper/

And I noticed that most likely this cast is not needed.
Unless it is needed by some compiler versions.
I tested it with:
cmake --build . --target check-mlir

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D121555
2022-04-04 09:46:24 -07:00
Florian Hahn 368d35a894
[LV] Add addiitonal tests for pointer difference memory checks.
Additional tests for D119078.
2022-04-04 17:58:48 +01:00
Benjamin Kramer 4ae24d9fd9 [mlir][capi] Unbreak Interfaces CAPI after 2387fadea3
No idea why check-mlir doesn't build this.
2022-04-04 18:52:11 +02:00
Luboš Luňák 9a6a0dfa06 [lldb] make ConstStringTable use DenseMap rather than std::map
The ordering is not needed, and DenseMap is faster. I can measure
time spent in the SaveToCache() calls reduced to ~40% during LLDB
startup (and the total startup cost reduced to ~70%).

Differential Revision: https://reviews.llvm.org/D122980
2022-04-04 18:46:22 +02:00
David Green 750bf3582a [AArch64] Increase cost of v2i64 multiplies
The cost of a v2i64 multiply was special cased in D92208 as scalarized
into 4*extract + 2*insert + 2*mul. Scalarizing to/from gpr registers are
expensive though, and the cost wasn't high enough to prevent vectorizing
in places where it can be detrimental for performance. This increases it
so that the costs of copying to/from GPRs is increased to 2 each, with
the total cost increasing to 14. So long as umull/smull are handled
correctly (as in D123006) this seems to lead to better vectorization
factors and better performance.

Differential Revision: https://reviews.llvm.org/D123007
2022-04-04 17:42:20 +01:00
Siddharth Bhat 96039b73d8 [MLIR] Add nested symbols into LangRef
Add documentation into the LangRef for parsing nested symbols.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D122977
2022-04-04 22:06:19 +05:30
Alex Brachet 47f59df892 Revert "Reland "[lit] Use sharding for GoogleTest format""
This reverts commit 948f3deca9.
2022-04-04 16:34:28 +00:00
Groverkss aebd3f0799 Revert "[MLIR] Add nested symbols into LangRef"
Reverted because commit pushed with wrong author information

This reverts commit b4865dd67f.
2022-04-04 22:01:06 +05:30
Siddharth Bhat 94b372e725 [MLIR] Add booleans to dense element list in LangRef
Add boolean values as a dense element, as tested in the MLIR parser:

```
  // CHECK: "splatBoolTensor"() {bar = dense<false> : tensor<i1>} : () -> ()
  "splatBoolTensor"(){bar = dense<false> : tensor<i1>} : () -> ()
```

43d758b142/mlir/test/IR/parser.mlir (L630-L631)

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D122978
2022-04-04 21:59:44 +05:30
Groverkss b4865dd67f [MLIR] Add nested symbols into LangRef
Add documentation into the LangRef for parsing nested symbols.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D122977
2022-04-04 21:59:44 +05:30
Daniel Resnick 2387fadea3 [mlir][capi] Add external pass creation to MLIR C-API
Adds the ability to create external passes using the C-API. This allows passes
to be written in C or languages that use the C-bindings.

Differential Revision: https://reviews.llvm.org/D121866
2022-04-04 10:27:11 -06:00
Jonas Devlieghere c69307e5ee
[lldb] Prevent object file plugins from changing the data buffer
The current design allows that the object file contents could be mapped
by one object file plugin and then used by another. Presumably the idea
here was to avoid mapping the same file twice.

This becomes an issue when one object file plugin wants to map the file
differently from the others. For example, ObjectFileELF needs to map its
memory as writable while others likeObjectFileMachO needs it to be
mapped read-only.

This patch prevents plugins from changing the buffer by passing them is
by value rather than by reference.

Differential revision: https://reviews.llvm.org/D122944
2022-04-04 09:24:24 -07:00
Sergei Grechanik b08ede4374 [MLIR] Fix MLIR vim syntax file
This commit fixes several things in the MLIR vim syntax file:
- Spell checking is now on by default only in comments.
- '#' now starts an identifier instead of starting an outline attribute
  declaration, which fixes coloring the rest of the line as a
  preprocessor directive when there is a '#' in the middle.
- '!' and '^' -prefixed identifiers are now colored as types
  and labels.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D122626
2022-04-04 09:02:32 -07:00
Jeremy Morse 920de9c94c Revert "[DebugInfo] Correctly recognize bitfields when emitting dwarf"
This reverts commit 059d1f84d2.

Some tests on green dragon failed as a result of this -- see notes on D96334.
2022-04-04 17:14:58 +01:00
Ilia Diachkov 28a681316f Fix nulltpr typo in comment. NFC
The patch fixes the typo "nulltpr", accidentally found in comments.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D122993
2022-04-04 09:05:06 -07:00
Adrian Prantl cf3e4011b5 Prevent GetAugmentedArchSpec() from attaching "unknown" environments
Environments are optional and a missing environment is distinct from
the default "unknown" environment enumerator.  The test is negative,
because the function uses the host triple and is unpredictable.

rdar://91007207

https://reviews.llvm.org/D122946

Differential Revision: https://reviews.llvm.org/D122946
2022-04-04 08:56:58 -07:00
Priyansh Singh aa19500a4c Correct a typo in a RUN line 2022-04-04 11:32:05 -04:00
gbreynoo 3ad6f53502 [llvm-objcopy][docs] Update --update-section description
I noticed that when --update-section was added to llvm-objcopy it was
not added to the command guide, see
25bcd94234. This change adds it to the
docs and updates the help text.

Differential Revision: https://reviews.llvm.org/D122907
2022-04-04 16:18:17 +01:00
PeixinQiao fbdcb3ce6b [flang] Add one semantic check for allocatable/pointer argument association
The actual argument shall have deferred the same type parameters as
the dummy argument if the argument is allocatable or pointer variable.
Currently programs not following this get one crash during execution.

Reviewed By: Jean Perier

Differential Revision: https://reviews.llvm.org/D122779
2022-04-04 23:16:30 +08:00
Thomas Preud'homme 449ef2fcc6 [Pipeliner] Fix comment typo 2022-04-04 16:10:27 +01:00
Erich Keane b1ed286857 Attempt to re-enable demangle test in mangle-nttp-anon-union
@thakis believes the problem was the lack of -n on my llvm-cxxfilt call,
so hopefully this is the only problem. Committing to see if this makes
all the buildbots happy.
2022-04-04 07:28:29 -07:00
Hirochika Matsumoto 447a4485c5 [InstSimplify] Fold (ctpop(X) == N) || (X != 0) into X != 0 where N > 0
(ctpop(X) == N) || (X != 0) --> (X != 0) https://alive2.llvm.org/ce/z/udgUVV
(ctpop(X) != N) && (X == 0) --> (X == 0) https://alive2.llvm.org/ce/z/9dq-cR

Differential Revision: https://reviews.llvm.org/D122757
2022-04-04 23:23:34 +09:00
Nico Weber a97e3097cf fix comment typos to cycle bots 2022-04-04 10:18:08 -04:00
Nico Weber 80ce17e3d4 [gn build] Always make symlinks target explicitly depend on base binary
This is a no-op in these files since the symlinks array is never empty
and the dependency to the base binary is added through the loop in these
cases.

But adding them doesn't hurt either, and it:
1. Makes all symlinks targets look the same, independent of symlinks
   are created always or just conditionally based on gn args
2. Makes it less likely that bugs like the one fixed by b0abada8fe
   are introduced by copy-pasting an existing symlink target and then
   not being careful enough when tweaking it.

No behavior change.
2022-04-04 09:54:41 -04:00
LLVM GN Syncbot ed020808d7 [gn build] Port 980c3e6dd2 2022-04-04 13:48:25 +00:00
Erich Keane d1205bb37d Reapply"[GH54588]Fix ItaniumMangler for NTTP unnamed unions w/ unnamed structs"
AND the followups that fixed builds.

I attempted to get 'cute' and use llvm-cxxfilt to make the test look
nicer, but apparently some of the bots have a version of llvm-cxxfilt
that is not the in-tree one, so it fails to properly demangle the stuff.
I've disabled this "RUN" line.

This reverts commit 50186b63d1.
2022-04-04 06:41:47 -07:00
Momchil Velikov 980c3e6dd2 [CodeGen] Async unwind - add a pass to fix CFI information
This pass inserts the necessary CFI instructions to compensate for the
inconsistency of the call-frame information caused by linear (non-CFG
aware) nature of the unwind tables.

Unlike the `CFIInstrInserer` pass, this one almost always emits only
`.cfi_remember_state`/`.cfi_restore_state`, which results in smaller
unwind tables and also transparently handles custom unwind info
extensions like CFA offset adjustement and save locations of SVE
registers.

This pass takes advantage of the constraints that LLVM imposes on the
placement of save/restore points (cf. `ShrinkWrap.cpp`):

  * there is a single basic block, containing the function prologue

  * possibly multiple epilogue blocks, where each epilogue block is
    complete and self-contained, i.e. CSR restore instructions (and the
    corresponding CFI instructions are not split across two or more
    blocks.

  * prologue and epilogue blocks are outside of any loops

Thus, during execution, at the beginning and at the end of each basic
block the function can be in one of two states:

  - "has a call frame", if the function has executed the prologue, or
     has not executed any epilogue

  - "does not have a call frame", if the function has not executed the
    prologue, or has executed an epilogue

These properties can be computed for each basic block by a single RPO
traversal.

In order to accommodate backends which do not generate unwind info in
epilogues we compute an additional property "strong no call frame on
entry" which is set for the entry point of the function and for every
block reachable from the entry along a path that does not execute the
prologue. If this property holds, it takes precedence over the "has a
call frame" property.

From the point of view of the unwind tables, the "has/does not have
call frame" state at beginning of each block is determined by the
state at the end of the previous block, in layout order.

Where these states differ, we insert compensating CFI instructions,
which come in two flavours:

- CFI instructions, which reset the unwind table state to the
    initial one.  This is done by a target specific hook and is
    expected to be trivial to implement, for example it could be:
```
     .cfi_def_cfa <sp>, 0
     .cfi_same_value <rN>
     .cfi_same_value <rN-1>
     ...
```
where `<rN>` are the callee-saved registers.

- CFI instructions, which reset the unwind table state to the one
    created by the function prologue. These are the sequence:
```
       .cfi_restore_state
       .cfi_remember_state
```
In this case we also insert a `.cfi_remember_state` after the
last CFI instruction in the function prologue.

Reviewed By: MaskRay, danielkiss, chill

Differential Revision: https://reviews.llvm.org/D114545
2022-04-04 14:38:22 +01:00
Nathan Sidwell ee6ec9e861 [demangler] Parenthesize >> inside template args
Both > and >> expressions need to be parenthesized inside template
argument lists.

Reviewed By: dblaikie, rjmccall

Differential Revision: https://reviews.llvm.org/D122474
2022-04-04 06:35:32 -07:00
Sam McCall 72ae6cc3a6 [pseudo] respect CLANG_INCLUDE_TESTS 2022-04-04 15:30:11 +02:00
Nico Weber b0abada8fe [gn build] llvm-lipo, llvm-libtool-darwin symlink targets now dep on binary
This fixes a regression from 69cde915e923d: If llvm_install_cctools_symlinks
is false, depending llvm-lipo:symlinks didn't actually depend on llvm-lipo
and the binary didn't get built as dependency of `check-lld` (because the
`symlinks` array ended up empty).
2022-04-04 09:20:49 -04:00
Louis Dionne a4f73b9b14 [libc++][NFC] Rename generate_assertion_tests.py to generate_header_tests.py 2022-04-04 09:10:52 -04:00
Louis Dionne be1294de9d [libc++] Implement all public header tests using the new generator
Note that `generate_assertion_tests.py` will be renamed to
`generate_header_tests.py` separately to facilitate change tracking.

Differential Revision: https://reviews.llvm.org/D123000
2022-04-04 09:09:37 -04:00
Nico Weber cd52b35ee4 fix comment typos to cycle bots 2022-04-04 08:56:18 -04:00
Simon Pilgrim 328754474a [DAG] SimplifySetCC - clang-format add/xor/sub with constant handling. NFC. 2022-04-04 13:30:17 +01:00
Yitzhak Mandelbaum 506ec85ba8 [clang][dataflow] Add support for clang's `__builtin_expect`.
This patch adds basic modeling of `__builtin_expect`, just to propagate the
(first) argument, making the call transparent.

Driveby: adds tests for proper handling of other builtins.

Differential Revision: https://reviews.llvm.org/D122908
2022-04-04 12:20:43 +00:00
Pavel Samolysov 87b28f5092 [clang][NFC] Extract the EmitAssemblyHelper::TargetTriple member
Few times in different methods of the EmitAssemblyHelper class the following
code snippet is used to get the TargetTriple and then use it's single method
to check some conditions:

TargetTriple(TheModule->getTargetTriple())

The parsing of a target triple string is not a trivial operation and it takes
time to repeat the parsing many times in different methods of the class and
even numerous times in one method just to call a getter
(llvm::Triple(TheModule->getTargetTriple()).getVendor()), for example.
The patch extracts the TargetTriple member of the EmitAssemblyHelper class to
parse the triple only once in the class' constructor.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D122587
2022-04-04 12:16:39 +03:00
Simon Pilgrim 9db1eb13b6 [Thumb2] Regenerate thumb2-teq2 tests 2022-04-04 12:48:20 +01:00
PeixinQiao 706dec3e47 [mlir] Fix the build error in OpenMPToLLVMIRTranslation.cpp
Fix the build error with "-Werror,-Wcovered-switch-default".

Reviewed By: hpmorgan

Differential Revision: https://reviews.llvm.org/D123018
2022-04-04 19:46:16 +08:00
David Green 2abaa027d9 [AArch64] Teach the costmodel about widening muls
A vector mul(sext, sext) or mul(zext, zext) will be code generated as a
single smull or umull instruction. This most notably effects v2i64
multiplies, which are otherwise not legal and need to be expanded.

The oneuse check has also been slightly changed, as it is already
checked from the use of isWideningInstruction in getCastInstrCost.

Differential Revision: https://reviews.llvm.org/D123006
2022-04-04 12:45:04 +01:00
Simon Pilgrim ec93435ba0 [Thumb2] Regenerate thumb2-teq tests 2022-04-04 12:24:35 +01:00
David Spickett 434b545d4f [lldb][AArch64] Update disassembler feature list and add tests for all extensions
This updates the disassembler to enable every optional extension.
Previously we had added things that we added "support" for in lldb.
(where support means significant work like new registers, fault types, etc.)

Something like TME (transactional memory) wasn't added because
there are no new lldb features for it. However we should still be
disassembling the instructions.

So I went through the AArch64 extensions and added all the missing
ones. The new test won't prevent us missing a new extension but it
does at least document our current settings.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D121999
2022-04-04 11:21:01 +00:00
Simon Pilgrim d4cdaa24fd [MIPS] Regenerate countleading tests with common check prefixes 2022-04-04 12:19:57 +01:00
David Green 2e2f38a1ac [AArch64] Add widening arithmetic cost tests. NFC 2022-04-04 12:19:45 +01:00
Nikita Popov 3c9f3f76f1 [ConstantFold] Fold zero-index GEPs with opaque pointers
With opaque pointers, we can eliminate zero-index GEPs even if
they have multiple indices, as this no longer impacts the result
type of the GEP.

This optimization is already done for instructions in InstSimplify,
but we were missing the corresponding constant expression handling.

The constexpr transform is a bit more powerful, because it can
produce a vector splat constant and also handles undef values --
it is an extension of an existing single-index transform.
2022-04-04 13:04:27 +02:00
Nikita Popov d092df42f3 [InstSimplify] Add tests for zero-offset opaque ptr constexpr GEP (NFC) 2022-04-04 13:04:26 +02:00
Simon Pilgrim ad59bd0be9 [X86] Regenerate peep tests checks 2022-04-04 12:02:33 +01:00
Muhammad Omair Javaid a96638e50e Revert "[NFCI] Regenerate PhaseOrdering test checks"
This reverts commit e91fe08999.

Breaks following buildbots: https://lab.llvm.org/buildbot/#/builders/171
2022-04-04 15:30:57 +05:00