Commit Graph

412471 Commits

Author SHA1 Message Date
OCHyams de3f81557a [Dexter] Remove false requirement of lldb for dexter regression tests on Windows
Not quite NFC because a little work was required to configure some tests to run
on Windows at all.

Before this patch on Windows:

    $ llvm-lit cross-project-tests\debuginfo-tests\dexter\feature-tests
       Unsupported: 49
       Passed     : 23

After this patch on Windows:

    $ llvm-lit cross-project-tests\debuginfo-tests\dexter\feature-tests
       Unsupported      : 27
       Passed           : 39
       Expectedly failed:  6

There are 3 main changes here. The first is to add a few more substitutions in
cross-project-tests/lit.cfg.py so that tests need to use specific flags can
still use the dexter regression test defaults for the native platform. These
are:

     %dexter_regression_test_debugger
     %dexter_regression_test_builder
     %dexter_regression_test_cflags
     %dexter_regression_test_ldflags

Tests that now use these options and therefore can be run on Windows too
(though the second is still failing for unknown reasons):

    cross-project-tests/debuginfo-tests/dexte/feature_tests
        /subtools/clang-opt-bisect/clang-opt-bisect.cpp
        /subtools/test/source-root-dir.cpp

The second change is to remove spurious `REQUIRES: system-linux, lldb` and
`UNSUPPORTED: system-windows` directives, and make changes to lit.local.cfg
files that have the same effect. I've also added comments to the genuine
REQUIRES, UNSUPPORTED, and XFAIL directives so it's easier to understand
requirements at a glance. The most common reason for a test to not be supported
on Windows is that it uses DexLimitSteps, DexDeclareAddress, or DexCommandLine,
none of which are supported in the dbgeng driver.

There are two failures on Windows that were previously hidden, which I've
XFAILed:

    cross-project-tests/debuginfo-tests/dexter/feature_tests
        /commands/perfect/dex_finish_test/default_conditional.cpp
        /commands/perfect/dex_finish_test/default_conditional_hit_count.cpp

And two that were easy to fix:

    cross-project-tests/debuginfo-tests/dexter/feature_tests
        /commands/perfect/dex_finish_test/default_simple.cpp
        /commands/perfect/dex_finish_test/default_hit_count.cpp

Lastly, I've set three directories as unsupported.

    cross-project-tests/debuginfo-tests/dexter/feature_tests
        /commands/perfect/limit_steps
        /commands/perfect/dex_declare_address
        /commands/perfect/dex_declare_file

The first two are unsupported on Windows because they contains tests for the
DexLimitSteps and DexDeclareAddress commands which aren't supported in the
dbgeng driver. The third is unsupported on all platforms as the tests involve
invoking clang directly, which isn't currently a supported way of building
tests for dexter in lit (it can cause problems for cross compilers that can
target the host, as the tests use the default triple and linker, which may
be aligned for the default target, not host).

Tested on Windows and Linux.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D118048
2022-01-26 11:33:50 +00:00
Simon Pilgrim 04754af925 Fix MSVC 'not all control paths return a value' warning. NFC. 2022-01-26 11:33:37 +00:00
Sebastian Neubauer 4723f3cf03 [AMDGPU][GlobalISel] Combine unmerge of undef
Fold (unmerge undef) -> undef, undef, ...

Differential Revision: https://reviews.llvm.org/D118138
2022-01-26 12:30:36 +01:00
Sebastian Neubauer 6680466663 [AMDGPU][NFC] Pre-commit regenerated test 2022-01-26 12:30:33 +01:00
David Spickett ee0c3820f8 [lldb][AArch64] Add MakeTaggedRanges to MemoryTagManager
This is to be used when you want to know what subranges
of a larger range have memory tagging. Like MakeTaggedRange
but memory without tags is skipped and you get a list of ranges back.

Will be used later by DumpDataExtractor to show memory tags.

MakeTaggedRanges assumes that the memory regions it is
given are sorted in ascending order and do not overlap.
For the current use case where you get regions from
GetMemoryRegions and are on some Linux like OS, this is
reasonable to assume.

I've used asserts to check those conditions. In future
any API binding will check them up front to prevent a crash.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D112824
2022-01-26 11:30:10 +00:00
Max Kazantsev 3271f43680 [Test] Add test for PR53419
These tests demonstrate how suboptimal is the lowering of
equality checks for short vectors.
2022-01-26 18:25:38 +07:00
Salman Javed 19eaad94c4 [clang-tidy] Cache the locations of NOLINTBEGIN/END blocks
Support for NOLINT(BEGIN/END) blocks (implemented in D108560) is
currently costly. This patch aims to improve the performance with the
following changes:

- The use of tokenized NOLINTs instead of a series of repetitive ad-hoc
string operations (`find()`, `split()`, `slice()`, regex matching etc).
- The caching of NOLINT(BEGIN/END) block locations. Determining these
locations each time a new diagnostic is raised is wasteful as it
requires reading and parsing the entire source file.

Move NOLINT-specific code from `ClangTidyDiagnosticConsumer` to new
purpose-built class `NoLintDirectiveHandler`.

Differential Revision: https://reviews.llvm.org/D116085
2022-01-27 00:12:16 +13:00
Nicolas Vasilache 9b6c2ea302 [mlir][Linalg] Add GenericOp self-copy on buffers folding
Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D118116
2022-01-26 05:56:31 -05:00
Nikita Popov ed4efee2a3 [MemCpyOpt] Add additiona call slot unwind tests (NFC)
Test a possibly unwinding call with a byval and sret argument.
2022-01-26 11:49:24 +01:00
Nuno Lopes 37d690b330
remove spurious comma [NFC] 2022-01-26 10:48:43 +00:00
Benjamin Kramer 0776f6e04d [LSV] Vectorize loads of vectors by turning it into a larger vector
Use shufflevector to do the subvector extracts. This allows a lot more
load merging on AMDGPU and also on NVPTX when <2 x half> is involved.

Differential Revision: https://reviews.llvm.org/D117219
2022-01-26 11:38:41 +01:00
Stanislav Gatev 188d28f73c [clang][dataflow] Assign aggregate storage locations to union stmts
This patch ensures that the dataflow analysis framework does not crash
when it encounters access to members of union types.

This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: xazax.hun

Differential Revision: https://reviews.llvm.org/D118226
2022-01-26 10:36:49 +00:00
Alexander Batashev e9b4239fef [mlir][openmp] Custom syntax for `omp.target` operation
Add a custom parser and printer for `omp.target` operation.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D117539
2022-01-26 10:26:19 +00:00
Jan Svoboda 76cb4cd074 [clang] Fix serialized diagnostics edge-cases
The Clang frontend sometimes fails on the following assertion when launched with `-serialize-diagnostic-file <x>`:

```
Assertion failed: (BlockScope.empty() && CurAbbrevs.empty() && "Block imbalance"), function ~BitstreamWriter, file BitstreamWriter.h, line 125.
```

This was first noticed when passing an unknown command-line argument to `-cc1`.

It turns out the `DiagnosticConsumer::finish()` function should be called as soon as processing of all source files ends, but there are some code paths where that doesn't happen:

1. when command line parsing fails in `cc1_main()`,
2. when `!Act.PrepareToExecute(*this)` or `!createTarget()` evaluate to `true` in `CompilerInstance::ExecuteAction` and the function returns early.

This patch ensures `finish()` is called in all those code paths.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D118150
2022-01-26 11:21:51 +01:00
Jan Svoboda 600c6714ac [clang][syntax] Replace `std::vector<bool>` use
LLVM Programmer’s Manual strongly discourages the use of `std::vector<bool>` and suggests `llvm::BitVector` as a possible replacement.

This patch replaces `std::vector<bool>` with `llvm::BitVector` in the Syntax library and replaces range-based for loop with regular for loop. This is necessary due to `llvm::BitVector` not having `begin()` and `end()` (D117116).

Reviewed By: dexonsmith, dblaikie

Differential Revision: https://reviews.llvm.org/D118109
2022-01-26 11:20:18 +01:00
Jan Svoboda aa33688cad [llvm][support] Replace `std::vector<bool>` use in YAMLTraits
LLVM Programmer’s Manual strongly discourages the use of `std::vector<bool>` and suggests `llvm::BitVector` as a possible replacement.

This patch replaces the use of `std::vector` with `llvm::BitVector` in LLVM's YAML traits and replaces the call to `Vec.insert(Vec.begin(), N, false)` on empty `Vec` with `Vec.resize(N)`, which has the same semantics but avoids using `insert` and iterators, which `llvm::BitVector` doesn't possess.

Reviewed By: dexonsmith, dblaikie

Differential Revision: https://reviews.llvm.org/D118111
2022-01-26 11:20:18 +01:00
Nuno Lopes 24a49e99f3 [NewGVN] FIx phi-of-ops in the presence of memory read operations
The phi-of-ops functionality has a function OpIsSafeForPHIOfOps
to determine when it's safe to create the new phi.
But this function only checks for the obvious dominator conditions
and ignores memory.
This patch takes the conservative approach and disables phi-of-ops
whenever there's a load that doesn't dominate the phi, as its
value may be affected by a store inside the loop.

This can be improved later to check aliasing between the
load/stores.

Fixes https://llvm.org/PR53277

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D117999
2022-01-26 10:19:18 +00:00
serge-sans-paille 66c602be25 [NFC] Additional header dependency cleanup LLVMSupport
A few more forward-declarations, a few less headers. the impact on number of
preprocessed lines for LLVMSupport is negligible (-3K lines) but it's always
good to remove dependencies.

Related discourse thread: https://llvm.discourse.group/t/include-what-you-use-include-cleanup
2022-01-26 11:16:15 +01:00
Nikita Popov 44cfc3a816 [LICM] Generalize unwinding check during scalar promotion
This extract a common isNotVisibleOnUnwind() helper into
AliasAnalysis, which handles allocas, byval arguments and noalias
calls. After D116998 this could also handle sret arguments. We
have similar logic in DSE and MemCpyOpt, which will be switched
to use this helper as well.

The noalias call case is a bit different from the others, because
it also requires that the object is not captured. The caller is
responsible for doing the appropriate check.

Differential Revision: https://reviews.llvm.org/D117000
2022-01-26 11:15:03 +01:00
serge-sans-paille 7c02776567 Fix edb02d8c5df36bb375df7171b4ba61635564dfb4 2022-01-26 11:08:42 +01:00
Nikita Popov dee0c268ef [LICM] Add additional tests for promotion with unwinding (NFC) 2022-01-26 11:07:09 +01:00
Nikita Popov 2461aee6db [OpenMPIRBuilderTest] Avoid pointer element type access
This was reintroduced by D110114.
2022-01-26 11:02:43 +01:00
Maciej Gabka c5263cd518 Restrict performPostLD1Combine to 64 and 128 bit vectors
When wider vectors are used, for example fixed width SVE,
there is no patterns to select AArch64ISD::LD1LANEpost
nodes, so we should do an early exit.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D117674
2022-01-26 09:57:44 +00:00
Adrian Kuegel b61c878fc5 [mlir][Bazel] Remove unnecessary dependencies
Differential Revision: https://reviews.llvm.org/D118221
2022-01-26 10:55:40 +01:00
Martin Storsjö a2aea7199a [libcxx] [test] Fix mismatches between _aligned_malloc and free() on Windows
This allows getting rid of one case of LIBCXX-WINDOWS-FIXME. The fixme
comment was inaccurate; aligned allocation functions are provided these
days, but the test kept failing as it was using mismatched allocation
and free functions.

A similar issue was fixed earlier, in
6596778b46. That test was fixed by
overriding the aligned `operator new` too, and returning a dummy fixed
allocation instead. As this test is libcxx specific, it can use the
internal `std::__libcpp_aligned_free()` instead, to match libcxx's
internal aligned `operator new`.

Differential Revision: https://reviews.llvm.org/D118190
2022-01-26 11:52:32 +02:00
Nikita Popov bec4e865de [SCEVExpander] Remove pointer element type access in assertion
Assert directly on i8 rather than the element type of i8*.
2022-01-26 10:35:57 +01:00
Nikita Popov 9e7a2bfcf7 [OpenMPOpt] Add const qualifier (NFC)
Make it clear that this large lambda does not modify the vector.
2022-01-26 10:35:57 +01:00
serge-sans-paille c1b653bfa1 [NFC] Use an llvm::DenseMap instead of std::map in CategorizedHelpPrinter::printOptions
It's a recommit of 6427f4c52c (patch included)
2022-01-26 10:32:57 +01:00
Nikita Popov c82cb5d000 [AddressSanitizer] Avoid pointer element type accesses
Determine masked load/store type based on the value operand and
result types, rather than pointer element type.
2022-01-26 10:16:15 +01:00
Yury Gribov 8bbfdf8ec3 [flang] Get rid of code duplication in wrapper. Fix checking of undefined variables.
Differential Revision: https://reviews.llvm.org/D117767
2022-01-26 11:42:03 +03:00
David Green 57356d6bb7 [DAG] Create fptoui.sat from clamped fptoui
This is the unsigned variant of D111976, where we convert a clamped
fptoui to a fptoui.sat. Because we are unsigned, the condition this time
is only UMIN of UINT_MAX. Similarly to D111976 it handles ISD::UMIN,
ISD::SETCC/ISD::SELECT, ISD::VSELECT or ISD::SELECT_CC nodes.

This especially helps on ARM/AArch64 where the vcvt instructions
naturally saturate the result.

Differential Revision: https://reviews.llvm.org/D114964
2022-01-26 08:37:44 +00:00
Yury Gribov a5cc8f6d5e [flang] Add a custom target for the "flang" wrapper script.
Differential Revision: https://reviews.llvm.org/D117768
2022-01-26 11:35:12 +03:00
Yury Gribov d3f5ef241a Add ieee_is_normal/ieee_is_negative to ieee_arithmetic module. 2022-01-26 11:33:23 +03:00
jacquesguan 267711e38b [RISCV] Fix support of vlen = 64.
In the Zve* extensions, the vlen could be 64. This patch change the vlen constraint of low bound to 64.

Differential Revision: https://reviews.llvm.org/D118217
2022-01-26 16:31:21 +08:00
Matthias Springer 18778b8863 [mlir] Fix merging of delayed registrations during DialectRegistry::appendTo
The existing implementation called DenseMap::insert, which is a no-op if the map already contains an entry with the same key.

Differential Revision: https://reviews.llvm.org/D118165
2022-01-26 17:28:42 +09:00
Marek Kurdej 72e29caf03 [clang-format] Fix regression in parsing pointers to arrays.
Fixes https://github.com/llvm/llvm-project/issues/53293.

After commit 5c2e7c9, the code:
```
template <> struct S : Template<int (*)[]> {};
```
was misformatted as:
```
template <> struct S : Template<int (*)[]>{};
```

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D118106
2022-01-26 09:27:38 +01:00
Kristof Beyls c816be2026 Add release note for aarch64-none-elf driver change. 2022-01-26 09:13:22 +01:00
Fangrui Song 3704abaa16 [ELF] --gdb-index: replace vector<uint8_t> with unique_ptr<uint8_t[]>. NFC 2022-01-25 23:53:23 -08:00
Valentin Clement 74acd744d3
[flang] Change getLoweredName to translateNameToFrontendMangledName()
getLoweredName() is not a well suited name change it to
translateNameToFrontendMangledName()

Reviewed By: schweitz

Differential Revision: https://reviews.llvm.org/D118140
2022-01-26 08:52:39 +01:00
Fangrui Song 571d6a7120 [ELF] Optimize .relr.dyn to not grow vector<uint64_t>. NFC 2022-01-25 23:33:40 -08:00
Qiu Chaofan f563bd74cb [NFC] Group PowerPC clang codegen tests into directory 2022-01-26 15:19:22 +08:00
Jim Lin da1cac7d19 [NFC] Remove duplicate include 2022-01-26 15:10:16 +08:00
Fangrui Song 9fac78d0e1 [ELF] Simplify and optimize .relr.dyn NFC 2022-01-25 22:50:03 -08:00
Yevgeny Rouban 4fb8e0b862 [JumpThreading] Add a test for handling zero !prof branch_weights
The test was a part of the revision D81499 and should have been
added with commit 707836ed4e.

Reviewed By: yamauchi, wenlei
Differential Revision: https://reviews.llvm.org/D81499
2022-01-26 13:42:21 +07:00
Fangrui Song 2a80c3dbe1 [ELF] Clarify that Z_BEST_SPEED==1 in a comment. NFC 2022-01-25 22:40:53 -08:00
Fangrui Song 07bd467643 [ELF] --build-id: replace vector<uint8_t> with unique_ptr<uint8_t[]>. NFC
We can't use C++20 make_unique_for_overwrite yet.
2022-01-25 22:39:43 -08:00
Fangrui Song 7438dbe078 [ELF] Cast size to size_t. NFC
To fix

../../chromeclang/bin/../include/c++/v1/__algorithm/min.h:39:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('unsigned long' vs. 'unsigned long long')

on macOS arm64.
2022-01-25 22:38:24 -08:00
Richard f0726ae0f9 Refactor: Extract Class MessagePrefix (NFC)
The work is the same, the only difference is the prefix
of the strings we look for in the reference files.
2022-01-25 23:19:33 -07:00
Rob Suderman 7c984be21a [mlir] Propagate arith.index_cast past tensor.extract
If we are extracting it is more useful to push the index_cast past the
extraction. This increases the chance the tensor.extract can evaluated at
compile time.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D118204
2022-01-25 22:16:07 -08:00
Fangrui Song 223f9dea3d [ELF] maybeCompress: replace vector<uint8_t> with unique_ptr<uint8_t[]>. NFC
And mention that it is zero-initialized. I do not notice a speed-up if
changed to be uninitialized by forcing the zero filler in writeTo.
2022-01-25 22:15:44 -08:00