Christudasan Devadasan [Thu, 11 May 2023 16:13:18 +0000 (21:43 +0530)]
[AMDGPU] Add optional tied-op for wwm-register's epilog spill restore
The COPY inserted in the epilog block before return instruction as part
of ABI lowering, can get optimized during machine copy propagation if
the same register is used earlier in a wwm operation that demands the
prolog/epilog wwm-spill store/restore to preserve its inactive lanes.
With the spill restore in the epilog, the preceding COPY appears to be
dead during machine-cp. To avoid it, mark the same register as a tied-op
in the spill restore instruction to ensure a usage for the COPY.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D150381
Jonas Devlieghere [Tue, 16 May 2023 05:14:35 +0000 (22:14 -0700)]
[lldb] Fix lldb_assert -> lldbassert in docs
Update the documentation to reference lldbassert rather than
lldb_assert. The latter is the implementation, which shouldn't be used
directly. Instead, users should use lldbassert which is the macro that
expands to assert or lldb_assert depending on the build type.
Sameer Sahasrabuddhe [Tue, 16 May 2023 04:07:04 +0000 (09:37 +0530)]
[LLVM][Uniformity] Improve detection of uniform registers
The MachineUA now queries the target to determine if a given register holds a
uniform value. This is determined using the corresponding register bank if
available, or by a combination of the register class and value type. This
assumes that the target is optimizing for performance by choosing registers, and
the target is responsible for any mismatch with the inferred uniformity.
For example, on AMDGPU, an SGPR is now treated as uniform, except if the
register bank is VCC (i.e., the register holds a wave-wide vector of 1-bit
values) or equivalently if it has a value type of s1.
- This does not always work with inline asm, where the register bank or the
value type might not be present. We assume that the SGPR is uniform, because
it is not expected to be s1 in the vast majority of cases.
- The pseudo branch instruction SI_LOOP is now hard-coded to be always
divergent, although its condition is an SGPR.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D150438
Joshua Cao [Tue, 16 May 2023 03:28:40 +0000 (20:28 -0700)]
[SimpleLoopUnswitch] Skip trivial select conds for selects
Fixes https://github.com/llvm/llvm-project/issues/62715
If a select's condition is a trivial select:
```
%s = select %cond, i1 true, i1 false
```
Unswitch on %cond, rather than %s. This fixes crashes where there is a
disparity in finding candidates and and the transformation logic.
Aiden Grossman [Tue, 16 May 2023 03:19:12 +0000 (03:19 +0000)]
[Docs][llvm-exegesis] Specify platform support for different modes
llvm-exegesis has both a capture mode and an analysis mode that can be
used independently of each other. This patch makes it clear that
analysis mode will work on other platforms that LLVM supports in the
documentation which was unclear before.
Reviewed By: courbet
Differential Revision: https://reviews.llvm.org/D150536
Chuanqi Xu [Tue, 16 May 2023 03:22:02 +0000 (11:22 +0800)]
[NFC] [C++20] [Modules] Rename ASTContext::getNamedModuleForCodeGen to ASTContext::getCurrentNamedModule
The original name "ASTContext::getNamedModuleForCodeGen" is not properly
reflecting the usage of the interface. This interface can be used to
judge the current module unit in both sema analysis and code generation.
So the original name was not so correct.
sstwcw [Tue, 16 May 2023 02:50:07 +0000 (02:50 +0000)]
[clang-format] Stop comment disrupting indentation of Verilog ports
Before:
```
module x
#( //
parameter x)
( //
input y);
endmodule
```
After:
```
module x
#(//
parameter x)
(//
input y);
endmodule
```
If the first line in a port or parameter list is not a comment, the
following lines will be aligned to the first line as intended:
```
module x
#(parameter x1,
parameter x2)
(input y,
input y2);
endmodule
```
Previously, the indentation would be changed to an extra continuation
indentation relative to the start of the parenthesis or the hash if
the first token inside the parentheses was a comment. It is a feature
introduced in
ddaa9be97839. The feature enabled one to insert a `//`
comment right after an opening parentheses to put the function
arguments on a new line with a small indentation regardless of how
long the function name is, like this:
```
someFunction(anotherFunction( // Force break.
parameter));
```
People are unlikely to use this feature in a Verilog port list because
the formatter already puts the port list on its own lines. A comment
at the start of a port list is probably a comment for the port on the
next line.
We also removed the space before the comment so that its indentation
would be same as that for a line comment anywhere else in the port
list.
Reviewed By: HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D149562
Xi Ruoyao [Tue, 16 May 2023 02:56:14 +0000 (03:56 +0100)]
[clangd] Fix test failure when it's built with compiler flags unknown by clang
If LLVM is built with a compiler other than clang, the `compile_commands.json`
file may contain compiler flags unknown by clang. When a clangd test is copied
into the build directory and checked, clangd will pick the unknown flag from
the file and cause a test failure. Create an empty `compile_commands.json` in
the test directory nested in the build directory to override it.
Reviewed By: thesamesam
Differential Revision: https://reviews.llvm.org/D150582
Chuanqi Xu [Tue, 16 May 2023 02:36:08 +0000 (10:36 +0800)]
Revert "[NFC] [C++20] [Modules] Refactor Sema::isModuleUnitOfCurrentTU into"
This reverts commit
f109b1016801e2b0dbee278f3c517057c0b1d441 as required
in
https://github.com/llvm/llvm-project/commit/
f109b1016801e2b0dbee278f3c517057c0b1d441#commitcomment-
113477829.
Chuanqi Xu [Tue, 16 May 2023 02:19:27 +0000 (10:19 +0800)]
[NFC] [C++20] [Modules] Refactoring
b6c7177145bc to make it not
dependent on f109b10
Given
https://github.com/llvm/llvm-project/commit/
f109b1016801e2b0dbee278f3c517057c0b1d441#commitcomment-
113477829,
we need to revert f109b10. So it will be better to make this patch not
dependent on f109b10 as much as possible.
Katherine Rasmussen [Tue, 16 May 2023 01:08:17 +0000 (18:08 -0700)]
[flang] Add check for constraints on event-stmts
In the CoarrayChecker, add checks for the constraints C1177 and
C1178 for event-wait-stmt. Add event-post-stmt to the check
for the constraints for sync-stat-list. Add a check for the
constraint C1176 on event-variable.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D137204
Fangrui Song [Tue, 16 May 2023 01:44:55 +0000 (18:44 -0700)]
[RISCV][MC] .debug_line/.debug_frame/.eh_frame: emit relocations for assembly input files with relaxation
When assembling `.debug_line` for both explicitly specified and synthesized
`.loc` directives. the integrated assembler may incorrectly omit relocations for
-mrelax.
For an assembly file, we have a `MCAssembler` object and `evaluateAsAbsolute`
will incorrectly fold `AddrDelta` to a constant (which is not true in the
presence of linker relaxation).
`MCDwarfLineAddr::Emit` will emit a special opcode, which does not take into
account of linker relaxation. This is a sufficiently complex function that
I think should be called in any "fast paths" for linker relaxation aware assembling.
The following script demonstrates the bugs.
```
cat > x.c <<eof
void f();
void _start() {
f();
f();
f();
}
eof
# C to object file: correct DW_LNS_fixed_advance_pc
clang --target=riscv64 -g -c x.c
llvm-dwarfdump --debug-line -v x.o | grep \ DW_LNS_fixed_advance_pc -q
# Assembly to object file with synthesized line number information: incorrect special opcodes
clang --target=riscv64 -S x.c && clang --target=riscv64 -g -c x.s
llvm-dwarfdump --debug-line -v x.o | grep \ DW_LNS_fixed_advance_pc -q; test $? -eq 1
# Assembly with .loc to object file: incorrect special opcodes
clang --target=riscv64 -S -g x.c && clang --target=riscv64 -c x.s
llvm-dwarfdump --debug-line -v x.o | grep \ DW_LNS_fixed_advance_pc -q; test $? -eq 1
```
The `MCDwarfLineAddr::Emit` code path is an old optimization in commit
57ab708bdd3231b23a8ef4978b11ff07616034a2 (2010) that seems no longer relevant.
It don't trigger for direct machine code emission (label differences are not
foldable without a `MCAssembler`). MCDwarfLineAddr::Emit does complex operations
that are repeated in MCAssembler::relaxDwarfLineAddr, which an intricate RISCV
override.
Let's remove the "fast path". Assembling the assembly output of
X86ISelLowering.cpp with `-g` may be 2% slower, but I think the cost is fine.
There are opportunities to make the "slow path" faster, e.g.
* Optimizing the current new MC*Fragment pattern that allocates new fragments on
the heap.
* Reducing the number of relaxation times for .debug_line and .debug_frame, as
well as possibly other sections using LEB128. For instance, LEB128 can have a
one-byte estimate to avoid the second relaxation iteration.
For assembly input with -mno-relax, in theory we can prefer special opcodes to
DW_LNS_fixed_advance_pc to decrease the size of .debug_line, but such a change
may be overkill and unnecessarily diverge from -mrelax behaviors and GCC.
---
For .debug_frame/.eh_frame, MCDwarf currently emits DW_CFA_advance_loc without
relocations. Remove the special case to enable relocations. Similar to
.debug_line, even without the bug fix, the MCDwarfFrameEmitter::encodeAdvanceLoc
special case is a sufficiently complex code path that should be avoided.
---
When there are more than one section, we generate .debug_rnglists for
DWARF v5. We currently emit DW_RLE_start_length using ULEB128, which
is incorrect. The new test gen-dwarf.s adds a TODO.
---
About other `evaluateAsAbsolute` uses. `MCObjectStreamer::emit[SU]LEB128Value`
have similar code to MCDwarfLineAddr. They are fine to keep as we don't have
LEB128 relocations to correctly represent link-time non-constants anyway.
---
In the future, we should investigate ending a MCFragment for a relaxable
instruction, to further clean up the assembler support for linker relaxation
and fix `evaluateAsAbsolute`.
See
bbea64250f65480d787e1c5ff45c4de3ec2dcda8 for some of the related code.
Reviewed By: enh, barannikov88
Differential Revision: https://reviews.llvm.org/D150004
Aart Bik [Tue, 16 May 2023 00:54:47 +0000 (17:54 -0700)]
[mlir][sparse] change runners to c_runners
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D150628
Kai Sasaki [Tue, 16 May 2023 00:41:28 +0000 (09:41 +0900)]
[mlir][tosa] Fold consecutive negate as no-op
Consecutive element-wise negate should be canonicalized as no-op.
Reviewed By: eric-k256
Differential Revision: https://reviews.llvm.org/D150518
eopXD [Tue, 2 May 2023 10:16:44 +0000 (03:16 -0700)]
[RISCV] Support vreinterpret intrinsics between vector boolean type and m1 vector integer type
Link to specification: [riscv-non-isa/rvv-intrinsic-doc#221](https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/221)
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D149642
Arthur Eubanks [Tue, 16 May 2023 00:44:53 +0000 (17:44 -0700)]
Revert "[MergeICmps] Adapt to non-eq comparisons, bugfix"
This reverts commit
ae337ed5951c896164e07618d651d086f978ff2c.
Still causes miscompiles, see D141188.
Jan Svoboda [Mon, 15 May 2023 21:26:10 +0000 (14:26 -0700)]
[clang][deps] Do not cache PCM files
On incremental scan, caching an out-of-date PCM on the VFS layer causes each TU and each module to recompile the PCM again. This is huge performance problem. Stop caching ".pcm" files.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D150615
Jan Svoboda [Mon, 15 May 2023 21:24:08 +0000 (14:24 -0700)]
Revert "[clang][deps] Only cache files with specific extension"
This reverts commit
d1e00b6f136ec71a4c95a7eb4fd81ec0ab547962.
Internally, there were issues with caching stat failures for .framework directories. We need some time for investigation to pinpoint what exactly was going wrong.
Alex Langford [Mon, 15 May 2023 23:06:50 +0000 (16:06 -0700)]
[lldb] Fix lua build after
27b6a4e63afe
This applies the same trick for Lua that I did for python in
27b6a4e63afe.
Differential Revision: https://reviews.llvm.org/D150624
Arthur Eubanks [Mon, 15 May 2023 23:57:10 +0000 (16:57 -0700)]
[StructuralHash] Track global variables
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D149209
Arthur Eubanks [Mon, 15 May 2023 23:50:56 +0000 (16:50 -0700)]
[llvm-exegesis] Create a proper LLVM IR Function for MachineFunctions
I have upcoming changes break with invalid Function definitions.
Reviewed By: aidengrossman, courbet
Differential Revision: https://reviews.llvm.org/D149207
Mehdi Amini [Fri, 12 May 2023 21:58:25 +0000 (22:58 +0100)]
Fix MLIR build (typo in VectorOps.cpp)
Lei Zhang [Mon, 15 May 2023 22:36:08 +0000 (22:36 +0000)]
[mlir][spirv] Check type legality using converter for vectors
This allows `index` vectors to be converted to SPIR-V.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D150616
Igor Kudrin [Sat, 22 Apr 2023 03:01:10 +0000 (20:01 -0700)]
[CMake] Use LLVM own tools in extract_symbols.py
As for now, 'extract_symbols.py' can use several tools to extract
symbols from object files and libraries and to guess if the target is
32-bit Windows. The tools are being found via PATH, so in most cases,
they are just system tools. This approach has a number of limitations,
in particular:
* System tools may not be able to handle the target format in case of
cross-platform builds,
* They cannot read symbols from LLVM bitcode files, so the staged LTO
build with plugins is not supported,
* The auto-selected tools may be suboptimal (see D113557),
* Support for multiple tools for a single task increases the complexity
of the script code.
The patch proposes using LLVM's own tools to solve these issues.
Specifically, 'llvm-readobj' detects the target platform, and 'llvm-nm'
reads symbols from all supported formats, including bitcode files. The
tools can be built in Release mode for the host platform or overridden
using CMake settings 'LLVM_READOBJ' and 'LLVM_NM' respectively. The
implementation also supports using precompiled tools via
'LLVM_NATIVE_TOOL_DIR'.
Differential Revision: https://reviews.llvm.org/D149119
Arthur Eubanks [Mon, 15 May 2023 22:45:54 +0000 (15:45 -0700)]
[llvm-reduce] Only write reduced output after we've saved it
Otherwise we're just rewriting the currently saved module instead of the newly reduced one.
Doesn't affect the final output since we separately write that at the end.
Mehdi Amini [Sat, 22 Apr 2023 01:08:16 +0000 (19:08 -0600)]
Adopt Properties to store operations inherent Attributes in the X86Vector dialect
This is part of an on-going migration to adopt Properties inside MLIR.
Differential Revision: https://reviews.llvm.org/D148976
Mehdi Amini [Fri, 21 Apr 2023 07:17:20 +0000 (01:17 -0600)]
Adopt Properties to store operations inherent Attributes in the Vector dialect
This is part of an on-going migration to adopt Properties inside MLIR.
Differential Revision: https://reviews.llvm.org/D148939
Mehdi Amini [Fri, 21 Apr 2023 07:13:20 +0000 (01:13 -0600)]
Adopt Properties to store operations inherent Attributes in the Transform dialect
This is part of an on-going migration to adopt Properties inside MLIR.
Differential Revision: https://reviews.llvm.org/D148938
Jessica Paquette [Mon, 15 May 2023 22:25:12 +0000 (15:25 -0700)]
[MachineOutliner] NFC: Add debug output to MachineOutliner::outline
Add some debug output to `outline` to assist in debugging + understanding the
code.
This will say
- How many things we found worth turning into outlined functions
- Whether or not candidates were pruned via the outlining algorithm
- The function created (if it was created)
- Where the calls were inserted
- What instruction was used to create the call
Sample output below:
```
NUMBER OF POTENTIAL FUNCTIONS: 5
WALKING FUNCTION LIST
PRUNED: 0/2 candidates
OUTLINE: Expected benefit (12 B) > threshold (1 B)
NEW FUNCTION: OUTLINED_FUNCTION_0
CREATE OUTLINED CALLS
CALL: OUTLINED_FUNCTION_0 in bar:<unknown>
.. BL @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp
CALL: OUTLINED_FUNCTION_0 in bar:<unknown>
.. BL @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp
PRUNED: 2/2 candidates
SKIP: Expected benefit (0 B) < threshold (1 B)
PRUNED: 0/2 candidates
OUTLINE: Expected benefit (8 B) > threshold (1 B)
NEW FUNCTION: OUTLINED_FUNCTION_1
CREATE OUTLINED CALLS
CALL: OUTLINED_FUNCTION_1 in bar:<unknown>
.. BL @OUTLINED_FUNCTION_1, implicit-def $lr, implicit $sp
CALL: OUTLINED_FUNCTION_1 in bar:<unknown>
.. BL @OUTLINED_FUNCTION_1, implicit-def $lr, implicit $sp
PRUNED: 2/2 candidates
SKIP: Expected benefit (0 B) < threshold (1 B)
PRUNED: 2/2 candidates
SKIP: Expected benefit (0 B) < threshold (1 B)
```
Dave Lee [Mon, 8 May 2023 17:13:33 +0000 (10:13 -0700)]
[lldb] Refine call to decl printing helper (NFC)
When `ValueObjectPrinter` calls its `m_decl_printing_helper`, not all state is passed to
the helper. In particular, the helper doesn't have access to `m_curr_depth`, and thus
can't act on the logic within `ShouldShowName`.
To address this, this change passes in a modified copy of `m_options`. The modified copy
has has `m_hide_name` set according to the results of `ShouldShowName`. This allows
helper functions to know whether the name should be shown or hidden, without having
access to `ValueObjectPrinter`'s full state.
This is NFC in mainline lldb, as the only decl printing helper doesn't make use of this.
However in swift-lldb at least, there are decl printing helpers that do need this
information passed to them. See https://github.com/apple/llvm-project/pull/6795 where a
test is also included.
Differential Revision: https://reviews.llvm.org/D150129
Tai Ly [Mon, 15 May 2023 22:08:29 +0000 (15:08 -0700)]
[TOSA] Add QuantizationDialect to TOSA's dependentDialects
This adds QuantizationDialect to the dependent dialects of TOSA
This fixes the intermittent bug when creating uniform quantized type when none was parsed in.
LLVM ERROR: can't create type 'mlir::quant::UniformQuantizedType' because storage uniquer isn't initialized: the dialect was likely not loaded, or the type wasn't added with addTypes<...>() in the Dialect::initialize() method.
This happens, for example, in convert-tfl-uint8 pass when trying to create uniform quantized type i8 with zero-point=-128 to convert from ui8 type.
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: I204248a45fd728d0cec8dc20214cb0b74de81e7b
Reviewed By: eric-k256
Differential Revision: https://reviews.llvm.org/D149354
LLVM GN Syncbot [Mon, 15 May 2023 21:49:25 +0000 (21:49 +0000)]
[gn build] Port
7ace54e64bb6
Nikolas Klauser [Mon, 15 May 2023 17:38:01 +0000 (10:38 -0700)]
[libc++][PSTL] Implement std::copy{,_n}
Reviewed By: ldionne, #libc
Spies: jloser, libcxx-commits
Differential Revision: https://reviews.llvm.org/D149706
Nick Desaulniers [Mon, 15 May 2023 21:32:38 +0000 (14:32 -0700)]
[Demangle] fix comment NFC
The second and third parameter of itaniumDemangle were removed in
commit
7277a72b908d ("[Demangle] remove unused params of itaniumDemangle")
Update a comment to reflect this.
Reviewed By: nathanchance
Differential Revision: https://reviews.llvm.org/D149975
Jonas Devlieghere [Mon, 15 May 2023 21:29:20 +0000 (14:29 -0700)]
[lldb] Set CMAKE_CXX_STANDARD before including LLDBStandalone
Set the C++ language standard before including LLDBStandalone.cmake.
Otherwise we risk building some of our dependencies (such as llvm_gtest)
without C++ 17 support.
This should fix the standalone bot [1] which is currently failing with the
following error:
test-port.h:841:12: error: no member named 'tuple' in namespace 'std'
using std::tuple;
[1] https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-standalone
Alex Langford [Wed, 10 May 2023 00:04:37 +0000 (17:04 -0700)]
[lldb] Change definition of DisassemblerCreateInstance
DissassemblerCreateInstance is a function pointer whos return type is
`Disassembler *`. But Disassembler::FindPlugin always returns a
DisassemblerSP, so there's no reason why we can't just create a
DisassemblerSP in the first place.
Differential Revision: https://reviews.llvm.org/D150235
Jan Svoboda [Mon, 15 May 2023 20:28:07 +0000 (13:28 -0700)]
[clang][modules] NFC: Only sort interesting identifiers
In
9c254184 `ASTWriter` stopped writing identifiers that are not interesting. Taking it a bit further, we don't need to sort the whole identifier table, just the interesting identifiers. This reduces the size of sorted vector from ~10k (including lots of builtins) to 2 (`__VA_ARGS__` and `__VA_OPT__`) in a typical Xcode project, improving `clang-scan-deps` performance.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D150494
Muhammad Omair Javaid [Mon, 15 May 2023 20:09:13 +0000 (00:09 +0400)]
[LLDB] Fix TestDataFormatterSynthVal.py for AArch64/Windows
Since 44363f2 various tests have started passing but introduced a
expression evaluation failure in TestDataFormatterSynthVal.py.
This patch marks the expression evaluation part as skipped while rest
of the test passes.
This patch aslo introduces a new helper isAArch64Windows in lldbtest.py.
Jon Roelofs [Mon, 15 May 2023 19:57:39 +0000 (12:57 -0700)]
asan-rt: Silence a few -Wformat=pedantic's in asan_mac.cpp
Differential revision: https://reviews.llvm.org/D150604
Piotr Zegar [Mon, 15 May 2023 19:23:56 +0000 (19:23 +0000)]
[clang-tidy] Extract areStatementsIdentical
Move areStatementsIdentical from BranchCloneCheck into ASTUtils.
Add small improvments. Use it in LoopConvertUtils.
Reviewed By: carlosgalvezp
Differential Revision: https://reviews.llvm.org/D148995
Muhammad Omair Javaid [Mon, 15 May 2023 19:13:19 +0000 (23:13 +0400)]
Revert "Emit the correct flags for the PROC CodeView Debug Symbol"
This reverts commit
e48826e016e2f427f3b7b1274166aa9aa0ea7f4f.
https://lab.llvm.org/buildbot/#/builders/219/builds/2520
ldb-shell :: SymbolFile/PDB/function-nested-block.test
Differential Revision: https://reviews.llvm.org/D148761
Louis Dionne [Mon, 15 May 2023 19:35:15 +0000 (12:35 -0700)]
[libc++] Revert moving the pre-release checklist
I had not seen https://reviews.llvm.org/D150585 which supersedes
this, and I want to avoid merge conflicts for D150585.
Jessica Clarke [Mon, 15 May 2023 19:26:49 +0000 (20:26 +0100)]
[clang] Fix emitVoidPtrVAArg for non-zero default alloca address space
Indirect arguments are passed on the stack and so va_arg should use the
default alloca address space, not hard-code 0, for pointers to those.
The only in-tree target with a non-zero default alloca address space is
AMDGPU, but that does not support variadic arguments, so we cannot test
this upstream. However, downstream in CHERI LLVM (and Morello LLVM, a
further fork of that) we have targets that do both and so require this
change.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D132247
Mehdi Amini [Mon, 15 May 2023 19:12:28 +0000 (12:12 -0700)]
Fix ConstShapeOp::inferReturnTypes to be resilient to lack of properties
The Python bindings test aren't using properties yet, this is a bit
of a hack to support this here, but hopefully it'll be temporary.
Mehdi Amini [Mon, 15 May 2023 18:03:24 +0000 (11:03 -0700)]
Add an operator == and != to properties, use it in DuplicateFunctionElimination
Differential Revision: https://reviews.llvm.org/D150596
ziqingluo-90 [Mon, 15 May 2023 18:55:35 +0000 (11:55 -0700)]
Re-land "[-Wunsafe-buffer-usage] Remove an unnecessary const-qualifier"
Re-land
7a0900fd3e2d34bc1d513a97cf8fbdc1754252d7, which includes too
much clang-format changes. This re-land gets rid of the format changes.
Francesco Petrogalli [Mon, 15 May 2023 13:49:04 +0000 (15:49 +0200)]
[docs] Use doxygen to describe the field `StartAtCycle`. [NFCI]
Differential Revision: https://reviews.llvm.org/D150572
Muhammad Omair Javaid [Mon, 15 May 2023 10:25:52 +0000 (14:25 +0400)]
Revert "[lldb] Refactor SBFileSpec::GetDirectory"
This reverts commit
2bea2d7b070dc5df723ce2b92dbc654b8bb1847e.
It introduced following failures on buildbot lldb-aarch64-windows:
lldb-api :: functionalities/process_save_core/TestProcessSaveCore.py
lldb-api :: python_api/symbol-context/TestSymbolContext.py
Differential Revision: https://reviews.llvm.org/D149625
ziqingluo-90 [Mon, 15 May 2023 18:25:52 +0000 (11:25 -0700)]
Revert "[-Wunsafe-buffer-usage] Remove an unnecessary const-qualifier"
This reverts commit
7a0900fd3e2d34bc1d513a97cf8fbdc1754252d7.
The commit includes too much clang-format changes.
Mehdi Amini [Mon, 15 May 2023 05:39:50 +0000 (22:39 -0700)]
Cleanup uses of getAttrDictionary() in MLIR to use getDiscardableAttrDictionary() when possible
This also speeds up some benchmarks in compiling simple fortan file by 2x!
Fixes #62687
Differential Revision: https://reviews.llvm.org/D150540
Louis Dionne [Mon, 15 May 2023 18:34:54 +0000 (11:34 -0700)]
[libc++][NFC] Reformat test
I didn't notice in the review that clang-format made a poor job at
formatting the test so I went back and did it manually.
Louis Dionne [Mon, 15 May 2023 18:19:23 +0000 (11:19 -0700)]
[libc++][NFC] Use angle brackets to include ranges_mismatch.h
LLVM GN Syncbot [Mon, 15 May 2023 18:29:44 +0000 (18:29 +0000)]
[gn build] Port
61d5671c1697
LLVM GN Syncbot [Mon, 15 May 2023 18:29:43 +0000 (18:29 +0000)]
[gn build] Port
205175578e0d
Mark de Wever [Sun, 7 May 2023 17:50:41 +0000 (19:50 +0200)]
[libc++] Removes _LIBCPP_ABI_OLD_LOGNORMAL_DISTRIBUTION
This was planned for LLVM 15 but was never done.
Reviewed By: #libc, philnik
Differential Revision: https://reviews.llvm.org/D150580
Valentin Clement [Mon, 15 May 2023 18:22:12 +0000 (11:22 -0700)]
[flang][openacc] Lower host_data construct
Lower host_data construct to the acc.host_data operation.
Depends on D150289
Reviewed By: razvanlupusoru, jeanPerier
Differential Revision: https://reviews.llvm.org/D150290
Alexey Bataev [Fri, 5 May 2023 21:14:39 +0000 (14:14 -0700)]
[SLP][NFC]Add missing finalize params in the CostEstimator, NFC.
Prepare functions for generalization of codegen/cost estimation.
Differential Revision: https://reviews.llvm.org/D150121
zijunzhao [Mon, 8 May 2023 22:04:00 +0000 (22:04 +0000)]
[libc++] Implement ranges::starts_with
Peter Smith [Mon, 15 May 2023 18:01:05 +0000 (19:01 +0100)]
[LLD][ELF] change CHECK to CHECK-NEXT in overlay-phdr.test NFCI
A code-review comment to change a couple of CHECK to CHECK-NEXT that I
forgot to apply prior to committing.
Differential Revision: https://reviews.llvm.org/D150445
Nikolas Klauser [Mon, 15 May 2023 17:33:40 +0000 (10:33 -0700)]
Revert "[libc++][PSTL] Implement std::copy{,_n}"
This reverts commit
b049fc0481bc387f57fd61da7239f85ef91096c1.
The wrong patch was landed.
Aart Bik [Mon, 15 May 2023 17:27:39 +0000 (10:27 -0700)]
[mlir][sparse][gpu] end-to-end integration test of GPU libgen approach
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D150172
Jake Egan [Mon, 15 May 2023 17:48:05 +0000 (13:48 -0400)]
Revert "[AIX][tests] XFAIL -ftime-trace test for now"
The test was fixed by
2f999327534f7cc660d2747ce294f50184dc1f97.
This reverts commit
25dc215ddaa6cb3e206858008fe4bc6844ea0d9c.
Slava Zakharin [Mon, 15 May 2023 16:52:14 +0000 (09:52 -0700)]
[flang][runtime] Fixed memory leak in Assign().
The temporary descriptor must be either Pointer or Allocatable,
otherwise its memory will not be freed.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D150534
Slava Zakharin [Mon, 15 May 2023 16:52:07 +0000 (09:52 -0700)]
[flang][runtime] Fixed dimension offset computation for MayAlias.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D150533
LLVM GN Syncbot [Mon, 15 May 2023 17:38:45 +0000 (17:38 +0000)]
[gn build] Port
b049fc0481bc
Louis Dionne [Mon, 15 May 2023 17:34:17 +0000 (10:34 -0700)]
[libc++][docs] Move the pre-release check-list
It was confusing to some contributors because it appeared in a
prominent place on the Contibuting page.
Nikolas Klauser [Fri, 5 May 2023 16:24:58 +0000 (09:24 -0700)]
[libc++][PSTL] Implement std::copy{,_n}
Reviewed By: ldionne, #libc
Spies: jloser, libcxx-commits
Differential Revision: https://reviews.llvm.org/D149706
AdityaK [Mon, 15 May 2023 17:17:39 +0000 (10:17 -0700)]
Enable frame pointer for all non-leaf functions on riscv64 Android
Bringing parity with aarch64-android https://github.com/google/android-riscv64/issues/9#issuecomment-
1535454205
Reviewers: enh, danalbert, pirama, srhines
Differential Revision: https://reviews.llvm.org/D150490
Amy Kwan [Mon, 15 May 2023 16:53:12 +0000 (11:53 -0500)]
Fix build failure caused by https://reviews.llvm.org/D150352
This patch fixes the following build error on the clang-ppc64le-rhel bot seen in
in https://lab.llvm.org/buildbot/#/builders/57/builds/26816/steps/5/logs/stdio:
FAILED: tools/clang/tools/extra/clang-tidy/bugprone/CMakeFiles/obj.clangTidyBugproneModule.dir/UncheckedOptionalAccessCheck.cpp.o
.../clang-ppc64le-rhel/llvm-project/clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:43:27: error: 'build' is deprecated: Use the version that takes a const Decl & instead [-Werror,-Wdeprecated-declarations]
ControlFlowContext::build(&FuncDecl, *FuncDecl.getBody(), ASTCtx);
^
.../ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:41:3: note: 'build' has been explicitly marked deprecated here
LLVM_DEPRECATED("Use the version that takes a const Decl & instead", "")
^
.../clang-ppc64le-rhel/llvm-project/llvm/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
#define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
^
1 error generated.
Sergei Barannikov [Sun, 14 May 2023 17:46:59 +0000 (20:46 +0300)]
[clang] Convert a few OpenMP tests to use opaque pointers
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D150530
Vasileios Porpodas [Fri, 5 May 2023 20:23:21 +0000 (13:23 -0700)]
[SLP][NFC] Cleanup: Separate vectorization of Inserts and CmpInsts.
This deprecates `vectorizeSimpleInstructions()` and replaces it with separate
functions that vectorize CmpInsts and Inserts.
Differential Revision: https://reviews.llvm.org/D149993
Kazu Hirata [Mon, 15 May 2023 17:06:15 +0000 (10:06 -0700)]
[mlir] Fix a warning
This patch fixes:
mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp:45:2: error: extra ';'
outside of a function is incompatible with C++98
[-Werror,-Wc++98-compat-extra-semi]
LLVM GN Syncbot [Mon, 15 May 2023 16:58:34 +0000 (16:58 +0000)]
[gn build] Port
6851d078c54e
Nikolas Klauser [Mon, 15 May 2023 14:07:45 +0000 (07:07 -0700)]
[libc++][PSTL] Implement std::transform
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D149615
Sergei Barannikov [Mon, 15 May 2023 16:54:40 +0000 (19:54 +0300)]
[test] Fix const-str-array-decay.cl failure on PowerPC
D150520 converted the test to use opaque pointers. The update version
fails on PowerPC because of different return type of the function.
This patch resolves the failure by removing the return type check;
it also makes the test look more like it was before the conversion to
prevent other potential issues caused by ABI differences across targets.
Qiongsi Wu [Mon, 15 May 2023 16:37:32 +0000 (12:37 -0400)]
[clang][AIX] Remove Newly Added Target Dependent Test Case
https://reviews.llvm.org/D144190 added a test case that is target dependent and requires assembly code generation, which fails on x64 and aarch64 buildbots. This patch removes the test case. We have test cases for code generation added in https://reviews.llvm.org/D144189 already and this removed case was nice to have.
Differential Revision: https://reviews.llvm.org/D150586
Slava Zakharin [Mon, 15 May 2023 16:02:14 +0000 (09:02 -0700)]
[flang][hlfir] Fixed copy-in for polymorphic arguments.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D150502
Slava Zakharin [Mon, 15 May 2023 16:02:14 +0000 (09:02 -0700)]
[flang][hlfir] Fixed lowering for intrinsic calls with null() box argument.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D150501
Erich Keane [Mon, 15 May 2023 16:43:25 +0000 (09:43 -0700)]
Jay Foad [Mon, 15 May 2023 16:29:00 +0000 (17:29 +0100)]
[Mips] Remove MipsRegisterInfo::requiresRegisterScavenging. NFC.
This method is unused since MipsRegisterInfo is abstract and it is
overridden in both concrete subclasses.
Joseph Huber [Mon, 15 May 2023 14:46:56 +0000 (09:46 -0500)]
[libc][NFC] Clean up the memory buffer handling for RPC
We do a lot of arithmetic on void pointers here, so include a helper and
make some more consistent names. Changes no functionality.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D150576
Mateja Marjanovic [Mon, 15 May 2023 16:20:50 +0000 (18:20 +0200)]
[AMDGPU] Trim zero components from buffer and image stores
For image and buffer stores the default behaviour on GFX11 and
older is to set all unset components to zero. So if we pass
only X component it will be the same as X000, or XY same as XY00.
This patch simplifies the passed vector of components in InstCombine
by removing zero components from the end.
For image stores it also trims DMask if necessary.
Reviewed By: foad, arsenm
Differential Revision: https://reviews.llvm.org/D146737
Dinar Temirbulatov [Mon, 15 May 2023 16:18:45 +0000 (16:18 +0000)]
[AArch64][CostModel] Add costs for fixed operations when using fixed vectors over SVE.
Currently any cast operation with fixed length vectors uses NEON costs,
If those operations are end up using SVE instruction then we estimate
those operations based upon SVE costs.
Differential Revision: https://reviews.llvm.org/D133955
Kadir Cetinkaya [Wed, 3 May 2023 08:50:46 +0000 (10:50 +0200)]
[clang][USR] Prevent crashes on incomplete FunctionDecls
FunctionDecls can be created with null types (D124351 added such a new
code path), to be filled in later. But parsing can stop before
completing the Decl (e.g. if code completion
point is reached).
Unfortunately most of the methods in FunctionDecl and its derived
classes assume a complete decl and don't perform null-checks.
Since we're not encountring crashes in the wild along other code paths
today introducing extra checks into quite a lot of places didn't feel
right (due to extra complexity && run time checks).
I believe another alternative would be to change Parser & Sema to never
create decls with invalid types, but I can't really see an easy way of
doing that, as most of the pieces are structured around filling that
information as parsing proceeds.
Differential Revision: https://reviews.llvm.org/D149733
Erich Keane [Fri, 12 May 2023 14:30:21 +0000 (07:30 -0700)]
Add C++26 compile flags.
Now that we've updated to C++23, we need to add C++26/C++2c command line
flags, as discussed in
https://discourse.llvm.org/t/rfc-lets-just-call-it-c-26-and-forget-about-the-c-2c-business-at-least-internally/70383
Differential Revision: https://reviews.llvm.org/D150450
J. Ryan Stinnett [Mon, 15 May 2023 15:52:43 +0000 (16:52 +0100)]
Revert "[X86] Use the CFA as the DWARF frame base for better variable locations around calls."
This reverts commit
d421f5226048e4a5d88aab157d0f4d434c43f208.
LLDB tests are failing as shown in
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/55133/testReport/
Aart Bik [Fri, 12 May 2023 19:43:35 +0000 (12:43 -0700)]
[mlir][sparse][gpu] first implementation of the GPU libgen approach
The sparse compiler now has two prototype strategies for GPU acceleration:
* CUDA codegen: this converts sparsified code to CUDA threads
* CUDA libgen: this converts pre-sparsified code to cuSPARSE library calls
This revision introduces the first steps required for the second approach.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D150170
Qiongsi Wu [Mon, 15 May 2023 15:14:05 +0000 (11:14 -0400)]
[AIX][clang] Storage Locations for Constant Pointers
This patch adds clang options `-mxcoff-roptr` and `-mno-xcoff-roptr` to specify storage locations for constant pointers on AIX.
When the `-mxcoff-roptr` option is in effect, constant pointers, virtual function tables, and virtual type tables are placed in read-only storage. When the `-mno-xcoff-roptr` option is in effect, pointers, virtual function tables, and virtual type tables are placed are placed in read/write storage.
This patch depends on https://reviews.llvm.org/D144189.
Reviewed By: hubert.reinterpretcast, stephenpeckham
Differential Revision: https://reviews.llvm.org/D144190
Jay Foad [Mon, 15 May 2023 15:20:06 +0000 (16:20 +0100)]
[KnownBitsTest] Remove stray semicolons
Oleg Shyshkov [Mon, 15 May 2023 15:04:03 +0000 (17:04 +0200)]
[mlir][memref] Extract isStaticShapeAndContiguousRowMajor as a util function.
Differential Revision: https://reviews.llvm.org/D150543
Chenle Yu [Mon, 15 May 2023 14:56:48 +0000 (09:56 -0500)]
[OpenMP] Implement task record and replay mechanism
This patch implements the "task record and replay" mechanism. The idea is to be able to store tasks and their dependencies in the runtime so that we do not pay the cost of task creation and dependency resolution for future executions. The objective is to improve fine-grained task performance, both for those from "omp task" and "taskloop".
The entry point of the recording phase is __kmpc_start_record_task, and the end of record is triggered by __kmpc_end_record_task.
Tasks encapsulated between a record start and a record end are saved, meaning that the runtime stores their dependencies and structures, referred to as TDG, in order to replay them in subsequent executions. In these TDG replays, we start the execution by scheduling all root tasks (tasks that do not have input dependencies), and there will be no involvement of a hash table to track the dependencies, yet tasks do not need to be created again.
At the beginning of __kmpc_start_record_task, we must check if a TDG has already been recorded. If yes, the function returns 0 and starts to replay the TDG by calling __kmp_exec_tdg; if not, we start to record, and the function returns 1.
An integer uniquely identifies TDGs. Currently, this identifier needs to be incremented manually in the source code. Still, depending on how this feature would eventually be used in the library, the caller function must do it; also, the caller function needs to implement a mechanism to skip the associated region, according to the return value of __kmpc_start_record_task.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D146642
Nikita Popov [Mon, 15 May 2023 13:41:16 +0000 (15:41 +0200)]
[KnownBitsTest] Align with ConstantRange test infrastructure (NFC)
Align the way we perform exhaustive tests for KnownBits with what
we do for ConstantRange. Test each case separately by specifying
a function on KnownBits and one on APInts. Additionally, specify
a callback that determines which cases are supposed to be optimal,
rather than only correct. Unlike the ConstantRange case there is
a well-defined, unique notion of optimality for KnownBits.
If a failure occurs, print out the inputs, computed result and
exact result. Adjust the printing function to produce the output
in a format that is meaningful for KnownBits, i.e. print the
actual known bits, using ? to signify unknowns and ! to signify
conflicts.
Erich Keane [Mon, 15 May 2023 14:09:07 +0000 (07:09 -0700)]
Update __cplusplus for C++23, add C++23 diag group alias.
This came up during the C++26 flag discussion, so split this out into a
separate patch.
Sameer Sahasrabuddhe [Mon, 15 May 2023 11:36:06 +0000 (17:06 +0530)]
[LLVM][Uniformity] Propagate temporal divergence explicitly
At a cycle C with divergent exits, UA was using a naive traversal of the exiting
edges to locate blocks that may use values defined inside C. But this traversal
fails when it encounters a cycle. This is now replaced with a much simpler
propagation that iterates over every instruction in C and checks any uses that
are outside C. But such an iteration can be expensive when C is very large; the
original strategy may need to be reconsidered if there is a regression in
compilation times.
Also fixed lit tests that should have originally caught the missed propagation
of temporal divergence.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D149646
Manupa Karunaratne [Mon, 15 May 2023 14:41:49 +0000 (14:41 +0000)]
[MLIR][ROCDL] add gpu to rocdl erf support
This commit adds lowering of lib func
call to support erf in rocdl.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D150355
Alex Zinenko [Mon, 15 May 2023 12:28:21 +0000 (12:28 +0000)]
[mlir] allow repeated payload in structured.fuse_into_containing
Structured fusion proceeds by iteratively finding the next suitable
producer to be fused into the loop. Therefore, it shouldn't matter if
the same producer is listed multiple times (e.g., it is used as multiple
operands). Adjust the implementation of the transform op to support this
case.
Also fix the checking code in the interpreter to actually respect the
TransformOpInterface indication that repeated payload is allowed, it
seems to have been accidentally dropped in one of the refactorings.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D150561
Kyle Huey [Mon, 15 May 2023 14:08:18 +0000 (15:08 +0100)]
[X86] Use the CFA as the DWARF frame base for better variable locations around calls.
Prior to this patch, for the DWARF frame base LLVM uses the frame pointer
register if available, otherwise the stack pointer register. If the stack
pointer register is being used and a call or other code modifies the stack
pointer during the body of the function this results in the locations being
wrong and the debugger displaying the wrong values for variables.
By using DW_OP_call_frame_cfa in these situations the emitted location for
the variable will automatically handle changes in the stack pointer.
The CFA needs to be adjusted for the offset between the frame pointer/stack
pointer to allow the variable locations themselves to remain unchanged by
this patch.
Reviewed By: #debug-info, scott.linder, jryans
Differential Revision: https://reviews.llvm.org/D143463
Florian Hahn [Mon, 15 May 2023 14:05:10 +0000 (15:05 +0100)]
[AArch64] Add test case where widening mull could be used.
Extra test using mull for D150482.
khei4 [Mon, 15 May 2023 13:33:15 +0000 (22:33 +0900)]
[ConstantFold] use StoreSize for VectorType folding
Differential Revision: https://reviews.llvm.org/D150515
Reviewed By: nikic
Nikolas Klauser [Mon, 15 May 2023 13:56:40 +0000 (06:56 -0700)]
Revert "[libc++][PSTL] Implement std::transform"
This reverts commit
cbd9e5454741ebe6b39521fe1a8ed4eed5c2c801.
The wrong patch was landed.