Nikita Popov [Thu, 2 Dec 2021 08:13:20 +0000 (09:13 +0100)]
[GlobalOpt] Add test for PR39751 (NFC)
This has been fixed by D114889, as noted in the comments.
mydeveloperday [Thu, 2 Dec 2021 08:05:30 +0000 (08:05 +0000)]
[clang-format] Add better support for co-routinues
Responding to a Discord call to help {D113977} and heavily inspired by the unlanded {D34225} add some support to help coroutinues from not being formatted from
```for co_await(auto elt : seq)```
to
```
for
co_await(auto elt : seq)
```
Because of the dominance of clang-format in the C++ community, I don't think we should make it the blocker that prevents users from embracing the newer parts of the standard because we butcher the layout of some of the new constucts.
Reviewed By: HazardyKnusperkeks, Quuxplusone, ChuanqiXu
Differential Revision: https://reviews.llvm.org/D114859
Vitaly Buka [Thu, 2 Dec 2021 07:55:04 +0000 (23:55 -0800)]
[NFC][sanitizer] Check &real_pthread_join
It's a weak function which may be undefined.
Jon Chesterfield [Thu, 2 Dec 2021 07:57:01 +0000 (07:57 +0000)]
[openmp][amdgpu] Disable three tests in preparation for new runtime
David Green [Thu, 2 Dec 2021 07:56:27 +0000 (07:56 +0000)]
[ARM] Teach getIntImmCostInst about the cost of saturating fp converts
Given a min(max(fptosi, INT_MIN), INT_MAX) with the correct constants,
we can now generate a fptosi.sat. But in the arm backend, the constant
can be treated as high cost, pulling it out of the basic block in a way
that the DAG combine can no longer see it. This teaches it again that it
is a low cost constant, not worth hoisting out.
Recommitted from
0e98659ea1193c with a fix for APInt comparison.
Differential Revision: https://reviews.llvm.org/D114380
Lang Hames [Tue, 30 Nov 2021 03:46:15 +0000 (14:46 +1100)]
[ORC] Add support for removing JITDylibs.
This allows JITDylibs to be removed from the ExecutionSession. Calling
ExecutionSession::removeJITDylib will disconnect the JITDylib from the
ExecutionSession and clear it (removing all trackers associated with it). The
JITDylib object will then be destroyed as soon as the last JITDylibSP pointing
at it is destroyed.
Lang Hames [Fri, 26 Nov 2021 01:13:11 +0000 (12:13 +1100)]
[ORC] Only use JITDylib::GeneratorsMutex while running generators.
GeneratorsMutex should prevent lookups from proceeding through the
generators of a single JITDylib concurrently (since this could
result in redundant attempts to generate definitions). Mutation of
the generators list itself should be done under the session lock.
Lang Hames [Wed, 1 Dec 2021 23:48:50 +0000 (10:48 +1100)]
[ORC] Hold ResourceTracker in MaterializationResponsibility.
This keeps the tracker alive for the lifetime of the MR. This is needed so that
we can check whether the tracker has become defunct before posting results (or
failure) for the MR.
Austin Kerbow [Wed, 10 Nov 2021 17:59:31 +0000 (09:59 -0800)]
[AMDGPU] Set most sched model resource's BufferSize to one
Using a BufferSize of one for memory ProcResources will result in better
ILP since it more accurately models the dependencies between memory ops
and their consumers on an in-order processor. After this change, the
scheduler will treat the data edges from loads as blocking so that
stalls are guaranteed when waiting for data to be retreaved from memory.
Since we don't actually track waitcnt here, this should do a better job
at modeling their behavior.
Practically, this means that the scheduler will trigger the 'STALL'
heuristic more often.
This type of change needs to be evaluated experimentally. Preliminary
results are positive.
Fixes: SWDEV-282962
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D114777
skc7 [Wed, 1 Dec 2021 06:12:57 +0000 (06:12 +0000)]
[AMDGPU][clang] Fix __builtin_nontemporal_store() failure on AMDGPU
Reviewed By: yaxunl, sameerds
Differential Revision: https://reviews.llvm.org/D114849
Phoebe Wang [Thu, 2 Dec 2021 05:11:07 +0000 (13:11 +0800)]
[X86][FP16] Only generate approximate rsqrt when Reciprocal is true for half type
We have reasonable fast sqrt and accurate rsqrt for half type due to the
limited fractions. So neither do we need multi steps refinement for
rsqrt nor replace sqrt by rsqrt.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D114844
Phoebe Wang [Thu, 2 Dec 2021 05:10:57 +0000 (13:10 +0800)]
[X86] Insert FMUL for estimated non reciprocal SQRT when `RefinementSteps` = 0
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D114843
Jonas Devlieghere [Thu, 2 Dec 2021 05:33:40 +0000 (21:33 -0800)]
[lldb] Skip test_launch_scripted_process_stack_frames with ASan
This test is failing on the sanitized bot because of a
heap-use-after-free. Disabling the test to turn the bot
green again.
rdar://
85954489.
Igor Kudrin [Thu, 2 Dec 2021 05:10:07 +0000 (12:10 +0700)]
[ELF] Prevent internalizing used comdat symbol
When a comdat symbol is defined in both bitcode and regular object
files, which are contained in the same archive, the linker could lose
the flag that the symbol is used in the regular object file and allow
LTO to internalize it, which led to "error: undefined symbol".
The issue was introduced in D79300.
Differential Revision: https://reviews.llvm.org/D114801
Jacques Pienaar [Thu, 2 Dec 2021 04:45:08 +0000 (20:45 -0800)]
[mlir][drr] Simple heuristic to reduce chance of accidental nullptr dereference
When an attribute is optional & is given an additional constraint in
rewrite pattern that could lead to dereferencing null Attribute. Avoid
cases where the constraints checks attribute but has no check if null.
This should be improved to be more uniformly guarded.
Christudasan Devadasan [Sat, 18 Sep 2021 06:46:02 +0000 (02:46 -0400)]
[AMDGPU] Add a regclass flag for scalar registers
Along with vector RC flags, this scalar flag will
make various regclass queries like `isVGPR` more
accurate.
Regclasses other than vectors are currently set
with the new flag even though certain unallocatable
classes aren't truly scalars. It would be ok as long
as they remain unallocatable.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D110053
Joe Loser [Wed, 3 Nov 2021 22:45:04 +0000 (18:45 -0400)]
[libc++] Implement P1989R2: range constructor for string_view
Implement P1989R2 which adds a range constructor for `string_view`.
Adjust `operator/=` in `path` to avoid atomic constraints caching issue
getting provoked from this PR.
Add defaulted template argument to `string_view`'s "sufficient
overloads" to avoid mangling issues in `clang-cl` builds. It is a
MSVC mangling bug that this works around.
Differential Revision: https://reviews.llvm.org/D113161
Vitaly Buka [Thu, 2 Dec 2021 04:06:31 +0000 (20:06 -0800)]
[NFC][sanitizer] Fix "not used" warning in test
Jonas Devlieghere [Thu, 2 Dec 2021 04:01:45 +0000 (20:01 -0800)]
[lldb] Fix DYLD_INSERT_LIBRARIES on AS
Don't make DYLD_INSERT_LIBRARIES conditional on the host triple
containing x86.
Philip Reames [Thu, 2 Dec 2021 03:48:21 +0000 (19:48 -0800)]
[tests] Precommit tests for writeonly argument attribute inference
Matthias Springer [Thu, 2 Dec 2021 02:57:26 +0000 (11:57 +0900)]
[mlir][linalg][bufferize] Bufferization of tensor.insert
This is a lightweight operation, useful for writing unit tests. It will be utilized for testing in subsequent commits.
Differential Revision: https://reviews.llvm.org/D114693
Kevin Athey [Thu, 2 Dec 2021 00:13:22 +0000 (16:13 -0800)]
Revert "[VE] Make VE official"
Breaks fast buildbot.
This reverts commit
a9d1d00b865ab6f6e75dcd649362a7c5cf01d168.
Daniel Sanders [Thu, 2 Dec 2021 00:15:53 +0000 (16:15 -0800)]
[unroll] Fix a functional change in an NFC patch
5c77aa2b917c [unroll] Use early return in shouldFullUnroll [nfc]
wasn't quite NFC since !(x <= y) is x > y rather than x >= y
Credit to Justin Bogner for spotting the bug
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D114894
Steven Wan [Thu, 2 Dec 2021 01:20:09 +0000 (20:20 -0500)]
Revert "[sanitizer] Add compress_stack_depot flag"
This is failing on clang-s390x-linux,
https://lab.llvm.org/buildbot/#/builders/94/builds/6748.
This reverts commit
bf18253b0ee543f98119e5ab6a5b57d05c24d314.
Julian Lettner [Thu, 2 Dec 2021 00:58:36 +0000 (16:58 -0800)]
[TSan][Darwin] Prevent inlining of functions in tests
Prevent inlining of functions so we can FileCheck the generated stack
traces.
Jonas Devlieghere [Thu, 2 Dec 2021 00:58:13 +0000 (16:58 -0800)]
[lldb] Split TestCxxChar8_t
Split TestCxxChar8_t into two parts: one that check reading variables
without a process and another part with. This allows us to skip the
former on Apple Silicon, where lack of support for chained fix-ups
causes the test to fail.
Differential revision: https://reviews.llvm.org/D114819
Fabian Wolff [Thu, 2 Dec 2021 00:34:31 +0000 (01:34 +0100)]
[clang-tidy] Use `hasCanonicalType()` matcher in `bugprone-unused-raii` check
Fixes PR#52217.
Reviewed By: simon.giesecke
Differential Revision: https://reviews.llvm.org/D113429
LLVM GN Syncbot [Thu, 2 Dec 2021 00:48:10 +0000 (00:48 +0000)]
[gn build] Port
170783f991fa
Noah Shutty [Wed, 1 Dec 2021 23:46:57 +0000 (23:46 +0000)]
[llvm] [Support] Add HTTP Client Support library.
This patch implements a small HTTP client library consisting primarily of the `HTTPRequest`, `HTTPResponseHandler`, and `BufferedHTTPResponseHandler` classes. Unit tests of the `HTTPResponseHandler` and `BufferedHTTPResponseHandler` are included.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D112751
Julian Lettner [Wed, 1 Dec 2021 23:49:40 +0000 (15:49 -0800)]
[TSan][Darwin] Mark test unsupported
Arthur Eubanks [Sat, 13 Nov 2021 00:05:31 +0000 (16:05 -0800)]
[llvm-reduce] Assert that the number of chunks does not change with reductions
Followup to D113537.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D113816
Arthur Eubanks [Fri, 12 Nov 2021 23:48:31 +0000 (15:48 -0800)]
[Cloning] Clone metadata on function declarations
Previously we missed cloning metadata on function declarations because
we don't call CloneFunctionInto() on declarations in CloneModule().
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D113812
LLVM GN Syncbot [Wed, 1 Dec 2021 23:31:02 +0000 (23:31 +0000)]
[gn build] Port
7cc2493daaf5
spupyrev [Wed, 1 Dec 2021 23:29:35 +0000 (15:29 -0800)]
profi - a flow-based profile inference algorithm: Part I (out of 3)
The benefits of sampling-based PGO crucially depends on the quality of profile
data. This diff implements a flow-based algorithm, called profi, that helps to
overcome the inaccuracies in a profile after it is collected.
Profi is an extended and significantly re-engineered classic MCMF (min-cost
max-flow) approach suggested by Levin, Newman, and Haber [2008, Complementing
missing and inaccurate profiling using a minimum cost circulation algorithm]. It
models profile inference as an optimization problem on a control-flow graph with
the objectives and constraints capturing the desired properties of profile data.
Three important challenges that are being solved by profi:
- "fixing" errors in profiles caused by sampling;
- converting basic block counts to edge frequencies (branch probabilities);
- dealing with "dangling" blocks having no samples in the profile.
The main implementation (and required docs) are in SampleProfileInference.cpp.
The worst-time complexity is quadratic in the number of blocks in a function,
O(|V|^2). However a careful engineering and extensive evaluation shows that
the running time is (slightly) super-linear. In particular, instances with
1000 blocks are solved within 0.1 second.
The algorithm has been extensively tested internally on prod workloads,
significantly improving the quality of generated profile data and providing
speedups in the range from 0% to 5%. For "smaller" benchmarks (SPEC06/17), it
generally improves the performance (with a few outliers) but extra work in
the compiler might be needed to re-tune existing optimization passes relying on
profile counts.
UPD Dec 1st 2021:
- synced the declaration and definition of the option `SampleProfileUseProfi ` to use type `cl::opt<bool`;
- added `inline` for `SampleProfileInference<BT>::findUnlikelyJumps` and `SampleProfileInference<BT>::isExit` to avoid linking problems on windows.
Reviewed By: wenlei, hoy
Differential Revision: https://reviews.llvm.org/D109860
Konstantin Boyarinov [Wed, 1 Dec 2021 23:04:17 +0000 (02:04 +0300)]
[libcxx][test][NFC] Various tests for std::vector
Add missing tests for std::vector funcionality to improve code coverage:
- Rewrote access tests to check modification of the container using
the reference returned by the non-const overload
- Added tests for reverse iterators: rbegin, rend, etc.
- Added exception test for vector::reserve
- Extended test cases for vector copy assignment
- Fixed insert_iter_value.pass.cpp to use insert overload with const
value_type& (not with value_type&& which is tested in
iter_rvalue.pass.cpp test)
Reviewed By: Quuxplusone, rarutyun, #libc
Differential Revision: https://reviews.llvm.org/D112438
Vitaly Buka [Wed, 1 Dec 2021 22:49:14 +0000 (14:49 -0800)]
[sanitizer] Implement MprotectReadOnly and MprotectNoAccess
MprotectReadOnly for Win and Fuchsia
MprotectNoAccess for Fuchsia
Nikolas Klauser [Tue, 30 Nov 2021 11:02:04 +0000 (12:02 +0100)]
[libc++] Make __wrap_iter constexpr
`__wrap_iter` is currently only constexpr if it's not a debug built, but it isn't used in a constexpr context currently. Making it always constexpr and disabling the debugging utilities at constant evaluation is more usful since it has to be always constexpr to be used in a constexpr context.
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D114733
Vitaly Buka [Wed, 1 Dec 2021 20:35:29 +0000 (12:35 -0800)]
[NFC][sanitizer] constexpr in sanitizer_dense_map_info
Kazu Hirata [Wed, 1 Dec 2021 21:43:17 +0000 (13:43 -0800)]
[mlir] Remove extractVectorTypeFromShapedValue
This patch fixes the build by removing
extractVectorTypeFromShapedValue. The last use was removed Dec 1,
2021 in commit extractVectorTypeFromShapedValue.
Peter Klausler [Wed, 1 Dec 2021 00:21:11 +0000 (16:21 -0800)]
[flang] Don't close stderr in runtime (fixes STOP output)
STOP statement output was sometimes failing to appear because
the runtime flushes and shuts down open Fortran units beforehand.
But when file descriptor 2 was closed, the STOP statement output
was suppressed. The fix is to not actually close file descriptors
0-2 if they are connected to Fortran units being closed. This was
already the policy when an OPEN statement was (re-)opening such a
unit, so that logic has been pulled out into a member function and
shared with CLOSE processing.
Differential Revision: https://reviews.llvm.org/D114897
Gabor Marton [Wed, 1 Dec 2021 15:47:22 +0000 (16:47 +0100)]
[Analyzer][solver] Simplification: Do a fixpoint iteration before the eq class merge
This reverts commit
f02c5f3478318075d1a469203900e452ba651421 and
addresses the issue mentioned in D114619 differently.
Repeating the issue here:
Currently, during symbol simplification we remove the original member
symbol from the equivalence class (`ClassMembers` trait). However, we
keep the reverse link (`ClassMap` trait), in order to be able the query
the related constraints even for the old member. This asymmetry can lead
to a problem when we merge equivalence classes:
```
ClassA: [a, b] // ClassMembers trait,
a->a, b->a // ClassMap trait, a is the representative symbol
```
Now let,s delete `a`:
```
ClassA: [b]
a->a, b->a
```
Let's merge ClassA into the trivial class `c`:
```
ClassA: [c, b]
c->c, b->c, a->a
```
Now, after the merge operation, `c` and `a` are actually in different
equivalence classes, which is inconsistent.
This issue manifests in a test case (added in D103317):
```
void recurring_symbol(int b) {
if (b * b != b)
if ((b * b) * b * b != (b * b) * b)
if (b * b == 1)
}
```
Before the simplification we have these equivalence classes:
```
trivial EQ1: [b * b != b]
trivial EQ2: [(b * b) * b * b != (b * b) * b]
```
During the simplification with `b * b == 1`, EQ1 is merged with `1 != b`
`EQ1: [b * b != b, 1 != b]` and we remove the complex symbol, so
`EQ1: [1 != b]`
Then we start to simplify the only symbol in EQ2:
`(b * b) * b * b != (b * b) * b --> 1 * b * b != 1 * b --> b * b != b`
But `b * b != b` is such a symbol that had been removed previously from
EQ1, thus we reach the above mentioned inconsistency.
This patch addresses the issue by making it impossible to synthesise a
symbol that had been simplified before. We achieve this by simplifying
the given symbol to the absolute simplest form.
Differential Revision: https://reviews.llvm.org/D114887
Florian Hahn [Wed, 1 Dec 2021 21:18:19 +0000 (21:18 +0000)]
[TLI] Add memset_pattern4, memset_pattern8 lib functions.
Similar to memset_pattern16, memset_pattern4, memset_pattern8 are
available on Darwin platforms.
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/memset_pattern4.3.html
Reviewed By: ab
Differential Revision: https://reviews.llvm.org/D114881
LLVM GN Syncbot [Wed, 1 Dec 2021 20:41:34 +0000 (20:41 +0000)]
[gn build] Port
a0efb1750065
Christopher Di Bella [Wed, 1 Dec 2021 01:36:32 +0000 (01:36 +0000)]
[libcxx][modularisation] modularises <numeric> header
Differential Revision: https://reviews.llvm.org/D114836
Petar Avramovic [Wed, 1 Dec 2021 16:39:39 +0000 (17:39 +0100)]
AMDGPU/GlobalISel: Fix constant bus restriction errors for med3
Detected on targets older then gfx10 (e.g. gfx9) for constants that are
too large to be inlined (constant are sgpr by default).
In med3 combine it is expected that regbankselect maps all operands of
min/max we try to match to vgpr. However constants are mapped to sgpr
and there will be a sgpr-to-vgpr copy. Matchers look through sgpr-to-vgpr
copies and return sgpr and these break constant bus restriction.
Build med3 with all vgpr operands. Use existing sgpr-to-vgpr copies for
matched sgprs. If there is no such copy (not expected) build one.
Differential Revision: https://reviews.llvm.org/D114700
Paul Robinson [Tue, 23 Nov 2021 18:24:29 +0000 (10:24 -0800)]
[TLI checker] Update for post-commit review comments
Ignore undefined symbols; other minor code cleanup.
Replace test objects and their asm source with a yaml equivalent.
Differential Revision: https://reviews.llvm.org/D114478
Florian Hahn [Wed, 1 Dec 2021 20:30:15 +0000 (20:30 +0000)]
[DSE] Add libcall tests for functions only available on Darwin.
Add a set of tests for memset_pattern{4,8,16} variants.
Fabian Wolff [Wed, 1 Dec 2021 20:28:01 +0000 (15:28 -0500)]
Fix false positives in `fuchsia-trailing-return` check involving deduction guides
Fixes PR#47614. Deduction guides, implicit or user-defined, look like
function declarations in the AST. They aren't really functions, though,
and they always have a trailing return type, so it doesn't make sense
to issue this warning for them.
Nikita Popov [Sat, 23 Oct 2021 15:23:56 +0000 (17:23 +0200)]
[GlobalOpt] Simplify CleanupConstantGlobalUsers()
This bases the CleanupConstantGlobalUsers() implementation around
the ConstantFoldLoadFromConst() API. The general approach is that
we discover all users while looking through casts, and then
constant fold loads and drop stores and memintrinsics.
This avoids special cases and limitations in the previous
implementation, which is also incompatible with opaque pointers.
The result is a bit more powerful than before, because we now use
more general load folding logic which can for example look through
pointer bitcasts between different sizes. This is where the test
changes come from, as we now fold more loads and can thus remove
more globals.
Differential Revision: https://reviews.llvm.org/D114889
Arthur O'Dwyer [Fri, 26 Nov 2021 19:24:36 +0000 (14:24 -0500)]
[libc++] [test] Refactor string_view comparison tests for comprehensiveness.
Differential Revision: https://reviews.llvm.org/D114658
Arthur O'Dwyer [Mon, 29 Nov 2021 19:56:00 +0000 (14:56 -0500)]
[libc++] [test] C++14/17-friendly `TEST_IS_CONSTANT_EVALUATED` macro.
Reviewed as part of D114658.
Ultimately this will probably have to be flipped around and renamed
`TEST_IS_RUNTIME`, and extended with `TEST_IS_RUNTIME_OR_CXX20` (once
constexpr std::string support is added) and so on for every new C++
version. But we don't need that flexibility yet, so we're not adding it.
Arthur O'Dwyer [Fri, 26 Nov 2021 20:17:21 +0000 (15:17 -0500)]
[libc++] [test] C++03-friendly MAKE_STRING macro.
Reviewed as part of D114658.
Konstantin Varlamov [Wed, 1 Dec 2021 19:55:46 +0000 (11:55 -0800)]
[libcxx][NFC] Make sequence containers slightly more SFINAE-friendly during CTAD.
Disable the constructors taking `(size_type, const value_type&,
allocator_type)` if `allocator_type` is not a valid allocator.
Otherwise, these constructors are considered when resolving e.g.
`(int*, int*, NotAnAllocator())`, leading to a hard error during
instantiation. A hard error makes the Standard's requirement to not
consider deduction guides of the form `(Iterator, Iterator,
BadAllocator)` during overload resolution essentially non-functional.
The previous approach was to SFINAE away `allocator_traits`. This patch
SFINAEs away the specific constructors instead, for consistency with
`basic_string` -- see [LWG3076](wg21.link/lwg3076) which describes
a very similar problem for strings (note, however, that unlike LWG3076,
no valid constructor call is affected by the bad instantiation).
Differential Revision: https://reviews.llvm.org/D114311
Ellis Hoag [Wed, 1 Dec 2021 19:46:18 +0000 (11:46 -0800)]
[InstrProf][NFC] Refactor ProfileDataMap usage
Instead of using `DenseMap::find()` and `DenseMap::insert()`, use
`DenseMap::operator[]` to get a reference to the profile data and update
the reference. This simplifies the changes in D114565.
Reviewed By: kyulee
Differential Revision: https://reviews.llvm.org/D114828
Craig Topper [Wed, 1 Dec 2021 18:46:30 +0000 (10:46 -0800)]
[RISCV] Add inline expansion for vector ftrunc/fceil/ffloor.
This prevents scalarization of fixed vector operations or crashes
on scalable vectors.
We don't have direct support for these operations. To emulate
ftrunc we can convert to the same sized integer and back to fp using
round to zero. We don't need to do a convert if the value is large
enough to have no fractional bits or is a nan.
The ceil and floor lowering would be better if we changed FRM, but
we don't model FRM correctly yet. So I've used the trunc lowering
with a conditional add or subtract with 1.0 if the truncate rounded
in the wrong direction.
There are also missed opportunities to use masked instructions.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D113543
Peter Klausler [Fri, 26 Nov 2021 21:26:50 +0000 (13:26 -0800)]
[flang] Adjust names in Semantics that imply too much (NFC)
Some kinds of Fortran arrays are declared with the same syntax,
and it is impossible to tell from a shape (:, :) or (*) whether
the object is assumed shape, deferred shape, assumed size, implied
shape, or whatever without recourse to more information about the
symbol in question. This patch softens the names of some predicate
functions (IsAssumedShape to CanBeAssumedShape) and makes others
more reflective of the syntax they represent (isAssumed to isStar)
in an attempt to encourage coders to seek and find definitive
predicate functions whose names deliver what they seem to mean.
Address TODO comments in IsSimplyContiguous() by using the
updated IsAssumedShape() predicate.
Differential Revision: https://reviews.llvm.org/D114829
Hans Wennborg [Wed, 1 Dec 2021 19:02:51 +0000 (20:02 +0100)]
Revert "[sanitizer] Add delta compression stack depot"
Broke the build on Windows, where MprotectReadOnly() isn't defined, see comment
on the code review.
> Compress by factor 4x, takes about 10ms per 8 MiB block.
>
> Depends on D114498.
>
> Reviewed By: morehouse
>
> Differential Revision: https://reviews.llvm.org/D114503
This reverts commit
1d8f2957591cad2e82d99e2e04830e0faf87707e.
Mogball [Wed, 1 Dec 2021 18:40:36 +0000 (18:40 +0000)]
[mlir][ods][nfc] fixing test cases
Paul Walker [Wed, 1 Dec 2021 18:06:11 +0000 (18:06 +0000)]
[Clang] Remove bogus "REQUIRES arm-registered-target" from SVE ACLE tests.
Many of the SVE ACLE tests have gained entries as follows:
REQUIRES: aarch64-registered-target || arm-registered-target
which can cause test failures when only arm-registered-target is
available because only aarch64-registered-target supports SVE.
Anton Korobeynikov [Wed, 1 Dec 2021 18:43:22 +0000 (21:43 +0300)]
Disable issues / pull requests via templates in preparation with migration
Sanjay Patel [Wed, 1 Dec 2021 18:39:48 +0000 (13:39 -0500)]
[Support] replace check with assert in known bits of mul calculation; NFC
Jonas Devlieghere [Wed, 1 Dec 2021 18:39:28 +0000 (10:39 -0800)]
Revert "[lldb] Temporarily skip TestTsanBasic on Darwin"
This reverts commit
92a8dc0735cfb3f296f0c487b20d8fa8474e3e40 because
66d4ce7e26a5ab00f7e4946b6e1bac8f805010fa was reverted in
09859113ed23.
Zarko Todorovski [Tue, 30 Nov 2021 18:39:56 +0000 (13:39 -0500)]
[NFC][Clang] Fix some comments in clang
Applying post commit comment suggestions from https://reviews.llvm.org/D114025
Mogball [Wed, 1 Dec 2021 18:12:37 +0000 (18:12 +0000)]
[mlir][ods][nfc] fix gcc-5 build
Simon Moll [Wed, 1 Dec 2021 17:55:28 +0000 (18:55 +0100)]
[VE][NFC] Fix use-after-free in VEInstrInfo
First call getOperand, then erase the MachineInstr. Not the other way
round.
Expected to fix test/CodeGen/VE/VELIntrinsics/lvm.ll
Detected by asan buildbot:
sanitizer-x86_64-linux-fast
(https://lab.llvm.org/buildbot/#/builders/5/builds/15384)
Kirill Stoimenov [Wed, 1 Dec 2021 01:27:22 +0000 (01:27 +0000)]
[ASan] Fixed include order.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D114835
Corentin Jabot [Wed, 1 Dec 2021 17:57:39 +0000 (12:57 -0500)]
[Clang] Fix nesting of discarded and immediate contexts.
In C++23, discarded statements and if consteval statements can nest
arbitrarily. To support that, we keep track of whether the parent of
the current evaluation context is discarded or immediate.
This is done at the construction of an evaluation context
to improve performance.
Fixes https://bugs.llvm.org/show_bug.cgi?id=52231
Louis Dionne [Wed, 1 Dec 2021 17:57:30 +0000 (12:57 -0500)]
[runtimes] Move WARNING to FATAL_ERROR for folks using FOO_BUILD_32_BITS
Louis Dionne [Tue, 23 Nov 2021 21:34:09 +0000 (16:34 -0500)]
[runtimes] Remove support for GCC-style 32 bit multilib builds
This patch removes the ability to build the runtimes in the 32 bit
multilib configuration, i.e. using -m32. Instead of doing this, one
should cross-compile the runtimes for the appropriate target triple,
like we do for all other triples.
As it stands, -m32 has several issues, which all seem to be related to
the fact that it's not well supported by the operating systems that
libc++ support. The simplest path towards fixing this is to remove
support for the configuration, which is also the best course of action
if there is little interest for keeping that configuration. If there
is a desire to keep this configuration around, we'll need to do some
work to figure out the underlying issues and fix them.
Differential Revision: https://reviews.llvm.org/D114473
Reid Kleckner [Wed, 1 Dec 2021 17:27:44 +0000 (09:27 -0800)]
[AArch64] Fix unused variable warning with NDEBUG, NFC
Simon Moll [Wed, 1 Dec 2021 17:03:14 +0000 (18:03 +0100)]
[Clang][VE] Fix toolchain test when -DCLANG_DEFAULT_LINKER=lld in use
The CLANG_DEFAULT_LINKER flag overrides the default toolchain linker.
VE strictly requires 'nld' to be the default linker. This causes a test
failure in test/Driver/ve-toolchain.cpp when configured with
CLANG_DEFAULT_LINKER!=ld
Failure in clang-ppc64le-rhel
(https://lab.llvm.org/buildbot/#/builders/57/builds/12628)
Until default linker selection with CLANG_DEFAULT_LINKER!=ld is fixed
proper, we manually specify '-fuse-ld=ld' (ie the toolchain default
linker) in the ve-toolchain tests.
Omer Aviram [Wed, 1 Dec 2021 17:03:22 +0000 (12:03 -0500)]
[SelectionDAG] Add pattern to haveNoCommonBitsSet
Correctly identify the following pattern, which has no common bits: (X & ~M) op (Y & M).
Differential Revision: https://reviews.llvm.org/D113970
Dmitry Vyukov [Wed, 1 Dec 2021 16:55:14 +0000 (17:55 +0100)]
Revert "tsan: new runtime (v3)"
This reverts commit
66d4ce7e26a5ab00f7e4946b6e1bac8f805010fa.
Chromium tests started failing:
https://bugs.chromium.org/p/chromium/issues/detail?id=1275581
Mogball [Tue, 30 Nov 2021 14:09:00 +0000 (14:09 +0000)]
[mlir][ods] AttrOrTypeGen uses Class
AttrOrType def generator uses `Class` code gen helper,
instead of naked raw_ostream.
Depends on D113714 and D114807
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D113715
Mogball [Tue, 30 Nov 2021 14:08:40 +0000 (14:08 +0000)]
[llvm][stlextras] Add const methods to concat_range and enumerator
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D114807
Mark de Wever [Sat, 4 Sep 2021 11:26:58 +0000 (13:26 +0200)]
[libc++][format][1/6] Reduce binary size.
This removes the `format_args_t` from `<format>` and adjusts the type of
the `format_args` for the `vformat_to` overloads.
The `format_context` uses a `back_insert_iterator<string>` therefore the
new `output_iterator` function uses a `string` as its temporary storage
buffer. This isn't ideal. The next patches in this series will improve
this. These improvements make it easy to also improve `format_to_n` and
`formatted_size`.
This addresses P2216 `6. Binary size`.
P2216 `5. Compile-time checks` are not part of this change.
Implements parts of:
- P2216 std::format improvements
Depends on D103670
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D110494
Nicolas Vasilache [Wed, 1 Dec 2021 15:48:17 +0000 (15:48 +0000)]
[mlir][Vector] Thread 0-d vectors through vector.transfer ops
This revision adds 0-d vector support to vector.transfer ops.
In the process, numerous cleanups are applied, in particular around normalizing
and reducing the number of builders.
Reviewed By: ThomasRaoux, springerm
Differential Revision: https://reviews.llvm.org/D114803
Joseph Huber [Wed, 1 Dec 2021 14:53:41 +0000 (09:53 -0500)]
[OpenMP][FIX] SPMDzation guarding needs to account for all reaching kernels
If two reaching kernels disagree on the execution mode we cannot guard a
function right now. Ensure we do not as we otherwise will cause a
deadlock.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D114866
Simon Pilgrim [Wed, 1 Dec 2021 16:37:39 +0000 (16:37 +0000)]
[X86] combinePMULH - recognise 'cheap' trunctions via PACKS/PACKUS as well as SEXT/ZEXT
combinePMULH currently only truncates vXi32/vXi64 multiplies to PMULHW/PMULUW if the source operands are SEXT/ZEXT instructions for a 'free' truncation.
But we can generalize this to any source operand with sufficient leading sign/zero bits that would allow PACKS/PACKUS to be used as a 'cheap' truncation.
This helps us avoid the wider multiplies, in exchange for truncation on both source operands instead of the result.
Differential Revision: https://reviews.llvm.org/D113371
Simon Pilgrim [Wed, 1 Dec 2021 14:36:06 +0000 (14:36 +0000)]
[VE] Remove switch with only default case statement to fix MSVC warning. NFC.
Simon Moll [Wed, 1 Dec 2021 16:25:29 +0000 (17:25 +0100)]
[VE][NFC] Use POSIX-compatible stream redirection
Drop Bash-style stream redirect in favor of POSIX stream redirection to
fix spurious test failures on Windows.
Failure:
https://lab.llvm.org/buildbot/#/builders/123/builds/7509/steps/8/logs/stdio
Alexey Bataev [Fri, 12 Nov 2021 17:09:15 +0000 (09:09 -0800)]
[SLP]Improve cost model for the shuffled extracts.
Improved the calculation of the shuffled extracts, where possible. Need
to calculate the cost for the extracted scalars if some users are not
insertelements + improved the total estimation of the shuffled scalars
used in insertelements build vectors.
Differential Revision: https://reviews.llvm.org/D113782
Fabian Wolff [Wed, 1 Dec 2021 16:01:06 +0000 (11:01 -0500)]
[libc++] Fix `uniform_int_distribution` for 128-bit result type
Fixes https://llvm.org/PR51520. The problem is that `uniform_int_distribution`
currently uses an unsigned integer with at most 64 bits internally, which
is then casted to the desired result type. If the result type is `int64_t`,
this will produce a negative number if the most significant bit is set,
but if the result type is `__int128_t`, the value remains non-negative
and will be out of bounds for the example in PR#51520. (The reason why
it also seems to work if the upper or lower bound is changed is
because the branch at [1] will then no longer be taken, and proper
rejection sampling takes place.)
The bigger issue here is probably that `uniform_int_distribution` can be
instantiated with `__int128_t` but will silently produce incorrect results
(only the lowest 64 bits can ever be set). libstdc++ also supports `__int128_t`
as a result type, so I have simply extended the maximum width of the
internal intermediate result type.
[1]: https://github.com/llvm/llvm-project/blob/
6d28dffb6/libcxx/include/__random/uniform_int_distribution.h#L266-L267
Differential Revision: https://reviews.llvm.org/D114129
Yousuf Ali [Tue, 30 Nov 2021 18:43:14 +0000 (13:43 -0500)]
[PowerPC][AIX] Add toc-data support for 64-bit AIX small code model.
The patch expands the existing 32-bit toc-data attribute support to 64-bit.
In both 32-bit and 64-bit it is supported for small code model only.
Differential Revision: https://reviews.llvm.org/D114654
Alexey Bataev [Wed, 1 Dec 2021 12:58:18 +0000 (04:58 -0800)]
[SLP]Introduce isUndefVector function to check for undef vectors.
Undefined vector might be not only the UndefValue, but also it can be
a constant vector with undef ot poison elements, need to check for this
kind of undef too.
Differential Revision: https://reviews.llvm.org/D114873
Bradley Smith [Fri, 26 Nov 2021 12:01:22 +0000 (12:01 +0000)]
[AArch64][SVE] Duplicate FP_EXTEND/FP_TRUNC -> LOAD/STORE dag combines
By duplicating these dag combines we can bypass the legality checks that
they do, this allows us to perform these combines on larger than legal
fixed types, which in turn allows us to bring the same benefits D114580
brought but to larger than legal fixed types.
Depends on D114580
Differential Revision: https://reviews.llvm.org/D114628
Alexey Bataev [Tue, 16 Nov 2021 19:05:19 +0000 (11:05 -0800)]
[SLP]Improve vectorization of cmp instructions sequences.
Final attempt to vectorize bundles of comptatible cmp instructions after
all other instructions processing.
Metric: SLP.NumVectorInstructions
Program results results0 diff
test-suite :: MultiSource/Benchmarks/mediabench/g721/g721encode/encode.test 1.00 5.00 400.0%
test-suite :: MultiSource/Benchmarks/PAQ8p/paq8p.test 8.00 11.00 37.5%
test-suite :: MultiSource/Benchmarks/Olden/voronoi/voronoi.test 20.00 26.00 30.0%
test-suite :: External/SPEC/CINT2017rate/525.x264_r/525.x264_r.test 1344.00 1648.00 22.6%
test-suite :: External/SPEC/CINT2017speed/625.x264_s/625.x264_s.test 1344.00 1648.00 22.6%
test-suite :: MultiSource/Benchmarks/Olden/bh/bh.test 102.00 124.00 21.6%
test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C/CoMD/CoMD.test 118.00 133.00 12.7%
test-suite :: External/SPEC/CFP2017speed/638.imagick_s/638.imagick_s.test 3233.00 3554.00 9.9%
test-suite :: External/SPEC/CFP2017rate/538.imagick_r/538.imagick_r.test 3233.00 3554.00 9.9%
test-suite :: MultiSource/Benchmarks/Olden/power/power.test 64.00 70.00 9.4%
test-suite :: External/SPEC/CFP2017rate/526.blender_r/526.blender_r.test 7879.00 8604.00 9.2%
test-suite :: MultiSource/Benchmarks/Prolangs-C/simulator/simulator.test 50.00 54.00 8.0%
test-suite :: MultiSource/Applications/sqlite3/sqlite3.test 27.00 29.00 7.4%
test-suite :: External/SPEC/CFP2017rate/510.parest_r/510.parest_r.test 8345.00 8955.00 7.3%
test-suite :: MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/timberwolfmc.test 694.00 738.00 6.3%
test-suite :: MultiSource/Benchmarks/MallocBench/gs/gs.test 361.00 382.00 5.8%
test-suite :: MultiSource/Benchmarks/7zip/7zip-benchmark.test 409.00 430.00 5.1%
test-suite :: External/SPEC/CINT2017speed/600.perlbench_s/600.perlbench_s.test 140.00 147.00 5.0%
test-suite :: External/SPEC/CINT2017rate/500.perlbench_r/500.perlbench_r.test 140.00 147.00 5.0%
test-suite :: External/SPEC/CFP2017rate/511.povray_r/511.povray_r.test 4013.00 4206.00 4.8%
test-suite :: MultiSource/Applications/JM/ldecod/ldecod.test 966.00 1011.00 4.7%
test-suite :: SingleSource/Benchmarks/Misc/oourafft.test 65.00 68.00 4.6%
test-suite :: MultiSource/Benchmarks/Bullet/bullet.test 4219.00 4381.00 3.8%
test-suite :: MultiSource/Benchmarks/tramp3d-v4/tramp3d-v4.test 1911.00 1973.00 3.2%
test-suite :: External/SPEC/CINT2017rate/531.deepsjeng_r/531.deepsjeng_r.test 62.00 64.00 3.2%
test-suite :: External/SPEC/CINT2017speed/631.deepsjeng_s/631.deepsjeng_s.test 62.00 64.00 3.2%
test-suite :: External/SPEC/CINT2017speed/602.gcc_s/602.gcc_s.test 852.00 877.00 2.9%
test-suite :: External/SPEC/CINT2017rate/502.gcc_r/502.gcc_r.test 852.00 877.00 2.9%
test-suite :: MultiSource/Applications/JM/lencod/lencod.test 1624.00 1668.00 2.7%
test-suite :: MultiSource/Benchmarks/McCat/18-imp/imp.test 39.00 40.00 2.6%
test-suite :: MultiSource/Benchmarks/MiBench/consumer-typeset/consumer-typeset.test 613.00 624.00 1.8%
test-suite :: MultiSource/Benchmarks/MiBench/consumer-lame/consumer-lame.test 378.00 383.00 1.3%
test-suite :: MultiSource/Benchmarks/MiBench/consumer-jpeg/consumer-jpeg.test 293.00 295.00 0.7%
test-suite :: MultiSource/Benchmarks/mediabench/jpeg/jpeg-6a/cjpeg.test 297.00 299.00 0.7%
test-suite :: External/SPEC/CINT2017rate/523.xalancbmk_r/523.xalancbmk_r.test 5522.00 5534.00 0.2%
test-suite :: External/SPEC/CINT2017speed/623.xalancbmk_s/623.xalancbmk_s.test 5522.00 5534.00 0.2%
Differential Revision: https://reviews.llvm.org/D114799
Nikita Popov [Wed, 1 Dec 2021 15:08:44 +0000 (16:08 +0100)]
[Verifier] Make matrix intrinsic verification compatible with opaque pointers
Don't check the pointer element type for opaque pointers.
Stephan Herhut [Wed, 1 Dec 2021 09:38:12 +0000 (10:38 +0100)]
[mlir][linalg] Disable tensor-matmul test under asan
The test is currently leaky. Disabling it to make the bots green.
Differential Revision: https://reviews.llvm.org/D114857
David Green [Wed, 1 Dec 2021 15:25:19 +0000 (15:25 +0000)]
Revert "[ARM] Teach getIntImmCostInst about the cost of saturating fp converts"
This reverts commit
6d41de380f223c8da02fd4d6a7f7dd1e7a404a24 as the
windows bots are not happy, in a way I do not understand. Revert whilst
we figure out what is wrong.
Florian Hahn [Wed, 1 Dec 2021 14:56:51 +0000 (14:56 +0000)]
[LV] Move code from vectorizeMemoryInstruction to recipe's execute().
The code in widenMemoryInstruction has already been transitioned
to only rely on information provided by VPWidenMemoryInstructionRecipe
directly.
Moving the code directly to VPWidenMemoryInstructionRecipe::execute
completes the transition for the recipe.
It provides the following advantages:
1. Less indirection, easier to see what's going on.
2. Removes accesses to fields of ILV.
2) in particular ensures that no dependencies on
fields in ILV for vector code generation are re-introduced.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D114324
Kiran Chandramohan [Wed, 1 Dec 2021 14:23:48 +0000 (14:23 +0000)]
Revert "[Flang] Replace notifyMatchFailure with TODO hard failures"
This reverts commit
46fd7fd7b342039b59ec534bab8b93fa5d34f6e2.
Alexey Bataev [Wed, 1 Dec 2021 14:20:35 +0000 (06:20 -0800)]
[SLP][NFC]Add a test for inserting into constant undef vector, NFC.
Florian Hahn [Wed, 1 Dec 2021 14:15:46 +0000 (14:15 +0000)]
[BasicAA] Add memset_chk libfunc tests.
Florian Hahn [Wed, 1 Dec 2021 14:15:40 +0000 (14:15 +0000)]
[BasicAA] Add strncpy libfunc tests.
Stephen Tozer [Wed, 1 Dec 2021 14:03:53 +0000 (14:03 +0000)]
[Dexter] Fix address_printing test by requiring lldb
Fixes a failure on the llvm-clang-x86_64-sie-ubuntu-fast buildbot caused
by the test requiring lldb (with the standard dexter lit config), but
not including a "Requires: lldb" clause.
Simon Moll [Wed, 1 Dec 2021 12:21:39 +0000 (13:21 +0100)]
[VE] Make VE official
Add VE to the list of official targets.
Proposal: https://lists.llvm.org/pipermail/llvm-dev/2021-November/153571.html
Reviewed By: rengolin
Differential Revision: https://reviews.llvm.org/D113247
Nico Weber [Wed, 1 Dec 2021 13:35:32 +0000 (08:35 -0500)]
[clang-cl] Set _MSVC_LANG to 202002L with /std:c++20
MSVC says this should be 202002L for /std:c++20, and of VS16.11
that's indeed the case (older versions warn that they don't
understand /std:c++20, and then cl.exe defaults to C++14 and
sets _MSVC_LANG to 201402 accordingly).
Differential Revision: https://reviews.llvm.org/D114867
Nico Weber [Wed, 1 Dec 2021 13:53:49 +0000 (08:53 -0500)]
[gn build] (manually) port
94d5f2afbef0
Manuel Klimek [Wed, 1 Dec 2021 13:37:10 +0000 (14:37 +0100)]
Fix a violated precondition in clang-format.
Make sure we do not try to change line comments that are non-regular, i.e. do
not start with "//" or "#". This can for example happen when "//" is
broken into two lines with an escaped newline.