Commit Graph

433504 Commits

Author SHA1 Message Date
Guillaume Chatelet 31fbcccb31 Revert "[NFC][libc] rearrange aarch64 memset code to better match new implementation"
This reverts commit 4d931b6e1e.
2022-08-19 15:02:16 +00:00
Wei Yi Tee dbb95c2a85 [clang][dataflow] Debug string for value kinds.
Differential Revision: https://reviews.llvm.org/D131891
2022-08-19 15:00:01 +00:00
Sam McCall bd5cc6575b [pseudo] Start rules are `_ := start-symbol EOF`, improve recovery.
Previously we were calling glrRecover() ad-hoc at the end of input.
Two main problems with this:
 - glrRecover() on two separate code paths is inelegant
 - We may have to recover several times in succession (e.g. to exit from
   nested scopes), so we need a loop at end-of-file
Having an actual shift action for an EOF terminal allows us to handle
both concerns in the main shift/recover/reduce loop.

This revealed a recovery design bug where recovery could enter a loop by
repeatedly choosing the same parent to identically recover from.
Addressed this by allowing each node to be used as a recovery base once.

Differential Revision: https://reviews.llvm.org/D130550
2022-08-19 16:49:37 +02:00
Guillaume Chatelet 4d931b6e1e [NFC][libc] rearrange aarch64 memset code to better match new implementation
Differential Revision: https://reviews.llvm.org/D132121
2022-08-19 14:48:17 +00:00
Muhammad Usman Shahid fd874e5fb1 Missing tautological compare warnings due to unary operators
The patch mainly focuses on the no warnings for -Wtautological-compare.
It work fine for the positive numbers but doesn't for the negative
numbers. This is because the warning explicitly checks for an
IntegerLiteral AST node, but -1 is represented by a UnaryOperator with
an IntegerLiteral sub-Expr.

Fixes #42918
Differential Revision: https://reviews.llvm.org/D130510
2022-08-19 10:46:29 -04:00
Alexey Bataev d53e245951 [COST][NFC]Introduce OperandValueKind in getMemoryOpCost, NFC.
Added OperandValueKind OpdInfo parameter to getMemoryOpCost functions to
better estimate cost with immediate values.

Part of D126885.
2022-08-19 07:33:00 -07:00
Michał Górny d38985a36b [lldb] [test] Disable new CommunicationTests on Windows
Sponsored by: The FreeBSD Foundation
2022-08-19 16:23:39 +02:00
Timm Bäder 7614785e1d [clang][Interp] Rename Integral::T to Integral::ReprT
Just 'T' is a bit generic and causes confusion.
2022-08-19 16:14:37 +02:00
David Sherwood 666d2a925f [SVE][LoopVectorize][NFC] Tidy up some tests
Whilst writing a patch to add extra tail-folding RUN lines to
existing tests I noticed a few areas where they can be
cleaned up a little:

1. scalable-reductions.ll: fmin_fast does not mark fcmp as fast.
2. sve-inductions-unusual-types.ll: remove direct references to
   SSA variable names.
3. sve-strict-fadd-cost.ll: don't force vector width so we see
   costs for different VFs in one go. This will be important for
   the follow-on patch.
4. sve-vector-reverse.ll,vector-reverse-mask4.ll: add noalias
   keyword to simplify IR.
4. sve-widen-gep.ll,sve-widen-phi.ll: regenerate using script.

These changes will make the subsequent patch adding RUN lines much
easier to review!

Differential Revision: https://reviews.llvm.org/D132219
2022-08-19 15:12:58 +01:00
Simon Tatham a771a91dcb [libcxxabi] Fix alignment of pointers returned by fallback_malloc
This aligns the ``heap[]`` array in ``fallback_malloc.cpp`` to ensure
that it can be safely cast to ``heap_node*``, and also adjusts the
allocation algorithm to ensure that every allocated block has the
alignment requested by ``__attribute__((aligned))``, by putting the
block's ``heap_node`` header 4 bytes before an aligned address.

Patch originally by Eric Fiselier: this is an updated version of
D12669, which was never landed.

Reviewed By: ldionne, #libc_abi

Differential Revision: https://reviews.llvm.org/D129842
2022-08-19 15:07:57 +01:00
Timm Bäder 80bbc05436 [clang][Interp] Implement inv and neg unary operations
Implement negating and inverting values. Also implement
IntegralToBoolean casts so the operations are easier to test.

Differential Revision: https://reviews.llvm.org/D132098
2022-08-19 16:05:00 +02:00
Max Kazantsev 72136d8ba2 [Test] Add test for miscompile described in PR57247 2022-08-19 21:02:07 +07:00
Max Kazantsev f798c042f4 Revert "[SCEV] Prove condition invariance via context"
This reverts commit a3d1fb3b59.

Reverting until investigation of https://github.com/llvm/llvm-project/issues/57247
has concluded.
2022-08-19 21:02:06 +07:00
Ellis Hoag 5779966da8 Revert "Revert "[compiler-rt] Fix check for cross-compiling""
This reverts commit 18f6b05e0a.

This is a reland of https://reviews.llvm.org/D132130 which I incorrectly
thought had broken the builds.

Differential Revision: https://reviews.llvm.org/D132230
2022-08-19 07:00:51 -07:00
Haojian Wu e32799d1d6 [pseudo] NFC, remove redundant ; 2022-08-19 15:55:19 +02:00
Michał Górny 7aadecae40 [lldb] [test] Add synchronization to TestContinue
Sponsored by: The FreeBSD Foundation
2022-08-19 15:49:35 +02:00
Michał Górny d6e1e01da9 [lldb] [Core] Harmonize Communication::Read() returns w/ thread
Harmonize the status and error values of Communication::Read() when
running with and without read thread.  Prior to this change, Read()
would return eConnectionStatusSuccess if read thread was enabled
and the read timed out or reached end-of-file, rather than
the respective states that are returned if read thread was disabled.
Now, it correctly returns eConnectionStatusTimedOut
and eConnectionStatusEndOfFile, and sets the error respectively.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D132217
2022-08-19 15:36:03 +02:00
Nikolas Klauser 5146b57b40 [libc++][NFC] Rename the constexpr macros
This was discussed on Discord with the consensus that we should rename the macros.

Reviewed By: ldionne, Mordante, var-const, avogelsgesang, jloser, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D131498
2022-08-19 15:35:02 +02:00
Sam McCall ac31781759 [Sema] Tweak diagnostic logic so suppress-in-header logic works in tools too.
Certain idioms are ignored by -Wunused in header files only.
The current "is a header" check assumes that if headers are the main file, we're
building a PCH or a module or something. However in tools we may be parsing the
header in its own right, but still want to treat it as a header.

Fixes https://github.com/clangd/vscode-clangd/issues/360

Differential Revision: https://reviews.llvm.org/D129642
2022-08-19 15:16:10 +02:00
Sam McCall 605035bf45 [pseudo] Changes omitted from previous commit 2022-08-19 15:15:37 +02:00
Sam McCall 2cc7463c85 [pseudo] Perform unconstrained reduction prior to recovery.
Our GLR uses lookahead: only perform reductions that might be consumed by the
shift immediately following. However when shift fails and so reduce is followed
by recovery instead, this restriction is incorrect and leads to missing heads.

In turn this means certain recovery strategies can't be made to work. e.g.
```
ns := NAMESPACE { namespace-body } [recover=Skip]
ns-body := namespace_opt
```
When `namespace { namespace {` is parsed, we can recover the inner `ns` (using
the `Skip` strategy to ignore the missing `}`). However this `namespace` will
not be reduced to a `namespace-body` as EOF is not in the follow-set, and so we
are unable to recover the outer `ns`.

This patch fixes this by tracking which heads were produced by constrained
reduce, and discarding and rebuilding them before performing recovery.

This is a prerequisite for the `Skip` strategy mentioned above, though there are
some other limitations we need to address too.

Reviewed By: hokein

Differential Revision: https://reviews.llvm.org/D130523
2022-08-19 15:07:36 +02:00
Sam McCall 13b2a0c69b [clangd] Support hover on __func__ etc (PredefinedExpr)
Expose these as variables as that's what the standard calls them (and D131175).

To make this work, we also fix a bug in SelectionTree: PredefinedExpr has
an implicit/invisible StringLiteral, and SelectionTree should not traverse
implicit things.

Reviewed By: ckandeler

Differential Revision: https://reviews.llvm.org/D132135
2022-08-19 14:51:46 +02:00
Kristof Beyls 3d2ea3c77f Add guidance for what to put in community calendar invites
Differential Revision: https://reviews.llvm.org/D132134
2022-08-19 14:11:33 +02:00
Stefan Pintilie 1492c88f49 [PowerPC] Fix bugs in sign-/zero-extension elimination
This patch fixes the following two bugs in `PPCInstrInfo::isSignOrZeroExtended` helper, which is used from sign-/zero-extension elimination in PPCMIPeephole pass.
- Registers defined by load with update (e.g. LBZU) were identified as already sign or zero-extended. But it is true only for the first def (loaded value) and not for the second def (i.e. updated pointer).
- Registers defined by ORIS/XORIS were identified as already sign-extended. But, it is not true for sign extension depending on the immediate (while it is ok for zero extension).

To handle the first case, the parameter for the helpers is changed from `MachineInstr` to a register number to distinguish first and second defs. Also, this patch moves the initialization of PPCMIPeepholePass to allow mir test case.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D40554
2022-08-19 07:05:40 -05:00
Caroline Concatto 9f21d6e953 [Clang][AArch64] Use generic extract/insert vector for svget/svset/svcreate tuples
This patch replaces svget, svset and svcreate aarch64 intrinsics for tuple
types with the generic llvm-ir intrinsics extract/insert vector

Differential Revision: https://reviews.llvm.org/D131547
2022-08-19 12:58:59 +01:00
Nico Weber 6a62fc1827 [gn build] Port c74c17f37a 2022-08-19 07:45:44 -04:00
Nico Weber ca5902cc82 Revert "[gn build] port f7a33090a910"
This reverts commit d3a1dbc490.
f7a33090a9 was reverted in e941b031d3.
2022-08-19 07:40:45 -04:00
Pavel Labath c74c17f37a [lldb] Use WSAEventSelect for MainLoop polling on windows
This patch switches the MainLoop class to use the WSAEventSelect
mechanism to wait for multiple sockets to become readable. The
motivation for doing that is that this allows us to wait for other kinds
of events as well (as long as they can be converted to WSAEvents). This
will allow us to avoid (abstract away) pipe-based multiplexing
mechanisms in the generic code, since pipes cannot be combined with
sockets on windows.

Since the windows implementation will now look completely different than
the posix (file descriptor-based) implementations, I have split the
MainLoop class into two (MainLoopPosix and MainLoopWindows), with the
common code going into MainLoopBase.

Differential Revision: https://reviews.llvm.org/D131159
2022-08-19 13:25:25 +02:00
Vaibhav Yenamandra 1bd2b2dce2 Add support for specifying the severity of a SARIF Result
* Extend SarifResult with level property, and allow rule configuration
* Create SarifReportingConfiguration which allow configuring rules with
a default priority, severity and an enable-toggle
* Support for setting the level property[1] of a result.

If unset, it defaults to "warning", which is the result of an empty
default configuration on rules[2]

[1]: https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317648
[2]: https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317855

Differential Revision: https://reviews.llvm.org/D131084
2022-08-19 07:14:50 -04:00
Caroline Concatto 09afe4155b [InstCombine] For vector extract when extract vector and insert value type is the same
This patch has implements these optimizations:

 extract.vector(insert.vector(Vector, Value, Idx), Idx) --> Value

 extract.vector(insert.vector(Vector, Value, InsertIndex), ExtractIndex)
  --> extract.vector(Vector, ExtractIndex)

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D132137
2022-08-19 12:13:03 +01:00
Dmitry Preobrazhensky e99f6df726 [AMDGPU][MC][GFX9][NFC] Split large test file
Split gfx9_dasm_all.txt by instruction encoding.

Differential Revision: https://reviews.llvm.org/D132124
2022-08-19 14:01:42 +03:00
Dmitry Preobrazhensky bdb859c9a7 [AMDGPU][MC][GFX8][NFC] Split large test file
Split gfx8_dasm_all.txt by instruction encoding.

Differential Revision: https://reviews.llvm.org/D132126
2022-08-19 13:54:56 +03:00
Dominik Adamski b736179e34 [NFC][OpenMP] Add test for simd directive with nested loop
This test is follow up of the review: https://reviews.llvm.org/D131402

Co-Author of the patch: Kiran Chandramohan

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D132215
2022-08-19 05:45:32 -05:00
Caroline Concatto 4ef1f014a1 [Clang][AArch64] Replace aarch64_sve_ldN intrinsic by aarch64_sve_ldN.sret
Differential Revision: https://reviews.llvm.org/D131687
2022-08-19 11:42:18 +01:00
Alexander Malkov cd86a03246 [clang,flang] Add help text for -fsyntax-only
Fix for the problem with displaying options `-fsyntax-only` in clang and flang-new in help
Fix https://github.com/llvm/llvm-project/issues/57033

Before:
``` $ clang  -help | grep syntax
  -objcmt-migrate-property-dot-syntax
         Enable migration of setter/getter messages to property-dot syntax
```
After:
```
 $ clang -help | grep syntax
  -fsyntax-only           Run the preprocessor, parser and semantic analysis stages
  -objcmt-migrate-property-dot-syntax
         Enable migration of setter/getter messages to property-dot syntax
```

Reviewed By: vzakhari, awarzynski, MaskRay, alexiprof

Differential Revision: https://reviews.llvm.org/D131808
2022-08-19 09:54:29 +00:00
Simon Pilgrim 23a91214ec [CostModel][X86] Split icmp/fcmp cost kinds tests
It's going to be much easier to maintain these tests (and all the check prefix combinations) if we don't mix cost kinds in the same file.
2022-08-19 10:39:30 +01:00
Simon Pilgrim 0de2c3d7e4 [CostModel][X86] Split select cost kinds tests
It's going to be much easier to maintain these tests (and all the check prefix combinations) if we don't mix cost kinds in the same file.
2022-08-19 10:28:04 +01:00
Simon Pilgrim 19cbe4e365 [CostModel][X86] Add tremont to slm-arith-costs.ll
Tremont uses the Goldmont div/sqrt costs but we weren't testing for them
2022-08-19 10:17:44 +01:00
Simon Pilgrim 1ad18b5968 [CostModel][X86] Cleanup arithmetic test triples
Just specify the triple inside the RUN command (to make i686 support much easier!), and consistently use x86_64-- generic triple
2022-08-19 10:09:28 +01:00
Martin Storsjö 8437c8ff42 [libcxx] [test] Mark the libcxx/selftest/remote-substitutions.sh.cpp test as requiring bash in the executor
It's unclear to me why this wasn't tagged this way already in
87fe0709d4 / D114612 where the
feature flag executor-has-no-bash was added, as this test did exist
in its current form already at that time.

Differential Revision: https://reviews.llvm.org/D131446
2022-08-19 11:42:56 +03:00
Martin Storsjö 81e55ff473 [libcxx] [test] Make some threading tests more robust
Increase the timeout tolerance if TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT
is set, similarly to how it's done in a couple other tests.

Use `std::this_thread::yield();` instead of busylooping. When multiple
threads are busylooping, it's plausible that not all threads even get
started running before the timeout runs out.

This makes the threading tests succeed if run in Windows runners on
Github Actions.

Differential Revision: https://reviews.llvm.org/D131483
2022-08-19 11:42:35 +03:00
Martin Storsjö 63d88ed5bf [libcxx] [test] Split the TEST_HAS_SANITIZERS define into TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT
This makes its role clearer. It's plausible that one may want to manually
define TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT when running the tests in
some environments - in particular, it seems to be necessary to use the
higher tolerance timeouts if running the tests on Windows runners
on Github Actions.

Also add the descriptive comment in one file where it was missing.

Differential Revision: https://reviews.llvm.org/D131484
2022-08-19 11:41:43 +03:00
Martin Storsjö e78223e79e [libcxx] [test] Remove --env PATH from the static clangcl config
The PATH is set in order to be able to find the tested DLL at runtime.
When linking statically, it's not necessary to set the PATH.

Setting PATH in the executor has the downside that it clears the
existing path (it's not prepended/appended to it), which means
that the executed tools can't find other tools - which sets the
executor-has-no-bash flag.

By removing the unnecessary setting of PATH, we have a properly
working bash even when wrapped by the executor, which gets rid
of the executor-has-no-bash flag in this test configuration, which
makes 9 more testcases be executed.

Differential Revision: https://reviews.llvm.org/D131481
2022-08-19 11:40:58 +03:00
Carlos Galvez 3fd4213059 [clang-tidy] Do not trigger cppcoreguidelines-avoid-const-or-ref-data-members on lambda captures
Lambdas are implemented as regular classes internally,
and the captured variables end up as members there.
Do not diagnose those - the check should cover only
regular classes and structs.

Differential Revision: https://reviews.llvm.org/D131780
2022-08-19 08:26:34 +00:00
jacquesguan 04986dda00 [LangRef][VP] Fix typo.
Differential Revision: https://reviews.llvm.org/D132210
2022-08-19 16:21:39 +08:00
Iain Sandoe a2dd6130d4 [clang][Modules] Fix a regression in handling missing framework headers.
The commit of af2d11b1d5 missed a case where
the value of a suggested module needed to be reset to nullptr.  Fixed thus
and added a testcase to cover the circumstance.
2022-08-19 09:13:22 +01:00
Archibald Elliott 270c179afd [AArch64][GISel] Lower llvm.prefetch
This change adds support for lowering llvm.prefetch directly using
GlobalISel. Currently, llvm.prefetch falls back to SelectionDAG.

This Change:
- Adds an AArch64-specific G_PREFETCH generic instruction, to be used
  where AArch64ISD::PREFETCH is used in SelectionDAG.
- Adds the GINodeEquiv so patterns are translated over to GlobalISel
  automatically.
- Corrects the AArch64Prefetch patterns to use a target immediate, which
  is needed to get the patterns to translate across correctly.
- Translates the SelectionDAG legalisation of the prefetch intrinsic
  into the corresponding GlobalISel legalisation.

Differential Revision: https://reviews.llvm.org/D132043
2022-08-19 09:11:18 +01:00
Archibald Elliott 3a729069e4 [IR] Update llvm.prefetch to match docs
The current llvm.prefetch intrinsic docs state "The rw, locality and
cache type arguments must be constant integers."

This change:
- Makes arg 3 (cache type) an ImmArg
- Improves the verifier error messages to reference the incorrect
  argument.
- Fixes two tests which contradict the docs.

This is needed as the lowering to GlobalISel is different for ImmArgs
compared to other constants. The non-ImmArgs create a G_CONSTANT MIR
instruction, the for ImmArgs the constant is put directly on the
intrinsic's MIR instruction as an immediate.

Differential Revision: https://reviews.llvm.org/D132042
2022-08-19 09:11:17 +01:00
Michał Górny 8b50ffe9fd [lldb] [test] Remove test_step_multiprocess, it's unreliable
Sponsored by: The FreeBSD Foundation
2022-08-19 10:08:11 +02:00
Max Kazantsev 0867f23dcf [Test] Regenerate tests using update_tests.py 2022-08-19 14:51:19 +07:00