Jonas Devlieghere [Wed, 16 Mar 2022 16:31:24 +0000 (09:31 -0700)]
[lldb] Fix Minidump/no-process-id.yaml
Update warning after
2fc38b2b7bf9896806749655124ea5f13cc6d383.
Andrzej Warzynski [Wed, 16 Mar 2022 13:40:25 +0000 (13:40 +0000)]
[flang][lowering] Add lowering for the `size` intrinsic
This patch adds support for lowering of the `size` intrinsic from Fortran
to the FIR dialect of MLIR.
This is part of the upstreaming effort from the `fir-dev` branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project
Differential Revision: https://reviews.llvm.org/D121803
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Nikita Popov [Wed, 16 Mar 2022 16:28:17 +0000 (17:28 +0100)]
Revert "[FuzzMutate] Don't insert instructions after musttail call"
This reverts commit
6a23d2764467bd45c2e02828f6175a0b9f9a1005.
The newly added tests fail on the llvm-clang-x86_64-sie-win
buildbot. Not sure why a failure only occurs there, possibly
differen PRNG sequence?
Valentin Clement [Wed, 16 Mar 2022 16:14:20 +0000 (17:14 +0100)]
[flang] Lower shift intrinsics
This patch adds lowering for shift intrinsics:
- `ishft`
- `eoshift`
- `ishftc`
- `cshift`
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121808
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Co-authored-by: AlexisPerry <aperry@lanl.gov>
Valentin Clement [Wed, 16 Mar 2022 16:10:31 +0000 (17:10 +0100)]
[flang] Lower IO input with vector subscripts
This patch adds lowering for IO input with vector subscripts.
It defines a VectorSubscriptBox class that allow representing and working
with a lowered Designator containing vector subscripts while ensuring
all the subscripts expression are only lowered once.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121806
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Nikita Popov [Wed, 16 Mar 2022 15:10:24 +0000 (16:10 +0100)]
[FuzzMutate] Don't insert instructions after musttail call
Yonghong Song [Fri, 4 Mar 2022 06:34:39 +0000 (22:34 -0800)]
[Attr] Fix a btf_type_tag AST generation
Current ASTContext.getAttributedType() takes attribute kind,
ModifiedType and EquivType as the hash to decide whether an AST node
has been generated or note. But this is not enough for btf_type_tag
as the attribute might have the same ModifiedType and EquivType, but
still have different string associated with attribute.
For example, for a data structure like below,
struct map_value {
int __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag3"))) *a;
int __attribute__((btf_type_tag("tag2"))) __attribute__((btf_type_tag("tag4"))) *b;
};
The current ASTContext.getAttributedType() will produce
an AST similar to below:
struct map_value {
int __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag3"))) *a;
int __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag3"))) *b;
};
and this is incorrect.
It is very difficult to use the current AttributedType as it is hard to
get the tag information. To fix the problem, this patch introduced
BTFTagAttributedType which is similar to AttributedType
in many ways but with an additional BTFTypeTagAttr. The tag itself can
be retrieved with BTFTypeTagAttr.
With the new BTFTagAttributed type, the debuginfo code can be greatly
simplified compared to previous TypeLoc based approach.
Differential Revision: https://reviews.llvm.org/D120296
Jake Egan [Wed, 16 Mar 2022 15:41:41 +0000 (11:41 -0400)]
[VE] Remove output to /dev/stdout
Sending output to /dev/stdout on AIX gets an llc permission denied error, so this patch removes this from the tests.
Reviewed By: simoll, hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D121799
Jonas Devlieghere [Wed, 16 Mar 2022 15:30:26 +0000 (08:30 -0700)]
[lldb] Report debugger diagnostics as events
Report warnings and errors through events instead of printing directly
the to the debugger's error stream. By using events, IDEs such as Xcode
can report these issues in the UI instead of having them show up in the
debugger console.
The new diagnostic events are handled by the default event loop. If a
diagnostic is reported while nobody is listening for the new event
types, it is printed directly to the debugger's error stream.
Differential revision: https://reviews.llvm.org/D121511
Amir Ayupov [Thu, 3 Mar 2022 07:20:15 +0000 (23:20 -0800)]
[X86] Emit REX prefix immediately before the opcode
Fix prefix emission order to emit REX immediately before the opcode (SDM vol2,
2.1, Figure 2-1). According to SDM vol2 2.2.1, "Other placements are ignored".
This fix has a side effect of outputting segment override prefix in a different
order than previously (benign).
Follow-up to https://reviews.llvm.org/D120592
Reviewed By: skan, craig.topper
Differential Revision: https://reviews.llvm.org/D120871
Amir Ayupov [Fri, 25 Feb 2022 23:04:40 +0000 (15:04 -0800)]
[X86] Preserve redundant Address-Size override prefix
Print and emit redundant Address-Size override prefix if it's set on the
instruction.
Reviewed By: skan
Differential Revision: https://reviews.llvm.org/D120592
Haojian Wu [Wed, 16 Mar 2022 15:17:25 +0000 (16:17 +0100)]
[pseudo] Cleanup the leftover header guards after the movement, NFC.
LLVM GN Syncbot [Wed, 16 Mar 2022 15:19:44 +0000 (15:19 +0000)]
[gn build] Port
c2f62ab84b5f
Amir Ayupov [Wed, 16 Mar 2022 15:14:50 +0000 (08:14 -0700)]
[BOLT][NFC] Move isMOVSX64rm32 out of MCPlusBuilder
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D121669
Kazushi (Jam) Marukawa [Sat, 12 Mar 2022 00:40:17 +0000 (09:40 +0900)]
[Clang][VE] Add the rest of intrinsics to clang
Add the rest of intrinsics to clang except intrinsics using vector mask
registers.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D121586
Andrzej Warzynski [Wed, 16 Mar 2022 14:16:54 +0000 (14:16 +0000)]
[flang][lowering] Add lowering for the `set_exponent` intrinsic
This patch adds support for lowering of the `set_exponent` intrinsic
from Fortran to the FIR dialect of MLIR.
This is part of the upstreaming effort from the `fir-dev` branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project
Differential Revision: https://reviews.llvm.org/D121805
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eun Jung Park <ejpark@lanl.gov>
Joe Nash [Tue, 15 Mar 2022 19:18:17 +0000 (15:18 -0400)]
[AMDGPU] Calculate RegWidth in bits in AsmParser
NFC. Switch from calculations based on dwords to bits, to be more
flexible.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D121730
Jean Perier [Wed, 16 Mar 2022 15:08:05 +0000 (16:08 +0100)]
[flang] Relax fir.rebox verifier with characters
Allow fir.rebox input and output element type to differ for characters
if:
- Any of the character type is dynamic. Fortran allows making pointer
assignments between deferred and constant lengths entities, making this
case useful (if the input length is dynamic and the output length constant,
it is a user requirement that the length matches at runtime. There is no
option to check this at runtime, but it could be added as an option to
fir.rebox codegen later if desired).
- Or, there is a slice in the fir.rebox (the fir.rebox can implement a
substring view, hence the constant output and input lengths).
This is only a verifier constraint change, the fir.rebox codegen is not
impacted and already support those cases.
Add related FIR parsing, error, and codegen tests.
Differential Revision: https://reviews.llvm.org/D121710
Pavel Labath [Wed, 16 Mar 2022 14:38:05 +0000 (15:38 +0100)]
[lldb] Change back LLDBLog::Commands->Types in a couple more places
This was inadvertedly changed (bad search&replace) when I was removing
the LLDBLOG macros.
Nikita Popov [Wed, 16 Mar 2022 14:39:26 +0000 (15:39 +0100)]
[SROA] Handle over-large loads during presplitting
When a load extends past the extent of the alloca, SROA will
restrict the slice size to extend to the end of the alloca only.
However, presplitting was asserting that the load size and the
slice size match exactly, which does not hold in this case.
Relax the assertion to only require that the load size is greater
or equal than the slice size.
Will Hawkins [Wed, 16 Mar 2022 14:03:42 +0000 (15:03 +0100)]
[LLDB] Change enumaration to enumeration
Change enumaration to enumeration in code handling LLDB help output.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D121800
Will Hawkins [Wed, 16 Mar 2022 14:03:16 +0000 (15:03 +0100)]
[LLDB] Fix typos in LLDB help output.
Correct a few spelling errors and typos in the LLDB help output.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D121802
Matthias Springer [Wed, 16 Mar 2022 14:29:08 +0000 (23:29 +0900)]
[mlir][bufferize] Update documentation with allow-return-allocs
Differential Revision: https://reviews.llvm.org/D121807
Matthias Springer [Wed, 16 Mar 2022 13:27:55 +0000 (22:27 +0900)]
[mlir][bufferize] Allow non-equivalent yields from scf.for loops
This removes a restriction wrt. scf.for loops during One-Shot Bufferization. Such IR was previously rejected. It is still rejected by default because the bufferized IR could be slow. But such IR can now be bufferized with `allow-return-allocs`.
Differential Revision: https://reviews.llvm.org/D121529
Shengchen Kan [Wed, 16 Mar 2022 13:53:14 +0000 (21:53 +0800)]
[NFC][CodeGen] Remove redundant if clause in TargetPassConfig::addPass
Florian Hahn [Wed, 16 Mar 2022 14:13:00 +0000 (14:13 +0000)]
[ConstraintElimination] Support BBs with single successor in CanAdd.
If BB has a single successor, conditions can be added safely.
Matthias Springer [Wed, 16 Mar 2022 13:26:56 +0000 (22:26 +0900)]
[mlir][bufferize] Deallocate returned buffers with `BufferDeallocation`
New buffer allocations can now be returned/yielded from blocks with `allow-return-allocs`. One-Shot Bufferize deallocates all buffers at the end of the block. If this is not possible (because the buffer escapes the block), this is now done by the existing BufferDeallocation pass.
Differential Revision: https://reviews.llvm.org/D121527
Zhouyi Zhou [Wed, 16 Mar 2022 13:52:41 +0000 (06:52 -0700)]
let EST_Uninstantiated in FunctionProtoType::canThrow return
CT_Dependent
When compile following code without -std=c++17, clang will abort by
llvm_unreachable:
class A {
public:
static const char X;
};
const char A::X = 0;
template<typename U> void func() noexcept(U::X);
template<class... B, char x>
void foo(void(B...) noexcept(x)) {}
void bar()
{
foo(func<A>);
}
So, my solution is to let EST_Uninstantiated in
FunctionProtoType::canThrow return CT_Dependent
Differential Revision: https://reviews.llvm.org/D121498
Tue Ly [Mon, 14 Mar 2022 03:42:27 +0000 (23:42 -0400)]
[libc] Let exhaustive tests indicate each interval PASSED/FAILED.
Let exhaustive tests indicate each interval PASSED/FAILED.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D121564
Matthias Springer [Wed, 16 Mar 2022 13:26:26 +0000 (22:26 +0900)]
[mlir][linalg] Implement RegionBranchOpInterface and fix memory effects
* Implement RegionBranchOpInterface: The op has a region, but it is conceptually not entered. The region just describes the semantics of the (monolithic) op.
* Linalg structured ops do not allocate memory.
Differential Revision: https://reviews.llvm.org/D121798
Valentin Clement [Wed, 16 Mar 2022 13:38:32 +0000 (14:38 +0100)]
[flang] Lower count intrinsic
This patch adds lowering for the count intrinsic.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D121782
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
Matthias Springer [Wed, 16 Mar 2022 13:27:26 +0000 (22:27 +0900)]
[mlir][bufferize] Support layout maps in bufferization.clone lowering
Differential Revision: https://reviews.llvm.org/D121278
Alexey Bataev [Tue, 1 Mar 2022 19:32:32 +0000 (11:32 -0800)]
[SLP]Do not schedule instructions with constants/argument/phi operands and external users.
No need to schedule entry nodes where all instructions are not memory
read/write instructions and their operands are either constants, or
arguments, or phis, or instructions from others blocks, or their users
are phis or from the other blocks.
The resulting vector instructions can be placed at
the beginning of the basic block without scheduling (if operands does
not need to be scheduled) or at the end of the block (if users are
outside of the block).
It may save some compile time and scheduling resources.
Differential Revision: https://reviews.llvm.org/D121121
Dmitry Preobrazhensky [Wed, 16 Mar 2022 12:52:37 +0000 (15:52 +0300)]
[AMDGPU][MC][NFC] Refactored custom operands handling
The original design of custom operands support assumed that most GPUs
have the same or very similar operand names end encodings. This is
no longer the case. As a result the support code becomes over-complicated
and difficult to maintain.
This change implements a different design with the following benefits:
- support of aliases;
- support of operands with overlapped encodings;
- identification of defined but unsupported operands.
Differential Revision: https://reviews.llvm.org/D121696
Louis Dionne [Tue, 15 Mar 2022 20:21:47 +0000 (16:21 -0400)]
[libc++] Fix incorrect availability markup for bad_optional_access & friends
In
7fb40e1569d, I changed the availability for bad_optional_access and
friends from macOS 10.14 to 10.13 after conducting an investigation on
old dylibs. It turns out that macOS 10.13 did have bad_optional_access,
however the dylib on iOS didn't match the dylib on macOS, so those
exception classes were only introduced in iOS 12.
Thanks to Aditya Kumar for noticing this.
Differential Revision: https://reviews.llvm.org/D121735
Vladislav Khmelevsky [Tue, 15 Mar 2022 19:17:51 +0000 (22:17 +0300)]
[BOLT] LongJmp: Fix hot text section alignment
The BinaryEmitter uses opts::AlignText value to align the hot text
section. Also check that the opts::AlignText is at least
equal opts::AlignFunctions for the same reason, as described in D121392.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D121728
Louis Dionne [Tue, 15 Mar 2022 15:17:08 +0000 (11:17 -0400)]
[libc++] Do not install the C++ ABI library's headers as part of libc++'s build
It's the role of the C++ ABI library to install its own headers, not libc++.
This fixes an existing issue causing spurious CI failures where both libc++
and libc++abi would try to install <cxxabi.h> & friends in the same location,
leading to failures during the installation step.
Differential Revision: https://reviews.llvm.org/D121706
Jan Svoboda [Wed, 16 Mar 2022 12:40:09 +0000 (13:40 +0100)]
[clang][deps] NFC: Align path separator conversion in tests
This is the only test in the ClangScanDeps suite that doesn't convert (double) backslashes to forward slashes.
Jan Svoboda [Wed, 16 Mar 2022 12:36:14 +0000 (13:36 +0100)]
[clang][deps] Attempt to fix test on Windows
This test fails on Windows due to path separators
Shengchen Kan [Wed, 16 Mar 2022 12:21:25 +0000 (20:21 +0800)]
[NFC][CodeGen] Rename some functions in MachineInstr.h and remove duplicated comments
Nico Weber [Wed, 16 Mar 2022 11:52:50 +0000 (07:52 -0400)]
[gn build] (manually) port
e4cab4e24d17
Jan Svoboda [Wed, 16 Mar 2022 10:48:34 +0000 (11:48 +0100)]
[clang][deps] Fix traversal of precompiled dependencies
The code for traversing precompiled dependencies is somewhat complicated and contains a dangling iterator bug.
This patch simplifies the code and fixes the bug.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D121533
Jan Svoboda [Wed, 16 Mar 2022 10:45:46 +0000 (11:45 +0100)]
[clang][deps] Don't prune search paths used by dependencies
When pruning header search paths (to reduce the number of modules we need to build explicitly), we can't prune the search paths used in (transitive) dependencies of a module. Otherwise, we could end up with either of the following dependency graphs:
```
X:<hash1> -> Y:<hash2>
X:<hash1> -> Y:<hash3>
```
depending on the search paths of the translation unit we discovered `X` and `Y` from.
This patch fixes that.
Depends on D121295.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D121303
Jan Svoboda [Wed, 16 Mar 2022 10:44:55 +0000 (11:44 +0100)]
[clang][deps] NFC: Use range-based for loop instead of iterators
The iterator is not needed after the loop body anymore, meaning we can use more terse range-based for loop.
Depends on D121295.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D121685
Jan Svoboda [Wed, 16 Mar 2022 10:44:07 +0000 (11:44 +0100)]
[clang][deps] Modules don't contribute to search path usage
To reduce the number of modules we build in explicit builds (which use strict context hash), we prune unused header search paths. This essentially merges parts of the dependency graph.
Determining whether a search path was used to discover a module (through implicit module maps) proved to be somewhat complicated. Initial support landed in D102923, while D113676 attempts to fix some bugs.
However, now that we don't use implicit module maps in explicit builds (since D120465), we don't need to consider such search paths as used anymore. Modules are no longer discovered through the header search mechanism, so we can drop such search paths (provided they are not needed for other reasons).
This patch removes whatever support for detecting such usage we had, since it's buggy and not required anymore.
Depends on D120465.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D121295
Simon Pilgrim [Wed, 16 Mar 2022 11:05:26 +0000 (11:05 +0000)]
[X86] computeKnownBitsForTargetNode - add X86ISD::AND KnownBits handling
Fixes #54171
Simon Pilgrim [Wed, 16 Mar 2022 11:00:50 +0000 (11:00 +0000)]
[X86] Add PR54171 test case
Matthias Springer [Wed, 16 Mar 2022 09:18:09 +0000 (18:18 +0900)]
[mlir][SCF] Implement RegionBranchOpInterface on ExecuteRegionOp
This is needed for the BufferDeallocation pass.
Differential Revision: https://reviews.llvm.org/D121526
Matthias Springer [Wed, 16 Mar 2022 10:45:06 +0000 (19:45 +0900)]
[mlir][bufferize][NFC] Rename allow-return-memref to allow-return-allocs
Also clean up/split test cases.
Differential Revision: https://reviews.llvm.org/D121522
Andrzej Warzynski [Wed, 2 Mar 2022 15:40:16 +0000 (15:40 +0000)]
[flang][driver] Add support for `-mllvm`
This option is added in both `flang-new` (the compiler driver) and
`flang-new -fc1` (the frontend driver). The semantics are consistent
with `clang` and `clang -cc1`.
As Flang does not run any LLVM passes when invoked with `-emit-llvm`
(i.e. `flang-new -S -emit-llvm <file>`), the tests use
`-S`/`-c`/`-emit-obj` instead. These options require an LLVM backend to
be run by the driver to generate the output (this makese `-mllvm`
relevant here).
Differential Revision: https://reviews.llvm.org/D121374
Valentin Clement [Wed, 16 Mar 2022 10:34:33 +0000 (11:34 +0100)]
[flang] Lower adjustl and adjustr intrinsics
This patch adds lowering for the `adjustl` and `adjustr`
intrinsics.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D121780
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Valentin Clement [Wed, 16 Mar 2022 10:28:12 +0000 (11:28 +0100)]
[flang] Lower transfer instrinsic
This patch adds lowering for the `transfer` intrinsic.
The calls are lowered to runtime function calls.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D121777
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>
Andrzej Warzynski [Tue, 15 Mar 2022 17:07:07 +0000 (17:07 +0000)]
[flang][lowering] Add support for lowering of the `ibset` intrinsic
This patch adds support for lowering of the `ibset` intrinsic from Fortran
to the FIR dialect of MLIR.
This is part of the upstreaming effort from the `fir-dev` branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Differential Revision: https://reviews.llvm.org/D121717
Simon Moll [Wed, 16 Mar 2022 10:31:19 +0000 (11:31 +0100)]
[VE] v512|256 f32|64 fneg isel and tests
fneg instruction isel and tests. We do this also in preparation of fused
negatate-multiple-add fp operations.
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D121620
Florian Hahn [Wed, 16 Mar 2022 10:24:33 +0000 (10:24 +0000)]
[FunctionAttrs] Infer argmemonly .
This patch adds initial argmemonly inference, by checking the underlying
objects of locations returned by MemoryLocation.
I think this should cover most cases, except function calls to other
argmemonly functions.
I'm not sure if there's a reason why we don't infer those yet.
Additional argmemonly can improve codegen in some cases. It also makes
it easier to come up with a C reproducer for
7662d1687b09 (already fixed,
but I'm trying to see if C/C++ fuzzing could help to uncover similar
issues.)
Compile-time impact:
NewPM-O3: +0.01%
NewPM-ReleaseThinLTO: +0.03%
NewPM-ReleaseLTO+g: +0.05%
https://llvm-compile-time-tracker.com/compare.php?from=
067c035012fc061ad6378458774ac2df117283c6&to=
fe209d4aab5b593bd62d18c0876732ddcca1614d&stat=instructions
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D121415
Simon Moll [Wed, 16 Mar 2022 10:10:11 +0000 (11:10 +0100)]
[Clang] Allow "ext_vector_type" applied to Booleans
This is the `ext_vector_type` alternative to D81083.
This patch extends Clang to allow 'bool' as a valid vector element type
(attribute ext_vector_type) in C/C++.
This is intended as the canonical type for SIMD masks and facilitates
clean vector intrinsic declarations. Vectors of i1 are supported on IR
level and below down to many SIMD ISAs, such as AVX512, ARM SVE (fixed
vector length) and the VE target (NEC SX-Aurora TSUBASA).
The RFC on cfe-dev: https://lists.llvm.org/pipermail/cfe-dev/2020-May/065434.html
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D88905
Matthias Springer [Wed, 16 Mar 2022 08:01:17 +0000 (17:01 +0900)]
[mlir][bufferize] Do not deallocate allocs that are returned from a block
Such IR is rejected by default, but can be allowed with `allow-return-memref`. In preparation of future refactorings, do not deallocate such buffers.
One-Shot Analysis now gathers information about yielded tensors, so that we know during the actual bufferization whether a newly allocated buffer should be deallocated again. (Otherwise, it will leak. This will be addressed in a subsequent commit that also makes `allow-return-memref` a non-experimental flag.)
As a cleanup, `allow-return-memref` is now part of OneShotBufferizationOptions. (It was previously ignored by AlwaysCopyBufferizationState.) Moreover, AlwaysCopyBufferizationState now asserts that `create-deallocs` is deactivated to prevent surprising behavior.
Differential Revision: https://reviews.llvm.org/D121521
Matthias Springer [Wed, 16 Mar 2022 08:00:48 +0000 (17:00 +0900)]
[mlir][tensor] Implement ReifyRankedShapedTypeOpInterface on GenerateOp
Differential Revision: https://reviews.llvm.org/D121520
Nikita Popov [Wed, 16 Mar 2022 09:55:43 +0000 (10:55 +0100)]
[Tests] Update pipeline tests
After
20531b3a6b091b8dd2e3992aec11ac10581e91e2, we now use a cached
TTI instance, so the TargetIRAnalysis analysis run goes away.
Florian Hahn [Wed, 16 Mar 2022 09:46:03 +0000 (09:46 +0000)]
[ConstraintElimination] Add additional tests with uncond branches.
David Green [Wed, 16 Mar 2022 09:44:20 +0000 (09:44 +0000)]
[AArch64] Regenerate and extend peephole-and-tst.ll tests. NFC
Nikita Popov [Wed, 16 Mar 2022 09:36:00 +0000 (10:36 +0100)]
[RelLookupTableConverter] Avoid querying TTI for declarations
This code queries TTI on a single function, which is considered to
be representative. This is a bit odd, but probably fine in practice.
However, I think we should at least avoid querying declarations,
which e.g. will generally lack target attributes, and for which
we don't seem to ever query TTI in other places.
Matthias Gehre [Tue, 22 Feb 2022 15:32:17 +0000 (15:32 +0000)]
[SelectionDAG] Emit calls to __divei4 and friends for division/remainder of large integers
Emit calls to __divei4 and friends for divison/remainder of large integers.
This fixes https://github.com/llvm/llvm-project/issues/44994.
The overall RFC is in https://discourse.llvm.org/t/rfc-add-support-for-division-of-large-bitint-builtins-selectiondag-globalisel-clang/60329
The compiler-rt part is in https://reviews.llvm.org/D120327
Differential Revision: https://reviews.llvm.org/D120329
Nikita Popov [Wed, 16 Mar 2022 09:25:28 +0000 (10:25 +0100)]
[AAEval] Remove unused function (NFC)
serge-sans-paille [Wed, 16 Mar 2022 09:14:04 +0000 (10:14 +0100)]
Missing include in Support/Host.cpp under __MVS__
Nikita Popov [Tue, 15 Mar 2022 09:18:19 +0000 (10:18 +0100)]
[AAEval] Make compatible with opaque pointers
With opaque pointers, we cannot use the pointer element type to
determine the LocationSize for the AA query. Instead, -aa-eval
tests are now required to have an explicit load or store for any
pointer they want to compute alias results for, and the load/store
types are used to determine the location size.
This may affect ordering of results, and sorting within one result,
as the type is not considered part of the sorted string anymore.
To somewhat minimize the churn, printing still uses faux typed
pointer notation.
Sam McCall [Tue, 15 Mar 2022 22:15:56 +0000 (23:15 +0100)]
Use lit_config.substitute instead of foo % lit_config.params everywhere
This mechanically applies the same changes from D121427 everywhere.
Differential Revision: https://reviews.llvm.org/D121746
Valentin Clement [Wed, 16 Mar 2022 08:50:51 +0000 (09:50 +0100)]
[flang] Lower system_clock intrinsic
This patch adds lowering ofr the `system_clock` intrinsic.
The call is lowered to runtime function call.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D121776
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Owen Pan [Tue, 15 Mar 2022 09:41:02 +0000 (02:41 -0700)]
[clang-format] Fix crashes due to missing l_paren
Fixes #54384.
Differential Revision: https://reviews.llvm.org/D121682
wangyihan [Wed, 16 Mar 2022 08:01:35 +0000 (01:01 -0700)]
[llvm][ADT] Remove duplicate code in llvm::StringMapImpl::RehashTable
Remove duplicate code in llvm::StringMapImpl::RehashTable, near StringMap.cpp:229
```
if (!NewTableArray[NewBucket]) {
NewTableArray[FullHash & (NewSize - 1)] = Bucket;
NewHashArray[FullHash & (NewSize - 1)] = FullHash;
if (I == BucketNo)
NewBucketNo = NewBucket;
continue;
}
```
Reviewed By: MaskRay, dexonsmith
Differential Revision: https://reviews.llvm.org/D121726
Vlad Serebrennikov [Wed, 16 Mar 2022 07:46:44 +0000 (15:46 +0800)]
[clang] CWG 2354: prohibit alignas for enums
Reviewed By: aaron.ballman, erichkeane
Differential Revision: https://reviews.llvm.org/D121723
serge-sans-paille [Tue, 15 Mar 2022 09:54:19 +0000 (10:54 +0100)]
Cleanup codegen includes
This is a (fixed) recommit of https://reviews.llvm.org/D121169
after:
1061034926
before:
1063332844
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D121681
Fangrui Song [Wed, 16 Mar 2022 07:31:29 +0000 (00:31 -0700)]
[ELF] Move invalid binding diagnostic from initializeSymbols to postParse
It is excessive to have a diagnostic for STB_LOCAL. Just reuse the invalid
binding diagnostic for STB_LOCAL.
Weining Lu [Wed, 16 Mar 2022 06:53:20 +0000 (14:53 +0800)]
[LoongArch] Add some missing comments. NFC
Add more comments /*Lower=*/ and /*Upper=*/ calling generateImmOutOfRangeError.
Fangrui Song [Wed, 16 Mar 2022 06:51:11 +0000 (23:51 -0700)]
[ELF] Use endianness-aware read32 to avoid dispatch. NFC
Fangrui Song [Wed, 16 Mar 2022 06:41:30 +0000 (23:41 -0700)]
[ELF] Inline ARMExidxSyntheticSection::classof. NFC
To optimize the only call site `dyn_cast<ARMExidxSyntheticSection>(first)` and
decrease code size.
Fangrui Song [Wed, 16 Mar 2022 06:15:43 +0000 (23:15 -0700)]
[ELF] Optimize "Strip sections"
If SHT_LLVM_SYMPART is unused, don't iterate over inputSections.
If neither --strip-debug/--strip-all, don't iterate over inputSections.
Valentin Clement [Wed, 16 Mar 2022 05:37:29 +0000 (06:37 +0100)]
[flang] Lower date_and_time and cpu_time intrinsics
This patch lowers the `cpu_time` and the `date_and_time` instrinsics to
FIR and runtime calls.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D121704
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121705
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Valentin Clement [Wed, 16 Mar 2022 05:36:24 +0000 (06:36 +0100)]
[flang][NFC] Remove duplicated header file
Remove IntervalSet.h since it is a duplicate from
flang/include/flang/Lower/IntervalSet.h.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121747
Shengchen Kan [Wed, 16 Mar 2022 05:01:26 +0000 (13:01 +0800)]
[NFC][X86] Rename some variables and functions about target features
This is preparation for D121768. The member's name should align w/
the interface for trival target feature.
MaheshRavishankar [Wed, 16 Mar 2022 04:51:17 +0000 (04:51 +0000)]
[mlir][Linalg] Add multi-result op cast test.
https://reviews.llvm.org/D121369 fixed an issue with canonicalizing a
linalg op producer with a cast op consumer. Adding a test to verify
that change.
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D121648
River Riddle [Wed, 16 Mar 2022 04:54:55 +0000 (21:54 -0700)]
[mlir:OpenMP] Fix memory leak in asan translation
A fake unreachable was created and removed, but never
erased.
Alex Brachet [Wed, 16 Mar 2022 04:00:26 +0000 (04:00 +0000)]
[libc] Unlock after pop_back
Alex Brachet [Wed, 16 Mar 2022 03:34:54 +0000 (03:34 +0000)]
[libc][NFC] Use more common variable naming convention
We were in between two styles when this file was initially
checked in.
Manoj Gupta [Mon, 14 Mar 2022 21:19:37 +0000 (14:19 -0700)]
[msan] Add interceptors for Linux 64-bit stat variants
glibc >= 2.33 uses shared functions for stat family functions.
D111984 added support for non-64 bit variants but they
do not appear to be enough as we have been noticing msan
errors on 64-bit stat variants on Chrome OS.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D121652
Sterling Augustine [Wed, 16 Mar 2022 02:41:33 +0000 (19:41 -0700)]
Updated mlir-tablegen dependencies for
f96a8675cd29776ca39bb76133ee9167f5001f17
Differential Revision: https://reviews.llvm.org/D121764
Fangrui Song [Wed, 16 Mar 2022 02:24:41 +0000 (19:24 -0700)]
[ELF] Move section assignment from initializeSymbols to postParse
https://discourse.llvm.org/t/parallel-input-file-parsing/60164
initializeSymbols currently sets Defined::section and handles non-prevailing
COMDAT groups. Move the code to the parallel postParse to reduce work from the
single-threading code path and make parallel section initialization infeasible.
Postpone reporting duplicate symbol errors so that the messages have the
section information. (`Defined::section` is assigned in postParse and another
thread may not have the information).
* duplicated-synthetic-sym.s: BinaryFile duplicate definition (very rare) now
has no section information
* comdat-binding: `%t/w.o %t/g.o` leads to an undesired undefined symbol. This
is not ideal but we report a diagnostic to inform that this is unsupported.
(See release note)
* comdat-discarded-lazy.s: %tdef.o is unextracted. The new behavior (discarded
section error) makes more sense
* i386-comdat.s: switched to a better approach working around
.gnu.linkonce.t.__x86.get_pc_thunk.bx in glibc<2.32 for x86-32.
Drop the ancient no-longer-relevant workaround for __i686.get_pc_thunk.bx
Depends on D120640
Differential Revision: https://reviews.llvm.org/D120626
Haocong.Lu [Wed, 16 Mar 2022 02:07:21 +0000 (02:07 +0000)]
[RISCV] Select SRLI+SLLI for AND with leading ones mask
Select SRLI+SLLI for and i64 %x, imm if the imm is a leading ones mask.
It's useful in RV64 when the mask exceeds simm32 (cannot be generated by LUI).
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D121598
Sam McCall [Wed, 16 Mar 2022 02:01:40 +0000 (03:01 +0100)]
[lit] Remove clang_libs_dir
Seems to have been added accidentally in
58db03a116a197719 and then
copied into clangd by me (but not actually needed).
Fangrui Song [Wed, 16 Mar 2022 02:00:54 +0000 (19:00 -0700)]
Revert D120626 "[ELF] Move section assignment from initializeSymbols to postParse"
This reverts commit
c30e6447c0225f675773d07f2b6d4e3c2b962155.
It exposed brittle support for __x86.get_pc_thunk.bx.
Need to think a bit how to support __x86.get_pc_thunk.bx.
Fangrui Song [Wed, 16 Mar 2022 01:47:52 +0000 (18:47 -0700)]
[ELF][test] Improve i386-linkonce.s
Make it behave like the glibc<2.32 .gnu.linkonce usage that we want to work around.
Shafik Yaghmour [Wed, 16 Mar 2022 01:10:30 +0000 (18:10 -0700)]
[LLDB][NFC] Remove dead code from Section.cpp
Removing comment out code, looks like debugging code left over from a while ago.
Vitaly Buka [Wed, 16 Mar 2022 01:01:07 +0000 (18:01 -0700)]
[lsan] Attempt to fix s390x after
a63932a8
Sam Clegg [Mon, 7 Mar 2022 23:50:30 +0000 (15:50 -0800)]
[lld][WebAssembly] Take advantage of extended const expressions when available
In particular we use these in two places:
1. When building PIC code we no longer need to combine output segments
into a single segment that can be initialized at `__memory_base`.
Instead each segment can encode its offset from `__memory_base` in
its initializer. e.g.
```
(i32.add (global.get __memory_base) (i32.const offset)
```
2. When building PIC code we no longer need to relocation internalized
global addresses. We can just initialize them with their correct
offsets.
Differential Revision: https://reviews.llvm.org/D121420
Zequan Wu [Wed, 16 Mar 2022 00:49:24 +0000 (17:49 -0700)]
[LLDB][NativePDB] Remove REQUIRES: system-windows for local-variables-regsiters.s
Nico Weber [Wed, 16 Mar 2022 00:44:59 +0000 (20:44 -0400)]
[gn build] (manually) port
89cd86bbc58a (clang-pseudo move)
Aart Bik [Tue, 15 Mar 2022 21:30:08 +0000 (14:30 -0700)]
[mlir][sparse] add one extra index test on f32 matrix
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D121743
River Riddle [Tue, 15 Mar 2022 23:40:36 +0000 (16:40 -0700)]
[mlir:PDLInterp][NFC] Switch to using prefixed accessors
PDLInterp is effectively an internal dialect, so there isn't a need to
stage the switch.
River Riddle [Tue, 15 Mar 2022 23:09:19 +0000 (16:09 -0700)]
[mlir:Toy][NFC] Switch toy to use prefixed accessors
Jez Ng [Wed, 16 Mar 2022 00:25:06 +0000 (20:25 -0400)]
[lld-macho] Set FinalDefinitionInLinkageUnit on most LTO externs
Since Mach-O has a two-level namespace (unlike ELF), we can usually set
this property to true.
(I believe this setting is only available in the new LTO backend, so I
can't really use ld64 / libLTO's behavior as a reference here... I'm
just doing what I think is correct.)
See {D119294} for the work done to calculate the `interposable` used in
this diff.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D119506