Craig Topper [Thu, 23 Dec 2021 14:11:09 +0000 (08:11 -0600)]
[RISCV] Disable interleaving scalar loops in the loop vectorizer.
The loop vectorizer can interleave scalar loops even if it doesn't
vectorize them. I don't believe we intended to enable this when
we enabled interleaving for vector instructions.
Disable interleaving for VF=1 like X86 and AMDGPU already do. Test
lifted from AMDGPU.
Differential Revision: https://reviews.llvm.org/D115975
Simon Pilgrim [Thu, 23 Dec 2021 14:09:23 +0000 (14:09 +0000)]
[X86] isVectorShiftByScalarCheap - vXi8 select(shift(x,splat0),shift(x,splat1)) is better than shift(x,select(splat0,splat1))
Even though we don't have vXi8 vector shifts (apart from XOP), it is still better to prefer shift (or funnel-shift/rotate) by scalar where possible.
https://llvm.godbolt.org/z/6ss6ffTxv
Differential Revision: https://reviews.llvm.org/D116191
Nikita Popov [Thu, 23 Dec 2021 14:15:26 +0000 (15:15 +0100)]
[OpenMP] Remove no-op cast (NFC)
This was casting the address to its own element type, which is
a no-op.
Nikita Popov [Thu, 23 Dec 2021 13:58:47 +0000 (14:58 +0100)]
[CodeGen] Use CreateConstInBoundsGEP() in one more place
This does exactly what this code manually implemented.
Nikita Popov [Thu, 23 Dec 2021 13:41:03 +0000 (14:41 +0100)]
[CGBuilder] Add CreateGEP() overload that accepts an Address
Add an overload for an Address and a single non-constant offset.
This makes it easier to preserve the element type and adjust the
alignment appropriately.
Petar Avramovic [Thu, 23 Dec 2021 13:09:51 +0000 (14:09 +0100)]
[GlobalISel] Rework more/fewer elements for vectors
Artifact combiner is not able to access individual elements after using
LCMTy style merge/unmerge, extract and insert to change vector number of
elements (pad with undef or split to sub-vector instructions).
Use unmerge to individual elements instead and then merge elements into
requested types.
Change argument lowering for vectors and moreElementsVector to use
buildPadVectorWithUndefElements and buildDeleteTrailingVectorElements.
FewerElementsVector had a few helpers that had different behavior,
introduce new helper for most of the opcodes.
FewerElementsVector helper is more flexible since it can create leftover
instruction smaller then requested type (useful in case target wants to
avoid pad with undef and use fewer registers). If target does not want
leftover of different type it should call more elements first.
Some helpers were performing more elements first to have split without
leftover. Opcodes that used this helper use clampMaxNumElementsStrict
(does more elements first) in LegalizerInfo to avoid test changes.
Fixes failures caused by failing to combine artifacts created during
more/fewer elements vector.
Differential Revision: https://reviews.llvm.org/D114198
Petar Avramovic [Thu, 23 Dec 2021 11:39:38 +0000 (12:39 +0100)]
GlobalISel: Regen vector mir tests, add tests for vector arg lowering
Precommit for D114198 (Rework more/fewer elements for vectors).
Regenerate auto-generated mir tests for vectors (use CHECK-NEXT instead
of CHECK). Remove -global-isel-abort=0 where it is no longer needed.
Add mir tests for different AMDGPU sub-targets and they way they lower
function vector arguments (tests for legalization artifact combiner).
Simon Moll [Thu, 23 Dec 2021 13:14:29 +0000 (14:14 +0100)]
[VE] Add manuals to CompilerWriterInfo
Reference VE manual and documentations in CompilerWriterInfo.
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D116212
Chuanqi Xu [Thu, 23 Dec 2021 13:12:28 +0000 (21:12 +0800)]
[C++20] [Modules] Mark imported module as imported if not exported
In C++20 Modules, imported module which doesn't get exported wouldn't be
recorded. This patch would record such modules to avoid possible
incorrect visibility problems.
Reviewed By: urnathan
Differential Revision: https://reviews.llvm.org/D116098
Simon Moll [Thu, 23 Dec 2021 13:12:34 +0000 (14:12 +0100)]
[VE] Add VE support to update_llc_test_checks
Add VE assembly scrubbing and triple support to update_llc_test_checks.
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D116104
Chuanqi Xu [Thu, 23 Dec 2021 13:10:07 +0000 (21:10 +0800)]
Revert "[C++20] [Coroutines] Mark imported module as imported if not exported"
This reverts commit
368318bcce66d9fef420fc34cca361b79d80cee5.
The title is not right. It should be a patch about modules instead of
coroutines.
Chuanqi Xu [Thu, 23 Dec 2021 12:47:28 +0000 (20:47 +0800)]
[C++20] [Coroutines] Mark imported module as imported if not exported
In C++20 Modules, imported module which doesn't get exported wouldn't be
recorded. This patch would record such modules to avoid possible
incorrect visibility problems.
Reviewed By: urnathan
Differential Revision: https://reviews.llvm.org/D116098
Nikolas Klauser [Thu, 23 Dec 2021 11:21:00 +0000 (12:21 +0100)]
[libc++] Remove unused headers from <filesystem>
Remove unused headers from `<filesystem>`
Reviewed By: Quuxplusone, #libc, Mordante
Spies: Mordante, libcxx-commits
Differential Revision: https://reviews.llvm.org/D116146
Nikita Popov [Thu, 23 Dec 2021 12:00:46 +0000 (13:00 +0100)]
[CodeGen] Use correct element type for store to sret
sret is special in that it does not use the memory type
representation. Manually construct the LValue using ConvertType
instead of ConvertTypeForMem here.
This fixes matrix-lowering-opt-levels.c on s390x.
Nikolas Klauser [Thu, 23 Dec 2021 11:03:36 +0000 (12:03 +0100)]
[libc++] IWYU in <filesystem> tests
Add headers in `<filesystem>` tests that were transitively included
through `<filesystem>`
Reviewed as part of D116146
Nikolas Klauser [Thu, 23 Dec 2021 10:55:38 +0000 (11:55 +0100)]
Revert "[libc++] Remove unused headers from <filesystem>"
This reverts commit
352945dd36c64fd68b4c73fcc393ee5828da639a.
Jay Foad [Thu, 23 Dec 2021 10:19:27 +0000 (10:19 +0000)]
[AMDGPU] Remove a TODO that was done by D98081
Nikita Popov [Tue, 21 Dec 2021 14:28:45 +0000 (15:28 +0100)]
[CodeGen] Avoid pointer element type access when creating LValue
This required fixing two places that were passing the pointer type
rather than the expected pointee type to the method.
Fangrui Song [Thu, 23 Dec 2021 09:52:54 +0000 (01:52 -0800)]
[ELF] LTO: skip expensive usedStartStop initialization if bitcodeFiles.empty()
This may cost 1.3+% of total link time.
Fangrui Song [Thu, 23 Dec 2021 09:24:32 +0000 (01:24 -0800)]
[ELF] sortSections: delete unneeded outSecOff assignment
Related to D45368 but outSecOff is unneeded because resolveShfLinkOrder uses
stable_sort.
Muhammad Omair Javaid [Thu, 23 Dec 2021 09:08:37 +0000 (14:08 +0500)]
Revert "Revert "[DwarfDebug] Support emitting function-local declaration for a lexical block" & dependent patches"
This has broke following LLDB buildbots:
https://lab.llvm.org/buildbot/#/builders/17/builds/14984
https://lab.llvm.org/buildbot/#/builders/96/builds/15928
https://lab.llvm.org/buildbot/#/builders/68/builds/23600
This reverts commit
62a6b9e9ab3eb778111e90a34fee1e6a7c64db8a.
Fangrui Song [Thu, 23 Dec 2021 08:59:29 +0000 (00:59 -0800)]
[ELF] Optimize copyLocalSymbols. NFC
Nikita Popov [Thu, 23 Dec 2021 08:44:01 +0000 (09:44 +0100)]
[DSE] Add test for matrix store (NFC)
Nikita Popov [Thu, 23 Dec 2021 08:31:44 +0000 (09:31 +0100)]
[DSE] Regenerate test checks (NFC)
Nikita Popov [Thu, 23 Dec 2021 08:25:26 +0000 (09:25 +0100)]
[IR] Use default attributes for trampoline intrinsics
These intrinsics do not free, synchronize or diverge.
Nikita Popov [Wed, 22 Dec 2021 10:27:44 +0000 (11:27 +0100)]
[IR] Add memory attributes for init.trampoline
Based on my reading of https://llvm.org/docs/LangRef.html#llvm-init-trampoline-intrinsic,
init.trampoline writes to the first argument, while the other two
are readnone. These two arguments are only captured and written
into the trampoline memory. This also matches what I see in the
X86TargetLowering::LowerINIT_TRAMPOLINE() implementation.
Differential Revision: https://reviews.llvm.org/D116149
Nikita Popov [Wed, 22 Dec 2021 15:30:22 +0000 (16:30 +0100)]
[OpenMP] Fix incorrect type when casting from uintptr
MakeNaturalAlignAddrLValue() expects the pointee type, but the
pointer type was passed. As a result, the natural alignment of
the pointer (usually 8) was always used in place of the natural
alignment of the value type.
Differential Revision: https://reviews.llvm.org/D116171
Nikita Popov [Wed, 22 Dec 2021 16:23:10 +0000 (17:23 +0100)]
[JSONNodeDumper] Do not print mangled names for local variables (PR49111)
Mangled names are not meaningful for variables with local storage,
and may not be well defined (getting the mangled name for VLA
crashes the mangler). As such, do not include them in the JSON
dump.
This allows running update_cc_test_checks on some OpenMP tests again.
Fixes https://github.com/llvm/llvm-project/issues/49111.
Differential Revision: https://reviews.llvm.org/D116169
Fangrui Song [Thu, 23 Dec 2021 07:55:11 +0000 (23:55 -0800)]
Revert "[ELF] Make Partition/InStruct members unique_ptr and remove associate make<XXX>"
This reverts commit
e48b1c8a27f0fbd791edc8e45756b268caadfa66.
This reverts commit
d019de23a1d761225fdaf0c47394ba58143aea9a.
The changes caused memory leaks (non-final classes cannot use unique_ptr).
Andrew Browne [Thu, 23 Dec 2021 00:56:37 +0000 (16:56 -0800)]
[DFSan] Make dfsan_read_origin_of_first_taint public.
Makes origins easier to use with dfsan_read_label(addr, size).
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D116197
Marek Kurdej [Wed, 22 Dec 2021 19:41:20 +0000 (20:41 +0100)]
[clang-format] Fix wrong indentation after trailing requires clause.
Fixes https://github.com/llvm/llvm-project/issues/52834.
Before this patch, clang-format would wrongly parse top-level entities (e.g. namespaces) and format:
```
template<int I>
constexpr void foo requires(I == 42) {}
namespace ns {
void foo() {}
} // namespace ns
```
into:
``````
template<int I>
constexpr void foo requires(I == 42) {}
namespace ns {
void foo() {}
} // namespace ns
```
with configuration:
```
NamespaceIndentation: None
````
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D116183
Fangrui Song [Thu, 23 Dec 2021 06:30:07 +0000 (22:30 -0800)]
[ELF] Use SmallVector for some global variables (*Files and *Sections). NFC
My lld executable is 26+KiB smaller.
Azat Khuzhin [Thu, 23 Dec 2021 06:10:27 +0000 (22:10 -0800)]
[Sanitizer] Fix setbuffer() interceptor (it accept size, not mode)
Fixes:
0c81a62d9d76 ("[Sanitizer] Adding setvbuf in supported platforms and other stream buffer functions")
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D116176
Fangrui Song [Thu, 23 Dec 2021 06:02:29 +0000 (22:02 -0800)]
[ELF] Change nonnull pointer parameters to references
Tue Ly [Tue, 21 Dec 2021 19:19:03 +0000 (14:19 -0500)]
[libc] Add performance tests for hypotf and hypot.
Add performance tests for hypotf and hypot.
Reviewed By: sivachandra, michaelrj
Differential Revision: https://reviews.llvm.org/D116122
Fangrui Song [Thu, 23 Dec 2021 05:34:25 +0000 (21:34 -0800)]
[ELF] Make Partition members unique_ptr and remove associate make<XXX>
See D116143 for benefits. My lld executable (x86-64) is 103+KiB smaller.
Vitaly Buka [Thu, 23 Dec 2021 05:28:38 +0000 (21:28 -0800)]
[sanitizer] Support symbolize_inline_frames by addr2line
Vitaly Buka [Thu, 23 Dec 2021 04:06:35 +0000 (20:06 -0800)]
[NFC][sanitizer] Format the test
Vitaly Buka [Thu, 23 Dec 2021 03:34:04 +0000 (19:34 -0800)]
[NFC][sanitizer] Format a part of the file
Shivam Gupta [Thu, 23 Dec 2021 05:17:16 +0000 (10:47 +0530)]
[DAGCombiner] Avoid combining adjacent stores at -O0 to improve debug experience
When the source has a series of assignments, users reasonably want to
have the debugger step through each one individually. Turn off the combine
for adjacent stores so we get this behavior at -O0.
Similar to D7181.
Reviewed By: spatel, xgupta
Differential Revision: https://reviews.llvm.org/D115808
Fangrui Song [Thu, 23 Dec 2021 05:11:25 +0000 (21:11 -0800)]
[ELF] Make InStruct members unique_ptr and remove associate make<XXX>
See D116143 for benefits. My lld executable (x86-64) is 24+KiB smaller.
Fangrui Song [Thu, 23 Dec 2021 05:09:57 +0000 (21:09 -0800)]
[ELF] Change nonnull pointer parameters to references. NFC
Fangrui Song [Thu, 23 Dec 2021 04:51:11 +0000 (20:51 -0800)]
[ELF] Change some non-null pointer parameters to references. NFC
Phoebe Wang [Thu, 23 Dec 2021 04:44:33 +0000 (12:44 +0800)]
Revert "[X86][MS-InlineAsm] Use exact conditions to recognize MS global variables"
This reverts commit
682d01a1c1c52bd95d3d06267d6017395770256b.
Revert for buildbot fails.
Mehdi Amini [Thu, 23 Dec 2021 03:59:25 +0000 (03:59 +0000)]
Revert "Fix warning: "unused variable 'attrClass'" (NFC)"
This reverts commit
724e6861b3d64eb74ecd98eff88955c91a200940.
This broke the build.
Mehdi Amini [Wed, 22 Dec 2021 23:42:05 +0000 (23:42 +0000)]
Fix warning: "unused variable 'attrClass'" (NFC)
Phoebe Wang [Thu, 23 Dec 2021 02:35:46 +0000 (10:35 +0800)]
[X86][MS-InlineAsm] Use exact conditions to recognize MS global variables
D115225 tried to roll back the effects on symbols of MS inline asm
introduced by D113096. But the combination of the conditions cannot
match all the changes. As a result, there are still fails after the
patch.
This patch fixes the problem by checking the exact conditions for MS
global variables, i.e., variable (by FrontendSize != 0) + non rip/eip
(by DefaultBaseReg == 0), so that we can fully roll back for D113096.
Reviewed By: skan
Differential Revision: https://reviews.llvm.org/D116090
Philip Reames [Thu, 23 Dec 2021 03:35:42 +0000 (19:35 -0800)]
Add test coverage for D109917 and variants
Philip Reames [Thu, 23 Dec 2021 03:25:22 +0000 (19:25 -0800)]
Autogen a test in advance of another change
jacquesguan [Fri, 17 Dec 2021 09:28:27 +0000 (17:28 +0800)]
[RISCV] Override hasAndNotCompare to use more andn when have Zbb extension.
Enable transform (X & Y) == Y ---> (~X & Y) == 0 and (X & Y) != Y ---> (~X & Y) != 0 when have Zbb extension to use more andn instruction.
Differential Revision: https://reviews.llvm.org/D115922
Philip Reames [Thu, 23 Dec 2021 02:21:59 +0000 (18:21 -0800)]
[funcattrs] Use callsite param attributes from indirect calls when inferring access attributes
Arguments to an indirect call is by definition outside the SCC, but there's no reason we can't use locally defined facts on the call site. This also has the nice effect of further simplifying the code.
Differential Revision: https://reviews.llvm.org/D116118
Philip Reames [Thu, 23 Dec 2021 02:19:37 +0000 (18:19 -0800)]
[docs] Update new builder instructions to starting on the staging buildmaster
This adds a step in the instructions to switch to the production buildmaster at the very end (after explicit approval), and updates the early instruction to start with the builder pointed at the staging buildmaster.
Differential Revision: https://reviews.llvm.org/D116129
Fangrui Song [Thu, 23 Dec 2021 01:41:50 +0000 (17:41 -0800)]
[ELF] Replace LazyObjFile with lazy ObjFile/BitcodeFile
The new `lazy` state is the inverse of the previous `LazyObjFile::extracted`.
There are many advantages:
* previously when a LazyObjFile was extracted, a new ObjFile/BitcodeFile was created; now the file is reused, just with `lazy` cleared
* avoid the confusing transfer of `symbols` from LazyObjFile to the new file
* the `incompatible file:` diagnostic is unified with `is incompatible with`
* simpler code, smaller executable (6200+ bytes smaller on x86-64)
* make eager parsing feasible (for parallel section/symbol table initialization)
Nikolas Klauser [Wed, 22 Dec 2021 10:00:37 +0000 (11:00 +0100)]
[libc++] Remove unused headers from <filesystem>
Remove unused headers from `<filesystem>`
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D116146
Andrew Browne [Wed, 22 Dec 2021 20:35:42 +0000 (12:35 -0800)]
[DFSan] Add functions to print origin trace from origin id instead of address.
dfsan_print_origin_id_trace
dfsan_sprint_origin_id_trace
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D116184
Michael Jones [Fri, 12 Nov 2021 23:45:56 +0000 (15:45 -0800)]
[libc] add modified Eisel-Lemire for long doubles
The Eisel-Lemire algorithm is an effecient way to handle converting to
floating point numbers from strings, but in its base form it only
supports up to 64 bit floating point numbers. This adds an
implementation to handle long doubles.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D115280
Zequan Wu [Tue, 21 Dec 2021 00:18:25 +0000 (16:18 -0800)]
[LLDB][DWARF] Fix duplicate TypeSP in type list
Differential Revision: https://reviews.llvm.org/D115308
David Blaikie [Wed, 22 Dec 2021 22:29:41 +0000 (14:29 -0800)]
Revert "[DwarfDebug] Support emitting function-local declaration for a lexical block" & dependent patches
This patch causes invalid DWARF to be generated in some cases of LTO +
Split DWARF - follow-up on the original review thread (D113741) contains
further detail and test cases.
This reverts commit
75b622a7959479ccdb758ebe0973061b7b4fcacd.
This reverts commit
b6ccca217c35a95b8c2a337a7801b37cb23dbae2.
This reverts commit
514d37441918dd04a2cd4f35c08959d7c3ff096d.
alex-t [Wed, 22 Dec 2021 21:45:01 +0000 (00:45 +0300)]
[AMDGPU] Select build_vector DAG nodes according to the divergence
This change enables divergence-driven instruction selection for the build_vector DAG nodes.
It also enables packed i16 instructions for GFX9.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D116187
Arthur O'Dwyer [Wed, 22 Dec 2021 22:56:03 +0000 (17:56 -0500)]
[libc++] Remove "clang-format off/on" comments. NFC.
These headers have stabilized; we don't expect anyone to be
blindly clang-formatting them anymore.
Leave the comments in `__format/*.h` for Mark to remove at his leisure.
Vitaly Buka [Wed, 22 Dec 2021 22:12:19 +0000 (14:12 -0800)]
[NFC][sanitizer] Reformat script
Vitaly Buka [Wed, 22 Dec 2021 22:13:24 +0000 (14:13 -0800)]
[NFC][sanitizer] Reformat a part of the file
Siva Chandra Reddy [Wed, 22 Dec 2021 22:19:38 +0000 (22:19 +0000)]
[libc][Obvious] Add target OSUtil tests only if the target OS/arch match.
Fangrui Song [Wed, 22 Dec 2021 22:36:14 +0000 (14:36 -0800)]
[ELF] Change some global pointers to unique_ptr
Currently the singleton `config` is assigned by `config = make<Configuration>()`
and (if `canExitEarly` is false) destroyed by `lld::freeArena`.
`make<Configuration>` allocates a stab with `malloc(4096)`. This both wastes
memory and bloats the executable (every type instantiates `BumpPtrAllocator`
which costs more than 1KiB code on x86-64).
(No need to worry about `clang::no_destroy`. Regular invocations (`canExitEarly`
is true) call `_Exit` via llvm::sys::Process::ExitNoCleanup.)
Reviewed By: lichray
Differential Revision: https://reviews.llvm.org/D116143
Siva Chandra Reddy [Wed, 22 Dec 2021 18:17:50 +0000 (18:17 +0000)]
[libc] Move the x86_64 syscall functions to OSUtil.
Reviewed By: michaelrj, lntue
Differential Revision: https://reviews.llvm.org/D116177
Mircea Trofin [Wed, 22 Dec 2021 21:17:10 +0000 (13:17 -0800)]
[NFC][mlgo]Make the test model generator inlining-specific
When looking at building the generator for regalloc, we realized we'd
need quite a bit of custom logic, and that perhaps it'd be easier to
just have each usecase (each kind of mlgo policy) have it's own
stand-alone test generator.
This patch just consolidates the old `config.py` and
`generate_mock_model.py` into one file, and does away with
subdirectories under Analysis/models.
Salman Javed [Wed, 22 Dec 2021 21:18:45 +0000 (10:18 +1300)]
Resolve -Wdocumentation warning in ClangTidyDiagnosticConsumer (NFC)
Change to comments only; NFC.
```
ClangTidyDiagnosticConsumer.h:245:6: warning: '\param' command used in a
comment that is not attached to a function declaration [-Wdocumentation]
```
See this build for an example:
https://lab.llvm.org/buildbot/#/builders/109/builds/27293/steps/5/logs/warnings__702_
Marianne Mailhot-Sarrasin [Wed, 22 Dec 2021 21:11:23 +0000 (16:11 -0500)]
[DSE] Fix invalid removal of store instruction
Fix handling of alloc-like instructions in isGuaranteedLoopInvariant(). It was not valid when the 'KillingDef' was outside of the loop, while the 'CurrentDef' was inside the loop. In that case, the 'KillingDef' only overwrites the definition from the last iteration of the loop, and not the ones of all iterations. Therefor it does not make the 'CurrentDef' to be dead, and must not remove it.
Fixing issue : https://github.com/llvm/llvm-project/issues/52774
Reviewed by: Florian Hahn
Differential revision: https://reviews.llvm.org/D115965
Mogball [Wed, 22 Dec 2021 21:06:01 +0000 (21:06 +0000)]
[mlir] Add unit test for disabling canonicalizer patterns (NFC)
Mircea Trofin [Wed, 22 Dec 2021 20:54:37 +0000 (12:54 -0800)]
[NFC][mlgo]Rename a variable in TensorFlowCompile.cmake
Remaining var that had 'inlining' in name, despite being general-purpose
Mehdi Amini [Wed, 22 Dec 2021 00:19:53 +0000 (00:19 +0000)]
Fix more clang-tidy cleanups in mlir/ (NFC)
Krzysztof Parzyszek [Wed, 22 Dec 2021 19:29:36 +0000 (11:29 -0800)]
[Hexagon] Make conversions to vector predicate types explicit for builtins
HVX does not have load/store instructions for vector predicates (i.e. bool
vectors). Because of that, vector predicates need to be converted to another
type before being stored, and the most convenient representation is an HVX
vector.
As a consequence, in C/C++, source-level builtins that either take or
produce vector predicates take or return regular vectors instead. On the
other hand, the corresponding LLVM intrinsics do have boolean types that,
and so a conversion of the operand or the return value was necessary.
This conversion would happen inside clang's codegen, but was somewhat
fragile.
This patch changes the strategy: a builtin that takes a vector predicate
now really expects a vector predicate. Since such a predicate cannot be
provided via a variable, this builtin must be composed with other builtins
that either convert vector to a predicate (V6_vandvrt) or predicate to a
vector (V6_vandqrt).
For users using builtins defined in hvx_hexagon_protos.h there is no impact:
the conversions were added to that file. Other users will need to insert
- __builtin_HEXAGON_V6_vandvrt[_128B](V, -1) to convert vector V to a
vector predicate, or
- __builtin_HEXAGON_V6_vandqrt[_128B](Q, -1) to convert vector predicate Q
to a vector.
Builtins __builtin_HEXAGON_V6_vmaskedstore.* are a temporary exception to
that, but they are deprecated and should not be used anyway. In the future
they will either follow the same rule, or be removed.
Salman Javed [Wed, 22 Dec 2021 20:31:45 +0000 (09:31 +1300)]
Resolve lint warning about converting unsigned to signed (NFC)
FileOffset is unsigned while getLocWithOffset() requires a signed value.
Mogball [Wed, 22 Dec 2021 20:00:00 +0000 (20:00 +0000)]
[mlir] Add missing unit tests to BUILD.bazel
Several unit test folders were missing from the bazel build, including: Transforms, Conversion, Rewrite
Marianne Mailhot-Sarrasin [Wed, 22 Dec 2021 19:39:15 +0000 (14:39 -0500)]
[DSE] Add test case showing bug PR52774.
Pre-commiting the test case before the bug fix.
Reviewed by: Florian Hahn
Differential revision: https://reviews.llvm.org/D115965
Mogball [Wed, 22 Dec 2021 19:26:23 +0000 (19:26 +0000)]
[mlir] Update BUILD.bazel to include `scf_tests`
Michael Jones [Wed, 22 Dec 2021 19:24:02 +0000 (11:24 -0800)]
[libc][obvious] fix formatting mistake
I missed two instances of "SetUp" being replaced by "set_up" and
"TearDown" being replaced by "tear_down" when finalizing the formatting
change. This fixes that.
Differential Revision: https://reviews.llvm.org/D116178
Daniil Fukalov [Wed, 22 Dec 2021 19:33:57 +0000 (22:33 +0300)]
[NFC][AMDGPU][CostModel] Add tests for AMDGPU cost model, part 2.
Daniil Fukalov [Wed, 22 Dec 2021 19:32:09 +0000 (22:32 +0300)]
[NFC][AMDGPU][CostModel] Add tests for AMDGPU cost model.
Mogball [Wed, 22 Dec 2021 19:16:09 +0000 (19:16 +0000)]
[mlir] Fix missing namespace (NFC)
Stanislav Funiak [Wed, 22 Dec 2021 19:10:02 +0000 (19:10 +0000)]
[MLIR][PDL] Clear up the terminology in the root ordering graph.
Previously, we defined a struct named `RootOrderingCost`, which stored the cost (a pair consisting of the depth of the connector and a tie breaking ID), as well as the connector itself. This created some confusion, because we would sometimes write, e.g., `cost.cost.first` (the first `cost` referring to the struct, the second one referring to the `cost` field, and `first` referring to the depth). In order to address this confusion, here we rename `RootOrderingCost` to `RootOrderingEntry` (keeping the fields and their names as-is).
This clarification exposed non-determinism in the optimal branching algorithm. When choosing the best local parent, we were previuosly only considering its depth (`cost.first`) and not the tie-breaking ID (`cost.second`). This led to non-deterministic choice of the parent when multiple potential parents had the same depth. The solution is to compare both the depth and the tie-breaking ID.
Testing: Rely on existing unit tests. Non-detgerminism is hard to unit-test.
Reviewed By: rriddle, Mogball
Differential Revision: https://reviews.llvm.org/D116079
Mogball [Tue, 21 Dec 2021 01:18:14 +0000 (01:18 +0000)]
[mlir] Canonicalizer constructor should accept disabled/enabled patterns
There is no way to programmatically configure the list of disabled and enabled patterns in the canonicalizer pass, other than the duplicate the whole pass. This patch exposes the `disabledPatterns` and `enabledPatterns` options.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D116055
Michael Jones [Tue, 21 Dec 2021 21:12:45 +0000 (13:12 -0800)]
[libc] apply formatting to tests
Apply the formatting rules that were applied to the libc/src directory
to the libc/test directory, as well as the files in libc/utils that are
included by the tests. This does not include automated enforcement.
Reviewed By: sivachandra, lntue
Differential Revision: https://reviews.llvm.org/D116127
Simon Pilgrim [Wed, 22 Dec 2021 17:42:45 +0000 (17:42 +0000)]
Remove superfluous semicolon.
Missed by MSVC
LLVM GN Syncbot [Wed, 22 Dec 2021 17:34:39 +0000 (17:34 +0000)]
[gn build] Port
cb8a0b07974e
Arthur O'Dwyer [Tue, 14 Dec 2021 00:21:38 +0000 (19:21 -0500)]
[libc++] [ranges] Introduce _LIBCPP_AUTO_CAST(x) for auto(x).
Clang is gaining `auto(x)` support in D113393; sadly there
seems to be no feature-test macro for it. Zhihao is opening
a core issue for that macro.
Use `_LIBCPP_AUTO_CAST` where C++20 specifies we should use `auto(x)`;
stop using `__decay_copy(x)` in those places.
In fact, remove `__decay_copy` entirely. As of C++20, it's purely
a paper specification tool signifying "Return just `x`, but it was
perfect-forwarded, so we understand you're going to have to call
its move-constructor sometimes." I believe there's no reason we'd
ever need to do its operation explicitly in code.
This heisenbugs away a test failure on MinGW; see D112214.
Differential Revision: https://reviews.llvm.org/D115686
Adrian Kuegel [Wed, 22 Dec 2021 17:09:59 +0000 (18:09 +0100)]
[mlir][arith] Fix CmpIOP folding for vector types.
Previously, the folding assumed that it always operates on scalar types.
Differential Revision: https://reviews.llvm.org/D116151
Simon Pilgrim [Wed, 22 Dec 2021 16:57:44 +0000 (16:57 +0000)]
[DAG][X86] Add TargetLowering::isSplatValueForTargetNode override
Add callback to enable us to test target nodes if they are splat vectors
Added some basic X86ISD::VBROADCAST + X86ISD::VBROADCAST_LOAD handling
Ron Lieberman [Wed, 22 Dec 2021 16:39:28 +0000 (11:39 -0500)]
Revert "[AMDGPU] Move call clobbered return address registers s[30:31] to callee saved range"
This reverts commit
9075009d1fd5f2bf9aa6c2f362d2993691a316b3.
Failed amdgpu runtime buildbot # 3514
Jeremy Morse [Wed, 22 Dec 2021 16:13:29 +0000 (16:13 +0000)]
[Clang][DebugInfo] Cease turning instruction-referencing off by default
Over in D114631 I turned this debug-info feature on by default, for x86_64
only. I'd previously stripped out the clang cc1 option that controlled it
in
651122fc4ac, unfortunately that turned out to not be completely
effective, and the two things deleted in this patch continued to keep it
off-by-default. Oooff.
As a follow-up, this patch removes the last few things to do with
ValueTrackingVariableLocations from clang, which was the original purpose
of D114631. In an ideal world, if this patch causes you trouble you'd
revert
3c045070882f instead, which was where this behaviour was supposed
to start being the default, although that might not be practical any more.
Shilei Tian [Wed, 22 Dec 2021 16:24:06 +0000 (11:24 -0500)]
[NFC][Clang] Move function implementation of `OpenMPAtomicUpdateChecker` into anonymous namespace
Just to keep code consistent as `OpenMPAtomicUpdateChecker` is defined
in anonymous namespace.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D116068
Nikita Popov [Wed, 22 Dec 2021 16:11:48 +0000 (17:11 +0100)]
[OpenMP] Regenerate test checks (NFC)
Regenerate test checks to reduce diff for an upcoming patch.
Nikita Popov [Wed, 22 Dec 2021 15:55:56 +0000 (16:55 +0100)]
[JSONNodeDumper] Regenerate test checks (NFC)
gen_ast_dump_json_test.py adds these lines of whitespace. Precommit
it to avoid spurious diffs in future changes.
Ivan Gerasimov [Wed, 22 Dec 2021 15:33:09 +0000 (16:33 +0100)]
[clang-tidy] abseil-string-find-startswith: detect `s.rfind(z, 0) == 0`
Suggest converting `std::string::rfind()` calls to `absl::StartsWith()`
where possible.
Arthur O'Dwyer [Thu, 16 Dec 2021 03:10:34 +0000 (22:10 -0500)]
[libc++] [ranges] Remove the static_assert from ranges::begin and ranges::end.
As discussed with ldionne. The problem with this static_assert
is that it makes ranges::begin a pitfall for anyone ever to use
inside a constraint or decltype. Many Ranges things, such as ranges::size,
are specified as "Does X if X is well-formed, or else Y if Y is well-formed,
or else `ranges::end(t) - ranges::begin(t)` if that is well-formed, or else..."
And if there's a static_assert hidden inside `ranges::begin(t)`, then you get
a hard error as soon as you ask the question -- even if the answer would have
been "no, that's not well-formed"!
Constraining on `requires { t + 0; }` or `requires { t + N; }` is verboten
because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103700 . For ranges::begin,
we can just decay to a pointer even in the incomplete-type case. For ranges::end,
we can safely constrain on `sizeof(*t)`. Yes, this means that an array of incomplete
type has a `ranges::begin` but no `ranges::end`... just like an unbounded array of
complete type. This is a valid manifestation of IFNDR.
All of the new libcxx/test/std/ cases are mandatory behavior, as far as I'm aware.
Tests for the IFNDR cases in ranges::begin and ranges::end remain in `libcxx/test/libcxx/`.
The similar tests for ranges::empty and ranges::data were simply wrong, AFAIK.
Differential Revision: https://reviews.llvm.org/D115838
RamNalamothu [Wed, 22 Dec 2021 13:02:52 +0000 (18:32 +0530)]
[AMDGPU] Move call clobbered return address registers s[30:31] to callee saved range
Currently the return address ABI registers s[30:31], which fall in the call
clobbered register range, are added as a live-in on the function entry to
preserve its value when we have calls so that it gets saved and restored
around the calls.
But the DWARF unwind information (CFI) needs to track where the return address
resides in a frame and the above approach makes it difficult to track the
return address when the CFI information is emitted during the frame lowering,
due to the involvment of understanding the control flow.
This patch moves the return address ABI registers s[30:31] into callee saved
registers range and stops adding live-in for return address registers, so that
the CFI machinery will know where the return address resides when CSR
save/restore happen during the frame lowering.
And doing the above poses an issue that now the return instruction uses undefined
register `sgpr30_sgpr31`. This is resolved by hiding the return address register
use by the return instruction through the `SI_RETURN` pseudo instruction, which
doesn't take any input operands, until the `SI_RETURN` pseudo gets lowered to the
`S_SETPC_B64_return` during the `expandPostRAPseudo()`.
As an added benefit, this patch simplifies overall return instruction handling.
Note: The AMDGPU CFI changes are there only in the downstream code and another
version of this patch will be posted for review for the downstream code.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D114652
Michał Górny [Sat, 18 Dec 2021 09:09:12 +0000 (10:09 +0100)]
[lldb] [Process/FreeBSDKernel] Introduce libkvm support
Introduce initial support for using libkvm on FreeBSD. The library
can be used as an alternate implementation for processing kernel
coredumps but it can also be used to access live kernel memory through
specifying "/dev/mem" as the core file, i.e.:
lldb --core /dev/mem /boot/kernel/kernel
Differential Revision: https://reviews.llvm.org/D116005
Alok Kumar Sharma [Wed, 22 Dec 2021 14:26:37 +0000 (19:56 +0530)]
[clang][OpenMP][DebugInfo] Debug support for variables in shared clause of OpenMP task construct
Currently variables appearing inside shared clause of OpenMP task construct
are not visible inside lldb debugger.
After the current patch, lldb is able to show the variable
```
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x0000000000400934 a.out`.omp_task_entry. [inlined] .omp_outlined.(.global_tid.=0, .part_id.=0x000000000071f0d0, .privates.=0x000000000071f0e8, .copy_fn.=(a.out`.omp_task_privates_map. at testshared.cxx:8), .task_t.=0x000000000071f0c0, __context=0x000000000071f0f0) at testshared.cxx:10:34
7 else {
8 #pragma omp task shared(svar) firstprivate(n)
9 {
-> 10 printf("Task svar = %d\n", svar);
11 printf("Task n = %d\n", n);
12 svar = fib(n - 1);
13 }
(lldb) p svar
(int) $0 = 9
```
Reviewed By: djtodoro
Differential Revision: https://reviews.llvm.org/D115510
Nikita Popov [Wed, 22 Dec 2021 13:43:52 +0000 (14:43 +0100)]
[msan] Break optimization in memccpy tests
After D116148 the memccpy gets optimized away and the expected
uninitialized memory access does not occur.
Make sure the call does not get optimized away.
Martin Storsjö [Wed, 8 Dec 2021 18:54:21 +0000 (20:54 +0200)]
[libc++] Add from-scratch testing configs for Windows
The paths to the compiler and to the python executable may need to
be quoted (if they're installed into e.g. C:\Program Files).
All testing commands that are executed expect a gcc compatible command
line interface, while clang-cl uses different command line options.
In the original testing config, if the chosen compiler was clang-cl, it
was replaced with clang++ by looking for such an executable in the path.
For the new from-scratch test configs, I instead chose to add
"--driver-mode=g++" to flags - invoking "clang-cl --driver-mode=g++"
has the same effect as invoking "clang++", without needing to run any
heuristics for picking a different compiler executable.
Differential Revision: https://reviews.llvm.org/D111202