Commit Graph

409226 Commits

Author SHA1 Message Date
Matthias Springer 42fd68b344 [mlir][linalg][bufferize] LinalgOp: Move existing region to new op
This has two advantages.

1. It is more efficient. No need to clone the entire region.
2. Recreating ops (via cloning) invalidates analysis results. Previously, an OpResult could have bufferized out-of-place, even though the analysis requested an in-place bufferization. That is because BufferizationState keeps track of OpResults for storing bufferization analysis results (and cloned ops have new OpResults).

Differential Revision: https://reviews.llvm.org/D116453
2022-01-07 07:00:24 +09:00
Alexandre Ganea a5af260d3e Silence warning with MSVC compiler.
D:\git\llvm-project\clang\unittests\Analysis\FlowSensitive\MultiVarConstantPropagationTest.cpp(104) : warning C4715: 'clang::dataflow::`anonymous namespace'::operator<<': not all control paths return a value
2022-01-06 16:51:37 -05:00
Matthias Springer 698896cd6c [mlir][linalg][bufferize][NFC] Change allocationFn return type to FailureOr<Value>
In addition, all functions that call `allocationFn` now return FailureOr<Value>. This resolves a few TODOs in the code base.

Differential Revision: https://reviews.llvm.org/D116452
2022-01-07 06:33:19 +09:00
Nicolas Vasilache 4a661602ef [mlir][Linalg] NFC - Modernize APIs and get rid of unnecessary tiling paterns.
Tiling patterns can be reduced to a single pattern by using interface-based patterns.

Differential Revision: https://reviews.llvm.org/D116733
2022-01-06 16:27:35 -05:00
Matthias Springer 75d65293ca [mlir][linalg][bufferize][NFC] Clean up comments and minor code refactorings
Differential Revision: https://reviews.llvm.org/D116451
2022-01-07 06:23:01 +09:00
Christian Sigg 635f8f3c95 Update mlir GDB printers
Update prettyprinters.py to match MLIR changes.

This has gone unnoticed because no build bot is running tests with debug info.

I will look into what we can do about this separately. There is
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/,
from Apple. The Debug Info tests are failing despite the green result.

See https://github.com/llvm/llvm-project/issues/48872.

Note: the llvm-support.gdb test only works with Debug,
but not RelWithDebInfo because some checked symbols are stripped.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D116646
2022-01-06 22:20:25 +01:00
Matthias Springer 0f5edb9d63 [mlir][linalg][bufferize] Add `createDealloc` options
If `createDealloc` is deactivated (enabled by default), newly allocated buffers are not deallocated anymore. In such a case, the missing deallocations can be inserted by the existing "BufferDeallocation" pass.

This change is needed for unifying core bufferization and Comprehensive Bufferize. Core bufferization has a separate pass for generating deallocations.

Note: In the future, this will evolve towards generating deallocation ops only for buffer allocations that do not escape block boundaries (i.e., that are in destination passing style).

Differential Revision: https://reviews.llvm.org/D116450
2022-01-07 06:13:57 +09:00
Michael Spencer 37e6e022d2 Re-land "[Clang][ScanDeps] Use the virtual path for module maps"
This re-lands:
- 04192422c4
- 015e08c6ba

Which I reverted in ea83517138 in error.

Differential Revision: https://reviews.llvm.org/D114206
2022-01-06 21:05:05 +00:00
Congzhe Cao c251bfc3b9 [LoopInterchange] Remove a limitation in LoopInterchange legality
There was a limitation in legality that in the original inner loop latch,
no instruction was allowed between the induction variable increment
and the branch instruction. This is because we used to split the
inner latch at the induction variable increment instruction. Since
now we have split at the inner latch branch instruction and have
properly duplicated instructions over to the split block, we remove
this limitation.

Please refer to the test case updates to see how we now interchange
loops where instructions exist between the induction variable
increment and the branch instruction.

Reviewed By: bmahjour

Differential Revision: https://reviews.llvm.org/D115238
2022-01-06 15:56:32 -05:00
Michał Górny 9b1d27b2fa [lldb] [Process/FreeBSDKernel] Support finding all processes
Include the complete list of threads of all running processes
in the FreeBSDKernel plugin.  This makes it possible to inspect
the states (including partial register dumps from PCB) of all kernel
and userspace threads at the time of crash, or at the time of reading
/dev/mem first.

Differential Revision: https://reviews.llvm.org/D116255
2022-01-06 21:53:28 +01:00
Nikolas Klauser 16232611ec [libc++][NFC] Remove using declarations in common_reference.compile.pass.cpp
Remove using declarations in common_reference.compile.pass.cpp

Reviewed By: Quuxplusone, Mordante, #libc, jloser

Spies: jloser, libcxx-commits

Differential Revision: https://reviews.llvm.org/D116744
2022-01-06 21:39:17 +01:00
Nico Weber 6c255ac969 Revert "[Hexagon] Some compound opportunities missed in presence of branches"
This reverts commit afdc6a0b8e.
Breaks check-lld, see e.g.:
https://lab.llvm.org/buildbot/#/builders/123/builds/8100/steps/8/logs/stdio
2022-01-06 15:32:14 -05:00
Vincent Lee a963bc490d [lld-macho] Increase slops to prevent thunk out of range
One of our internal arm64 apps hit a thunk out of range error when building
with LLD. Per the comment, I'm arbitrarily increasing slop size to 256.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D116705
2022-01-06 12:29:12 -08:00
Matthias Springer bf9d8d9dfb [mlir][linalg][bufferize][NFC] Rename functions in BufferizationState
The old function names (e.g., `replaceOp`) could have been confusing to users because they sound similar to rewriter functions, but have slightly different semantics.

Differential Revision: https://reviews.llvm.org/D116449
2022-01-07 05:28:58 +09:00
Carlos Galvez 670de10f9d Disable clang-tidy warnings from system macros
Currently, it's inconsistent that warnings are disabled if they
come from system headers, unless they come from macros.
Typically a user cannot act upon these warnings coming from
system macros, so clang-tidy should ignore them unless the
user specifically requests warnings from system headers
via the corresponding configuration.

This change broke the ProTypeVarargCheck check, because it
was checking for the usage of va_arg indirectly, expanding it
(it's a system macro) to detect the usage of __builtin_va_arg.
The check has been fixed by checking directly what the rule
is about: "do not use va_arg", by adding a PP callback that
checks if any macro with name "va_arg" is expanded. The old
AST matcher is still kept for compatibility with Windows.

Add unit test that ensures warnings from macros are disabled
when not using the -system-headers flag. Document the change
in the Release Notes.

Differential Revision: https://reviews.llvm.org/D116378
2022-01-06 20:27:28 +00:00
mydeveloperday 031d3ece3f [clang-format] Fix a crash (assertion) in qualifier alignment when matching template closer is null
https://github.com/llvm/llvm-project/issues/53008

```
template <class Id> using A = quantity /**/<kind<Id>, 1>;
```

the presence of the comment between identifier and template opener seems to be causing the qualifier alignment to fail

Reviewed By: curdeius

Fixes: #53008

Differential Revision: https://reviews.llvm.org/D116726
2022-01-06 19:40:39 +00:00
Arthur O'Dwyer 9e35e61aa4 [libc++] [ranges] Simplify our idiom for testing niebloid-ness.
In the test files, replace the old-style tests with a simple static_assert,
matching the current style as depicted in e.g.
`ranges_uninitialized_default_construct.pass.cpp`.

Preserve `is_function_like` (but renamed to `is_niebloid`) at
ldionne's request. The removal of this test helper will happen
in D116570 if at all.

Differential Revision: https://reviews.llvm.org/D116384
2022-01-06 14:20:44 -05:00
Alexey Bataev d130df544d [SLP]Improve reordering for the nodes beeing used in alternate vectorization.
No need to include the order of the scalars beeing used as part of the
alternate vectorization into account when trying to reorder the whole
graph. Such elements better to reorder in the following phase because
the subtree still ends up in shuffle.

Part of D116688, fixes the regression in D116690.

Differential Revision: https://reviews.llvm.org/D116740
2022-01-06 11:18:57 -08:00
Alexey Bataev 7cb19fe493 [SLP]Initialize the lane with the given value instead of default 0.
There is a bug in the reordering analysis stage. If the element with the
given hash is not added to the map but has the same number of APOs and
instructions with same parent, but different instruction opcode, it will
be initalized with default values and then the counter is increased by
1. But the lane is not updated and default to 0 instead of the actual
   `Lane` value. It leads to the fact that the analysis is useless in
   many cases and default to lane 0 instead of actual lane with the
   minimum amount of APO operands.

Differential Revision: https://reviews.llvm.org/D116690
2022-01-06 10:57:11 -08:00
Pavel Labath 31c7165a2b [lldb] Remove summary for signed char *
It conflicts with the summary for BOOL * (aka signed char *). This
partially reverts D112709.
2022-01-06 19:52:24 +01:00
MaheshRavishankar 4317a3dfad [mlir][Linalg] Disable fusion of reshape with elementwise ops for purely dynamic cases.
`tensor.collapse_shape` op when fused with a consumer elementwise
`linalg.generic` operation results in creation of tensor.expand_shape
ops. In purely dynamic cases this can end up with a dynamic dimensions
being expanded to more than one dynamic dimension. This is disallowed
by the semantics of `tensor.expand_shape` operation. (While the
transformation is itself correct, its a gap in the specification of
`tensor.expand_shape` that is the issue). So disallow fusions which
result in such a pattern.

Differential Revision: https://reviews.llvm.org/D116703
2022-01-06 10:32:24 -08:00
Stanislav Mekhanoshin 0b5340acb7 [InstCombine] Factor out a common pattern match used 3 times. NFC.
This is needed for the next patch which will add more patterns
to the same match.

Differential Revision: https://reviews.llvm.org/D116194
2022-01-06 10:23:50 -08:00
Daniel Kiss 131c06e6da Revert "[AArch64] Emit .cfi_negate_ra_state for PAC-auth instructions."
This reverts commit f903c85055.
2022-01-06 19:17:45 +01:00
Nikolas Klauser f3aed36981 [libc++] Implement P1425R4 (Iterator pair constructors for std::stack and std::queue)
Implement P1425R4

Reviewed By: Quuxplusone, #libc, Mordante

Spies: Mordante, jloser, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D115977
2022-01-06 18:55:11 +01:00
Nikolas Klauser 3ef363ecec [libc++] Re-enable `GCC11 / C++11`, `Clang 12` and `ASAN` CI-runs 2022-01-06 18:52:44 +01:00
Andrew Browne 32167bfe64 [DFSan] Refactor dfsan_mem_shadow_transfer.
Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D116704
2022-01-06 09:33:19 -08:00
Colin LeMahieu afdc6a0b8e [Hexagon] Some compound opportunities missed in presence of branches 2022-01-06 09:25:56 -08:00
David Green c65270cf96 [AArch64] Add basic umulo and smulo costs
This adds some AArch64 specific smul_with_overflow and umul_with_overflow
costs, overriding the default costs. The code generation for these mul
with overflow intrinsics is usually better than the default expansion on
AArch64. The costs come from https://godbolt.org/z/zEzYhMWqo with various
types, or llvm/test/CodeGen/AArch64/arm64-xaluo.ll.

Differential Revision: https://reviews.llvm.org/D116732
2022-01-06 17:22:47 +00:00
Arthur O'Dwyer 570ed38b6e [libc++] [test] XFAIL "span.cons/initializer_list.pass.cpp" for apple-clang-12.
This should have been done in 6a6a80e88e, but buildkite was down so I
hadn't noticed. This brings this test file into line with several others
in this directory.
2022-01-06 12:15:28 -05:00
Simon Pilgrim 5e7912d80f [LowerMatrixIntrinsics] writeFnName - don't dereference a dyn_cast<>. NFC.
dyn_cast<> can return null - use cast<> instead to assert the cast is valid before dereferencing the casted pointer.

Fixes static-analyzer null dereference warning.
2022-01-06 17:09:32 +00:00
Brian Cain b17f036a99 [Hexagon] Consider HVX reg aliases for .cur warning 2022-01-06 08:59:08 -08:00
Philip Reames 916b35e783 [unroll] Strengthen verification of analysis updates under expensive asserts
I am suspecting a bug around updates of loop info for unreachable exits, but don't have a test case.  Running this locally on make check didn't reveal anything, we'll see if the expensive checks bots find it.
2022-01-06 08:51:50 -08:00
Andrzej Warzynski ea66b46dde [flang] Separate temporary and user-specified object files
This patch updates the `flang` bash scripts to differentiate between
object files provided by the user and intermediate object files
generated by the script. The latter are an "implementation detail" that
should not be visible to the end user (i.e. deleted before the scripts
exits). The former should be preserved.

Fixes https://github.com/flang-compiler/f18-llvm-project/issues/1348

Differential Revision: https://reviews.llvm.org/D116590
2022-01-06 16:38:39 +00:00
LLVM GN Syncbot 3d7a3888a2 [gn build] Port 56ca11e31e 2022-01-06 16:28:57 +00:00
Craig Topper ec4dd862bf [RISCV] Use simm5_plus1_nonzero in isel patterns for vmsgeu.vi/vmsltu.vi intrinsics.
The 0 immediate can't be selected to vmsgtu.vi/vmsleu.vi by decrementing
the immediate. To prevent his we had special patterns that provided
alternate lowering for the 0 cases. This relied on tablegen prioritizing
the 0 pattern over the sim5_plus1 range.

This patch introduces simm5_plus1_nonzero that excludes 0. It also
excludes the special case for vmsltu.vi since we can just use
vmsltu.vx and let the 0 be selected to X0.

This is an alternative to some of the changes in D116584.

Reviewed By: Chenbing.Zheng, asb

Differential Revision: https://reviews.llvm.org/D116723
2022-01-06 08:27:27 -08:00
Jake Egan e3a261831b [CMake] Include ZLIB_ROOT in LLVMConfig.cmake
Include the value of `ZLIB_ROOT` in `LLVMConfig.cmake` so `FindZLIB` can pick it up. This fixes an issue where ZLIB is not found on AIX runtimes despite specifying `-DZLIB_ROOT`.

Reviewed By: daltenty

Differential Revision: https://reviews.llvm.org/D116235
2022-01-06 11:25:00 -05:00
Craig Topper 56ca11e31e [RISCV] Add an MIR pass to replace redundant sext.w instructions with copies.
Function calls and compare instructions tend to cause sext.w
instructions to be inserted. If we make good use of W instructions,
these operations can often end up being redundant. We don't always
detect these during SelectionDAG due to things like phis. There also
some cases caused by failure to turn extload into sextload in
SelectionDAG. extload selects to LW allowing later sext.ws to become
redundant.

This patch adds a pass that examines the input of sext.w instructions trying
to determine if it is already sign extended. Either by finding a
W instruction, other instructions that produce a sign extended result,
or looking through instructions that propagate sign bits. It uses
a worklist and visited set to search as far back as necessary.

Reviewed By: asb, kito-cheng

Differential Revision: https://reviews.llvm.org/D116397
2022-01-06 08:23:42 -08:00
Evgeny Mandrikov 2ccf0b76bc Fix build failure with GCC 11 in C++20 mode
See https://wg21.link/cwg2237

Reviewed By: shafik, dexonsmith

Differential Revision: https://reviews.llvm.org/D115355
2022-01-06 17:20:26 +01:00
Craig Topper 75117fb340 [RISCV] Don't advertise i32->i64 zextload as free for RV64.
The zextload hook is only used to determine whether to insert a
zero_extend or any_extend for narrow types leaving a basic block.
Returning true from this hook tends to cause any load whose output
leaves the basic block to become an LWU instead of an LW.

Since we tend to prefer sexts for i32 compares on RV64, this can
cause extra sext.w instructions to be created in other basic blocks.

If we use LW instead of LWU this gives the MIR pass from D116397
a better chance of removing them.

Another option might be to teach getPreferredExtendForValue in
FunctionLoweringInfo.cpp about our preference for sign_extend of
i32 compares. That would cause SIGN_EXTEND to be chosen for any
value used by a compare instead of using the isZExtFree heuristic.
That will require code to convert from the llvm::Type* to EVT/MVT
as well as querying the type legalization actions to get the
promoted type in order to call TargetLowering::isSExtCheaperThanZExt.
That seemed like many extra steps when no other target wants it.
Though it would avoid us needing to lean on the MIR pass in some cases.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D116567
2022-01-06 08:13:42 -08:00
Craig Topper 808c662665 [RISCV] Change RISCVISD::FCVT*RTZ opcodes to take rounding mode as an operand.
Pre-work for a future change that will use these opcodes with other
rounding modes.

Differential Revision: https://reviews.llvm.org/D116724
2022-01-06 08:12:12 -08:00
Nikita Popov 918015c9ba [EarlyCSE] Support opaque pointers
Explicitly check the load/store value type, because this is no
longer implicitly checked through the pointer type.
2022-01-06 17:08:50 +01:00
Simon Pilgrim e3e8799beb [AST] ASTContext::mergeTypes - pull out repeated getAs<> calls. NFC.
Avoids static-analyzer null dereference warnings.
2022-01-06 16:04:36 +00:00
Matt Arsenault 4fc18de335 AMDGPU: Clear NoPHIs property in SIOptimizeVGPRLiveRanges
Fixes verifier error when writing MIR tests that didn't have phis to
begin with.
2022-01-06 11:01:51 -05:00
Matthias Springer 15c7e3ee15 [mlir][linalg][bufferize][NFC] Use RewritePatterns instead of custom traversal
This change simplifies BufferizableOpInterface and other functions. Overall, the API will get smaller: Functions related to custom IR traversal are deleted entirely. This will makes it easier to write BufferizableOpInterface implementations.

This is also in preparation of unifying Comprehensive Bufferize and core bufferization. While Comprehensive Bufferize could theoretically maintain its own IR traversal, there is no reason to do so, because all bufferize implementations in BufferizableOpInterface have to support partial bufferization anyway. And we can share a larger part of the code base between the two bufferizations.

Differential Revision: https://reviews.llvm.org/D116448
2022-01-07 00:56:54 +09:00
David Goldman f558acf492 Reland "[clang][ObjC] Add fix it for missing methods in impl"
This reverts commit 37be74885946f18dbeb70343ad659924c61d2549/
relands https://reviews.llvm.org/D116417 now that the internal
issue has been fixed.
2022-01-06 10:55:02 -05:00
Jan Svoboda d5ba066cb6 [clang][lex] NFC: Move some HeaderSearch functions to .cpp file 2022-01-06 16:32:02 +01:00
Matthias Springer 2975407bd4 [mlir][linalg][bufferize][NFC] Pass BufferizationState as const reference
This is mostly for documentation purposes: Passing the object as a const reference signifies that analysis decisions cannot be changed after the analysis.

Differential Revision: https://reviews.llvm.org/D116742
2022-01-07 00:18:46 +09:00
Nikolas Klauser f2277e60f4 [libc++][NFC] Reformat <__filesystem/operations.h>
Reformat `<__filesystem/operations.h>`

Reviewed By: Quuxplusone, #libc, ldionne

Spies: ldionne, libcxx-commits

Differential Revision: https://reviews.llvm.org/D116234
2022-01-06 16:15:41 +01:00
Simon Pilgrim 5bbcff6181 [MemCpyOptimizer] hasUndefContents - only look for underlying object if we've found an alloca
Provides an early-out if we fail to find an AllocaInst, and avoids a static analyzer warning about null dereferencing.
2022-01-06 15:15:03 +00:00
Simon Pilgrim 8399fa673b [MemCpyOptimizer] Use auto* for cast<> results (style). NFC. 2022-01-06 15:15:03 +00:00