418106 Commits

Author SHA1 Message Date
Florian Mayer
628c537b32 [MTE] Add test that stack tagging does not mess up stack coloring.
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D121433
2022-03-14 13:36:21 -07:00
Shafik Yaghmour
28c878aeb2 [LLDB] Applying clang-tidy modernize-use-default-member-init over LLDB
Applied modernize-use-default-member-init clang-tidy check over LLDB.
It appears in many files we had already switched to in class member init but
never updated the constructors to reflect that. This check is already present in
the lldb/.clang-tidy config.

Differential Revision: https://reviews.llvm.org/D121481
2022-03-14 13:32:03 -07:00
Andrew Litteken
c79ab1065e [IROutliner] Separate split PHI nodes from multiple exits by different outlinable regions.
The IR Outliner is supposed to extract the outputs contained in an external phi node and place them into a phi node contained within the outlined function. However, when the output values of two outlined functions with two different output sets are contained within the same phi node, they are counted as the same exit path when first analyzed. In reality, these create two different phi nodes, creating an inconsistency, resulting in a mismatch in the expected number of output paths and a crash.  This fixes that counting when analyzing the outputs by also analyzing the incoming blocks rather than just the incoming values.

Reviewer: paquette

Differential Revision: https://reviews.llvm.org/D121313
2022-03-14 14:56:59 -05:00
Peter Collingbourne
aaca634c94 gn build: Add support for building with libcurl.
Differential Revision: https://reviews.llvm.org/D121260
2022-03-14 12:52:19 -07:00
Florian Hahn
4a0481e981
[LV] Check for users of truncated IVs, add more detailed comment.
Add missing outside user check for truncated IVs. Also hoist the code in
the helper with additional explanations.

Fixes #54370.
2022-03-14 19:39:30 +00:00
Amir Ayupov
842fa38dbe [X86] Fix cosmetic issues in instruction mnemonics
- Remove spurious } in invlpgb mnemonic
- Add \t between mnemonic and operands for ud1 instructions

Reviewed By: skan, craig.topper

Differential Revision: https://reviews.llvm.org/D121570
2022-03-14 12:29:44 -07:00
Jonas Devlieghere
dde487e547
[lldb] Plumb process host architecture through platform selection
To allow us to select a different platform based on where the process is
running, plumb the process host architecture through platform selection.

This patch is in preparation for D121444 which needs this functionality
to tell apart iOS binaries running on Apple Silicon vs on a remote iOS
device.

Differential revision: https://reviews.llvm.org/D121484
2022-03-14 12:17:01 -07:00
Fangrui Song
c7cf960d85 [ELF] Set the priority of STB_GNU_UNIQUE the same as STB_WEAK
In GCC -fgnu-unique output, STB_GNU_UNIQUE symbols are always defined relative
to a section in a COMDAT group. Currently `other` cannot be STB_GNU_UNIQUE for
valid input, so this patch is NFC.

If we switch to the model that ignores COMDAT resolution when performing symbol
resolution (D120626), this will fix bogus `relocation refers to a symbol in a
discarded section` errors when mixing -fno-gnu-unique objects with -fgnu-unique
objects.

Differential Revision: https://reviews.llvm.org/D120640
2022-03-14 12:00:15 -07:00
Ben Barham
3466b8e23d [Support] Add const to FileError::getFileName
`getFileName` returns a `StringRef`, there's no reason it shouldn't be
const.

Differential Revision: https://reviews.llvm.org/D121495
2022-03-14 11:45:29 -07:00
Ben Barham
cc63ae42d7 [VFS] Rename RedirectingFileSystem::dump to print
The rest of LLVM uses `print` for the method taking the `raw_ostream`
and `dump` only for the method with no parameters. Use the same for
`RedirectingFileSystem`.

Differential Revision: https://reviews.llvm.org/D121494
2022-03-14 11:44:07 -07:00
Kazu Hirata
9286786e87 [CodeGen] Remove an unused variable introduced in D121128 2022-03-14 11:41:04 -07:00
Fangrui Song
407c721ceb [Support] Change zlib::compress to return void
With a sufficiently large output buffer, the only failure is Z_MEM_ERROR.
Check it and call the noreturn report_bad_alloc_error if applicable.
resize_for_overwrite may call report_bad_alloc_error as well.

Now that there is no other error type, we can replace the return type with void
and simplify call sites.

Reviewed By: ikudrin

Differential Revision: https://reviews.llvm.org/D121512
2022-03-14 11:38:04 -07:00
Jonas Devlieghere
b0a76b0162
[lldb] Fix the Windows build after D121536 2022-03-14 11:22:21 -07:00
Peter Klausler
3b61587c9e [flang] LBOUND() edge case: empty dimension
LBOUND must return 1 for an empty dimension, no matter what
explicit expression might appear in a declaration or arrive in
a descriptor.

Differential Revision: https://reviews.llvm.org/D121488
2022-03-14 11:16:09 -07:00
Eric Schweitz
c2e7e75954 Write a pass to annotate constant operands on FIR ops. This works
around the feature in MLIR's canonicalizer, which considers the semantics
of constants differently based on how they are packaged and not their
values and use.  Add test.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D121625
2022-03-14 11:14:44 -07:00
Andrzej Warzynski
75d74d99c7 Revert "[flang] IEEE_ARITHMETIC must imply USE IEEE_EXCEPTIONS"
This reverts commit b6a7600491d755f6f700fe245b2fc7b928264c58. It caused
the following build failure:
```
ninja: error: dependency cycle: include/flang/__fortran_ieee_exceptions.mod -> include/flang/__fortran_ieee_exceptions.mod
```

See e.g.:
* https://lab.llvm.org/buildbot/#/builders/172/builds/9595

To reproduce:
```
cmake -G Ninja \
  -DLLVM_TARGETS_TO_BUILD=host \
  -DCMAKE_BUILD_TYPE=Release \
  -DLLVM_ENABLE_PROJECTS="clang;flang" \
  ../../llvm
ninja check-flang
```
2022-03-14 18:05:26 +00:00
Fraser Cormack
a44aeab526 [RISCV] Add MIR tests exposing missed InstAliases
The InstAlias framework cannot match registers against zero_reg, which
RVV uses to encode unmasked operations.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D92228
2022-03-14 17:53:07 +00:00
Louis Dionne
849e749d7f [libc++][NFC] Remove several redundant #if _LIBCPP_STD_VER > 17 in <span>
It turns out that the whole header is only enabled in C++20 and above,
so these checks were redundant (and always true).

Differential Revision: https://reviews.llvm.org/D121604
2022-03-14 13:53:30 -04:00
Mircea Trofin
294eca35a0 [regalloc] Remove -consider-local-interval-cost
Discussed extensively on D98232. The functionality introduced in D35816
never worked correctly. In D98232, it was fixed, but, as it was
introducing a large compile-time regression, and the value of the
original patch was called into doubt, we disabled it by default
everywhere. A year later, it appears that caused no grief, so it seems
safe to remove the disabled code.

This should be accompanied by re-opening bug 26810.

Differential Revision: https://reviews.llvm.org/D121128
2022-03-14 10:49:16 -07:00
Peter Klausler
b6a7600491 [flang] IEEE_ARITHMETIC must imply USE IEEE_EXCEPTIONS
The intrinsic module IEEE_ARITHMETIC must incorporate the public
names from the intrisic module IEEE_EXCEPTIONS.  Rename IEEE_EXCEPTIONS
to __Fortran_ieee_exceptions so that it won't clash with the
nonintrinsic namespace, establish a new intrinic IEEE_EXCEPTIONS
module that USEs it, and add a USE to IEEE_ARITHMETIC.

Differential Revision: https://reviews.llvm.org/D121490
2022-03-14 10:41:28 -07:00
Jonas Devlieghere
c231deb791
[lldb] Use the debugger's asynchronous output stream for progress events.
Use the debugger's asynchronous output stream for printing progress
events. This allows the active IOHandler to be in charge of printing
them and doing the necessary synchronization.

Differential revision: https://reviews.llvm.org/D121502
2022-03-14 10:31:22 -07:00
zhongyunde
3568333815 [AArch64] Perform last active true vector combine
Test bit of lane EC-1 can use P register directly, eg:
Materialize : Idx = (add (mul vscale, NumEls), -1)
               i1 = extract_vector_elt t37, Constant:i64<Idx>
    ... into: "ptrue p, all" + PTEST

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D121180
2022-03-15 01:25:03 +08:00
Stanislav Gatev
cf63e9d4ca [clang][dataflow] Add support for nested composite bool expressions
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Differential Revision: https://reviews.llvm.org/D121455
2022-03-14 17:18:30 +00:00
Sam Clegg
2f5c4083ea [WebAssembly] Remove unused method from WebAssemblyTargetStreamer. NFC
Differential Revision: https://reviews.llvm.org/D121538
2022-03-14 10:16:56 -07:00
Teresa Johnson
fee0bde4c6 [WPD] Extend checking mode to support fallback to indirect call
Extend -wholeprogramdevirt-check to support both the existing
trapping mode on an incorrect devirtualization, as well as a new
mode to fallback to an indirect call on a mismatch. The new mode is

The new mode is useful in cases where we want to enable
devirtualization but cannot fully guarantee whole program visibility
(e.g in the case where LTO has been disabled for a small set of objects
that could potentially override virtual methods without having a symbol
reference to anything in the base class including the vtable).

Remove !prof and !callees metadata (which are used by indirect call
promotion) from both the new direct call and the fallback indirect call
(so that we don't perform another round of promotion on the latter).
Also remove it from the direct call in the non-fallback cases, which
was an oversight, although it didn't seem to cause any issues. Add tests
for the metadata removal covering the various cases.

Differential Revision: https://reviews.llvm.org/D121419
2022-03-14 10:16:28 -07:00
Valentin Clement
d8222d91c6
[flang] Lower format statement
This patch lowers the format statement.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121611
2022-03-14 18:15:32 +01:00
Jonas Devlieghere
8550c1f328
[llvm] Fix warning: missing submodule 'LLVM_Analysis.ScalarFuncs' 2022-03-14 10:11:52 -07:00
Jonas Devlieghere
2436c5703e
[lldb] Use the IOHandler's stream instead of the debugger's in PrintAsync
PrintAsync is relying on the IOHandler to print to the output/error
stream. In that context it doesn't make much sense that this is using
the debugger's streams rather than the one from the IOHandler.

Differential revision: https://reviews.llvm.org/D121536
2022-03-14 10:11:50 -07:00
Arthur Eubanks
250620f76e [OpaquePtr][AArch64] Use elementtype on ldxr/stxr
Includes verifier changes checking the elementtype, clang codegen
changes to emit the elementtype, and ISel changes using the elementtype.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D120527
2022-03-14 10:09:59 -07:00
Valentin Clement
5d25267d80
[flang] Lower common block
This patch lowers common block variable to FIR.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-14 18:05:16 +01:00
Andrew Browne
18564095a7 [DFSan] Remove use of setarch in dfsan test.
Use of setarch Was added by
f93c2b64ed

Running the test now it doesn't seem necessary because:

1) Explicitly only x86_64 is supported for dfsan.

2) https://reviews.llvm.org/D111522 makes it less flakey.

Differential Revision: https://reviews.llvm.org/D121439
2022-03-14 10:03:51 -07:00
Andrew Litteken
3c90812f3b [IROutliner] Avoid reusing PHINodes that have already been matched when merging outlined functions' phi node blocks
When there are two external phi nodes for two different outlined regions, when compressing the created phi nodes between the two regions, the matching for the second phi node in the second region matches the first phi node created for the first region rather than the second phi node created for the first region. This adds an extra output path where there should not be one.

The fix is the ignore phi nodes that have already been matched for each region.

Reviewer: paquette

Differential Revision: https://reviews.llvm.org/D121312
2022-03-14 12:00:01 -05:00
LLVM GN Syncbot
5fc70e53bf [gn build] Port 5e65e79bace6 2022-03-14 16:52:53 +00:00
Valentin Clement
617ba8aebd
[flang] Lower all intrinsic
Lower the `all` intrinsic procedure.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-14 17:43:46 +01:00
Jonas Devlieghere
df6fcef2b8
Fix the implicit module build (2/2)
This fixes the implicit module build after b1b4b6f36695 broke the LLDB
build: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/42084/

My previous commit didn't have the modulemap change staged.
2022-03-14 09:43:13 -07:00
Arthur Eubanks
4fc7c55fff [NewPM] Actually recompute GlobalsAA before module optimization pipeline
RequireAnalysis<GlobalsAA> doesn't actually recompute GlobalsAA.
GlobalsAA isn't invalidated (unless specifically invalidated) because
it's self-updating via ValueHandles, but can be imprecise during the
self-updates.

Rather than invalidating GlobalsAA, which would invalidate AAManager and
any analyses that use AAManager, create a new pass that recomputes
GlobalsAA.

Fixes #53131.

Differential Revision: https://reviews.llvm.org/D121167
2022-03-14 09:42:34 -07:00
Arthur Eubanks
b9cf2df3ff [test] Add phase ordering test 2022-03-14 09:42:34 -07:00
Valentin Clement
7b917fd284
[flang] Lower elemental calls
This patch adds more lowering of operations sub-expression inside elemental call arguments.
It tests array contexts where an address is needed for each element (for
the argument), but part of the array sub-expression must be lowered by value
(for the operation)

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-14 17:40:11 +01:00
Arthur Eubanks
55cf09ae26 [ValueTracking] Simplify llvm::isPointerOffset()
We still need the code after stripAndAccumulateConstantOffsets() since
it doesn't handle GEPs of scalable types and non-constant but identical
indexes.

Differential Revision: https://reviews.llvm.org/D120523
2022-03-14 09:32:36 -07:00
serge-sans-paille
f6484bd3b0 Fix issing header on z/OS
Bug introduced in fbbc41f8dd23
2022-03-14 17:29:08 +01:00
Stella Stamenova
8bd1988e74 [lldb] Skip Test11588 on Windows
The test was marked as XFAIL on Windows, but recent changes have made it flaky instead
2022-03-14 09:26:41 -07:00
Jonas Devlieghere
f51d7e4bae
Fix the implicit module build
This fixes the implicit module build after b1b4b6f36695 broke the LLDB
build: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/42084/
2022-03-14 09:24:17 -07:00
Jonas Devlieghere
5e65e79bac
[lldb] Move ProgressEventData out of debugger and into its own file (NFC)
Move ProgressEventData out of debugger and into its own file. This is in
preparation of adding a few new type of event data for diagnostics.

Differential revision: https://reviews.llvm.org/D121506
2022-03-14 09:24:17 -07:00
Nikita Popov
04b717c423 [TLI] Check that malloc argument has type size_t
DSE assumes that this is the case when forming a calloc from a
malloc + memset pair.

For tests, either update the malloc signature or change the
data layout.
2022-03-14 17:22:24 +01:00
Matthias Springer
de5022c7d7 [mlir][vector] Implement unrolling of ReductionOp
Differential Revision: https://reviews.llvm.org/D121597
2022-03-15 01:21:24 +09:00
Sam Clegg
20f7f733fe [WebAssembly] Rename member in WasmYAML.h to avoid compiler warning
Followup/fix for https://reviews.llvm.org/D121349.
2022-03-14 09:09:43 -07:00
Keith Smiley
5da83eeb91 clang-tidy: discover binaries in build dir
This changes the clang-tidy script to discover binaries you've built
locally without having to pass them.

Differential Revision: https://reviews.llvm.org/D100692
2022-03-14 09:04:36 -07:00
Sam Clegg
9504ab32b7 [WebAssembly] Second phase of implemented extended const proposal
This change continues to lay the ground work for supporting extended
const expressions in the linker.

The included test covers object file reading and writing and the YAML
representation.

Differential Revision: https://reviews.llvm.org/D121349
2022-03-14 08:55:47 -07:00
Nikita Popov
8361c5da30 [SLPVectorizer] Handle external load/store pointer uses with opaque pointers
In this case we may not generate a bitcast, so the new load/store
becomes the external user.
2022-03-14 16:55:09 +01:00
Ayush Sahay
d506a9ef2b [lldb] Require native for command-thread-siginfo.test
command-thread-siginfo.test employs a subject with a call to wait, and
thus requires system-linux. However, it's possible to target non-Linux
platforms despite operating on Linux hosts. So, have it require native
too.

Reviewed By: mgorny, labath

Differential Revision: https://reviews.llvm.org/D121487
2022-03-14 21:20:21 +05:30