Byoungchan Lee [Thu, 21 Apr 2022 15:29:45 +0000 (17:29 +0200)]
[compiler-rt][Darwin] Add arm64 to simulator platforms
This patch is the reland of
a8e5ce76b475a22546090a73c22fa4f83529aa4e,
which includes additional SDK version checks to ensure that
XCode's headers support arm64 builds.
Differential Revision: https://reviews.llvm.org/
D119174
Sanjay Patel [Thu, 21 Apr 2022 14:54:40 +0000 (10:54 -0400)]
[InstCombine] C0 <<{nsw, nuw} (X - C1) --> (C0 >> C1) << X
This is similar to an existing pre-shift-of-constant fold:
8a9c70fc01e6
...but in this case, we need no-wrap on the shl and a negative
offset:
https://alive2.llvm.org/ce/z/_RVz99
Fixes #54890
Sanjay Patel [Wed, 20 Apr 2022 19:43:14 +0000 (15:43 -0400)]
[InstCombine] add tests for C << (X - C1); NFC
Paul Robinson [Thu, 21 Apr 2022 15:19:20 +0000 (08:19 -0700)]
[PS4] Driver: use correct --shared option
Kirill Bobyrev [Thu, 21 Apr 2022 14:59:59 +0000 (16:59 +0200)]
[clangd] Include Cleaner: suppress unused warnings for IWYU pragma: export
Add limited support for "IWYU pragma: export" - for now it just supresses the
warning similar to "IWYU pragma: keep".
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/
D124170
Kirill Bobyrev [Thu, 21 Apr 2022 14:30:29 +0000 (16:30 +0200)]
[clangd] Correctly identify self-contained headers included rercursively
Right now when exiting the file Headers.cpp will identify the recursive
inclusion (with a new FileID) as non self-contained and will add it to the set
from which it will never be removed. As a result, we get incorrect results in
the IncludeStructure and Include Cleaner. This patch is a fix.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/
D124166
gbreynoo [Thu, 21 Apr 2022 14:48:26 +0000 (15:48 +0100)]
[llvm-ar] Fix thin archive being wrongly converted to a full archive
When using the L option to quick append a full archive to a thin
archive, the thin archive was being wrongly converted to a full archive.
I've fixed the issue and added a check for it in
thin-to-full-archive.test and expanded some tests.
Differential Revision: https://reviews.llvm.org/
D123142
Alex Zinenko [Wed, 20 Apr 2022 10:57:23 +0000 (12:57 +0200)]
[mlir] Connect Transform dialect to PDL
This introduces a pair of ops to the Transform dialect that connect it to PDL
patterns. Transform dialect relies on PDL for matching the Payload IR ops that
are about to be transformed. For this purpose, it provides a container op for
patterns, a "pdl_match" op and transform interface implementations that call
into the pattern matching infrastructure.
To enable the caching of compiled patterns, this also provides the extension
mechanism for TransformState. Extensions allow one to store additional
information in the TransformState and thus communicate it between different
Transform dialect operations when they are applied. They can be added and
removed when applying transform ops. An extension containing a symbol table in
which the pattern names are resolved and a pattern compilation cache is
introduced as the first client.
Depends On
D123664
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/
D124007
Eric Astor [Thu, 21 Apr 2022 14:01:02 +0000 (10:01 -0400)]
[LLVM-ML] Add standard LLVM debug flags
Adds support for -debug and -debug-only= flags.
Reviewed By: ayzhao
Differential Revision: https://reviews.llvm.org/
D123545
Petar Avramovic [Thu, 21 Apr 2022 13:41:12 +0000 (15:41 +0200)]
AMDGPU/GlobalISel: Fix isVCC for uniform s1 with reg class on wave32
Fix isVCC for register that was assigned register class during
inst-selection. This happens when register has multiple uses.
For wave32, uniform i1 to vcc copy was selected like vcc to vcc
copy when uniform i1 had assigned register class.
Uniform i1 register with assigned register class will have s1 LLT,
be defined using G_TRUNC and class will be SReg_32RegClass.
Vcc i1 register with assigned register class will have s1 LLT,
class will be SReg_32RegClass for wave32 and SReg_64RegClass for
wave64 and register will not be defined by G_TRUNC.
Differential Revision: https://reviews.llvm.org/
D124163
Petar Avramovic [Thu, 21 Apr 2022 13:37:11 +0000 (15:37 +0200)]
AMDGPU/GlobalISel: Precommit test for
D124163
Nikita Popov [Thu, 21 Apr 2022 13:58:17 +0000 (15:58 +0200)]
[InstCombine] Fix typo in test (NFC)
This is a copy paste mistake, this variant of the test was supposed
to use poison instead of undef.
Karl Meakin [Thu, 21 Apr 2022 13:55:27 +0000 (14:55 +0100)]
[AArch64] Add `foldOverflowCheck` DAG combine
Differential Revision: https://reviews.llvm.org//
D123779
Karl Meakin [Thu, 21 Apr 2022 13:54:05 +0000 (14:54 +0100)]
[AArch64] Add lowerings for {ADD,SUB}CARRY and S{ADD,SUB}O_CARRY
Differential Revision: https://reviews.llvm.org/
D123322
Nikita Popov [Thu, 21 Apr 2022 13:53:14 +0000 (15:53 +0200)]
[InstCombine] Remove dead code (NFC)
This was a leftover condition without code.
Jannik Silvanus [Thu, 21 Apr 2022 13:42:22 +0000 (14:42 +0100)]
[AMDGPU]: Fix failing assertion in SIMachineScheduler
This fixes the assertion failure "Loop in the Block Graph!".
SIMachineScheduler groups instructions into blocks (also referred to
as coloring or groups) and then performs a two-level scheduling:
inter-block scheduling, and intra-block scheduling.
This approach requires that the dependency graph on the blocks which
is obtained by contracting the blocks in the original dependency graph
is acyclic. In other words: Whenever A and B end up in the same block,
all vertices on a path from A to B must be in the same block.
When compiling an example consisting of an export followed by
a buffer store, we see a dependency between these two. This dependency
may be false, but that is a different issue.
This dependency was not correctly accounted for by SiMachineScheduler.
A new test case si-scheduler-exports.ll demonstrating this is
also added in this commit.
The problematic part of SiMachineScheduler was a post-optimization of
the block assignment that tried to group all export instructions into
a separate export block for better execution performance. This routine
correctly checked that any paths from exports to exports did not
contain any non-exports, but not vice-versa: In case of an export with
a non-export successor dependency, that single export was moved
to a separate block, which could then be both a successor and a
predecessor block of a non-export block.
As fix, we now skip export grouping if there are exports with direct
non-export successor dependencies. This fixes the issue at hand,
but is slightly pessimistic:
We *could* group all exports into a separate block that have neither
direct nor indirect export successor dependencies.
We will review the potential performance impact and potentially
revisit with a more sophisticated implementation.
Note that just grouping all exports without direct non-export successor
dependencies could still lead to illegal blocks, since non-export A
could depend on export B that depends on export C. In that case,
export C has no non-export successor, but still may not be grouped
into an export block.
Luo, Yuanke [Thu, 21 Apr 2022 13:38:55 +0000 (21:38 +0800)]
[X86] Add test case for SetCCMOVMSK combine.
Create 2 users for MOVMSK to test if compiler would perform the combine
"MOVMSK(CONCAT(X,Y)) == 0 -> MOVMSK(OR(X,Y))".
Nikita Popov [Thu, 21 Apr 2022 13:45:54 +0000 (15:45 +0200)]
[InstCombine] Add tests for memset with undef/poison value (NFC)
Nikita Popov [Thu, 21 Apr 2022 13:40:48 +0000 (15:40 +0200)]
[InstCombine] Split up test for store with undef (NFC)
Markus Böck [Thu, 21 Apr 2022 13:32:21 +0000 (15:32 +0200)]
[mlir] Fix `Region`s `takeBody` method if the region is not empty
The current implementation of takeBody first clears the Region, before then taking ownership of the blocks of the other regions. The issue here however, is that when clearing the region, it does not take into account references of operations to each other. In particular, blocks are deleted from front to back, and operations within a block are very likely to be deleted despite still having uses, causing an assertion to trigger [0].
This patch fixes that issue by simply calling dropAllReferences()before clearing the blocks.
[0] https://github.com/llvm/llvm-project/blob/
9a8bb4bc635de9d56706262083c15eb1e0cf3e87/mlir/lib/IR/Operation.cpp#L154
Differential Revision: https://reviews.llvm.org/
D123913
Fabian Wolff [Thu, 21 Apr 2022 13:18:31 +0000 (15:18 +0200)]
[clang-tidy] Fix behavior of `modernize-use-using` with nested structs/unions
Fixes https://github.com/llvm/llvm-project/issues/50334.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/
D113804
Andrew Savonichev [Tue, 19 Apr 2022 17:01:14 +0000 (20:01 +0300)]
[NVPTX] Fix LIT tests with default nameTableKind
Default nameTableKind results in the following DWARF section:
.section .debug_pubnames
{
.b32 LpubNames_end0-LpubNames_start0 // Length of Public Names Info
LpubNames_start0:
[...]
LpubNames_end0:
}
Without -mattr=+ptx75 ptxas complains about labels and label
expressions:
error : Feature 'labels1 - labels2 expression in .section' requires
PTX ISA .version 7.5 or later
error : Feature 'Defining labels in .section' requires PTX ISA
.version 7.0 or later
The patch modifies dbg-value-const-byref.ll to let it run without PTX
7.5 (available from CUDA 11.0), and adds a new test just for this
case.
Differential revision: https://reviews.llvm.org/
D124108
Simon Pilgrim [Thu, 21 Apr 2022 12:58:43 +0000 (13:58 +0100)]
[InstCombine] Add nonpow2 (negative) test for
D123374
Aaron Ballman [Thu, 21 Apr 2022 12:52:07 +0000 (08:52 -0400)]
Fix Sphinx build
Nikita Popov [Thu, 21 Apr 2022 12:34:36 +0000 (14:34 +0200)]
[PhaseOrdering] Remove RUN lines for legacy PM (NFC)
wangpc [Thu, 21 Apr 2022 12:32:56 +0000 (20:32 +0800)]
Revert "[RISCV] Precommit test for
D122634"
This reverts commit
360d44e86defea94fb5608765fbdbfdb2a36f4c6.
Nikolas Klauser [Wed, 20 Apr 2022 08:52:04 +0000 (10:52 +0200)]
[libc++] Use bit field for checking if string is in long or short mode
This makes the code a bit simpler and (I think) removes the undefined behaviour from the normal string layout.
Reviewed By: ldionne, Mordante, #libc
Spies: labath, dblaikie, JDevlieghere, krytarowski, jgorbe, jingham, saugustine, arichardson, libcxx-commits
Differential Revision: https://reviews.llvm.org/
D123580
Pavel Labath [Wed, 20 Apr 2022 18:52:14 +0000 (20:52 +0200)]
[lldb] Adjust libc++ string formatter for changes in
D123580
The code needs more TLC, but for now I've tried making only the changes
that are necessary to get the tests passing -- postponing the more
invasive changes after I create a more comprehensive test.
In a couple of places I have changed the index-based element accesses to
name-based ones (as these are less sensitive to code perturbations). I'm
not sure why the code was using indexes in the first place, but I've
(manually) tested the change with various libc++ versions, and found no
issues with this approach.
Differential Revision: https://reviews.llvm.org/
D124113
Nikola Tesic [Thu, 21 Apr 2022 11:56:51 +0000 (13:56 +0200)]
[Debugify] Limit number of processed functions for original mode
Debugify in OriginalDebugInfo mode, does (DebugInfo) collect-before-pass & check-after-pass
for each instruction, which is pretty expensive. When used to analyze DebugInfo losses
in large projects (like LLVM), this raises the build time unacceptably.
This patch introduces a limit for the number of processed functions per compile unit.
By default, the limit is set to UINT_MAX (practically unlimited), and by using the introduced
option -debugify-func-limit the limit could be set to any positive integer number.
Differential revision: https://reviews.llvm.org/
D115714
Markus Böck [Thu, 21 Apr 2022 11:43:00 +0000 (13:43 +0200)]
[mlir] Make `Regions`s `cloneInto` multithread-readable
Prior to this patch, `cloneInto` would do a simple walk over the blocks and contained operations and clone and map them as it encounters them. As finishing touch it then remaps any successor and operands it has remapped during that process.
This is generally fine, but sadly leads to a lot of uses of both operations and blocks from the source region, in the cloned operations in the target region. Those uses lead to writes in the use-def list of the operations, making `cloneInto` never thread safe.
This patch reimplements `cloneInto` in three steps to avoid ever creating any extra uses on elements in the source region:
* It first creates the mapping of all blocks and block operands
* It then clones all operations to create the mapping of all operation results, but does not yet clone any regions or set the operands
* After all operation results have been mapped, it now sets the operations operands and clones their regions.
That way it is now possible to call `cloneInto` from multiple threads if the Region or Operation is isolated-from-above. This allows creating copies of functions or to use `mlir::inlineCall` with the same source region from multiple threads. In the general case, the method is thread-safe if through cloning, no new uses of `Value`s from outside the cloned Operation/Region are created. This can be ensured by mapping any outside operands via the `BlockAndValueMapping` to `Value`s owned by the caller thread.
While I was at it, I also reworked the `clone` method of `Operation` a little bit and added a proper options class to avoid having a `cloneWithoutRegionsAndOperands` method, and be more extensible in the future. `cloneWithoutRegions` is now also a simple wrapper that calls `clone` with the proper options set. That way all the operation cloning code is now contained solely within `clone`.
Differential Revision: https://reviews.llvm.org/
D123917
Hui Xie [Thu, 21 Apr 2022 11:08:34 +0000 (13:08 +0200)]
[libcxx][ranges] add views::join adaptor object. added test coverage to join_view
- added views::join adaptor object
- added test for the adaptor object
- fixed some join_view's tests. e.g iter_swap test
- added some negative tests for join_view to test that operations do not exist when constraints aren't met
- added tests that locks down issues that were already addressed in previous change
- LWG3500 `join_view::iterator::operator->()` is bogus
- LWG3313 `join_view::iterator::operator--` is incorrectly constrained
- LWG3517 `join_view::iterator`'s `iter_swap` is underconstrained
- P2328R1 join_view should join all views of ranges
- fixed some issues in join_view and added tests
- LWG3535 `join_view::iterator::iterator_category` and `::iterator_concept` lie
- LWG3474 Nesting ``join_views`` is broken because of CTAD
- added tests for an LWG issue that isn't resolved in the standard yet, but the previous code has workaround.
- LWG3569 Inner iterator not default_initializable
Reviewed By: #libc, var-const
Spies: var-const, libcxx-commits
Differential Revision: https://reviews.llvm.org/
D123466
Dmitry Preobrazhensky [Thu, 21 Apr 2022 10:32:25 +0000 (13:32 +0300)]
[AMDGPU][MC][NFC][GFX940] Corrected an error position
Differential Revision: https://reviews.llvm.org/
D124099
Uday Bondhugula [Wed, 20 Apr 2022 17:13:35 +0000 (22:43 +0530)]
Add async dependencies support for gpu.launch op
Add async dependencies support for gpu.launch op: this allows specifying
a list of async tokens ("streams") as dependencies for the launch.
Update the GPU kernel outlining pass lowering to propagate async
dependencies from gpu.launch to gpu.launch_func op. Previously, a new
stream was being created and destroyed for a kernel launch. The async
deps support allows the kernel launch to be serialized on an existing
stream.
Differential Revision: https://reviews.llvm.org/
D123499
Alexey Moksyakov [Thu, 21 Apr 2022 10:52:00 +0000 (13:52 +0300)]
[BOLT] Add R_AARCH64_PREL16/32/64 relocations support
Reviewed By: yota9, rafauler
Differential Revision: https://reviews.llvm.org/
D122294
Vladislav Khmelevsky [Tue, 19 Apr 2022 15:48:27 +0000 (18:48 +0300)]
[BOLT] Fix build with GCC 7.3.0
The gcc 7.3.0 version raises "could not covert" error without std::move
used explicitly.
Differential Revision: https://reviews.llvm.org/
D124009
Dmitry Preobrazhensky [Thu, 21 Apr 2022 10:15:01 +0000 (13:15 +0300)]
[AMDGPU][GFX90A+] Disabled ds_ordered_count and exp
Differential Revision: https://reviews.llvm.org/
D124087
Daniil Dudkin [Fri, 15 Apr 2022 16:40:15 +0000 (01:40 +0900)]
[flang] Do not ICE on recursive function definition in function result
The following code causes the compiler to ICE in several places due to
lack of support of recursive procedure definitions through the function
result.
function foo() result(r)
procedure(foo), pointer :: r
end function foo
Daniil Dudkin [Thu, 21 Apr 2022 09:58:41 +0000 (18:58 +0900)]
[NFC] Test commit
An empty commit to test the access
Sven van Haastregt [Thu, 21 Apr 2022 09:52:41 +0000 (10:52 +0100)]
[OpenCL] Guard read_write images with TypeExtension
Ensure that any `read_write` image type carries the
`__opencl_c_read_write_images` upon construction of the `ImageType`.
Haojian Wu [Thu, 21 Apr 2022 09:20:40 +0000 (11:20 +0200)]
[clangd] tweak tile should start with a capital letter.
to consistent with other tweaks.
Nikita Popov [Wed, 20 Apr 2022 15:03:45 +0000 (17:03 +0200)]
[SimplifyCFG] Handle branch on same condition in pred more directly
Rather than creating a PHI node and then using the PHI threading
code, directly handle this case in
FoldCondBranchOnValueKnownInPredecessor().
This change is supposed to be NFC-ish, but may cause changes due
to different transform order.
Haojian Wu [Thu, 21 Apr 2022 08:24:56 +0000 (10:24 +0200)]
[AST] Support template declaration found through using-decl for QualifiedTemplateName.
This is a followup of https://reviews.llvm.org/
D123127, adding support
for the QualifiedTemplateName.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/
D123775
Nikita Popov [Wed, 20 Apr 2022 12:02:46 +0000 (14:02 +0200)]
[SimplifyCFG] Make FoldCondBranchOnPHI more amenable to extension
This general threading transform can be performed whenever we know
a constant value for the condition in a predecessor, which would
currently just be the case of a phi node with constant arguments.
gpei-dev [Tue, 19 Apr 2022 05:44:04 +0000 (13:44 +0800)]
Force insert zero-idiom and break false dependency of dest register for several instructions.
The related instructions are:
VPERMD/Q/PS/PD
VRANGEPD/PS/SD/SS
VGETMANTSS/SD/SH
VGETMANDPS/PD - mem version only
VPMULLQ
VFMULCSH/PH
VFCMULCSH/PH
Differential Revision: https://reviews.llvm.org/
D116072
Nikita Popov [Thu, 21 Apr 2022 08:45:40 +0000 (10:45 +0200)]
Revert "[GVNSink] Regenerate test checks (NFC)"
This reverts commit
3b132300728e7ed06e59e449ceb8175305869a49.
It looks like GVNSink is currently non-deterministic, due to an
std::sort() on BasicBlock* pointers in ModelledPHI. This becomes
visible in the generated checks.
wangpc [Thu, 21 Apr 2022 08:23:10 +0000 (16:23 +0800)]
Revert "[RISCV] Do not outline CFI instructions when they are needed in EH"
This reverts commit
0d40688925a384088c149d1830dc0761a90364f7.
wangpc [Thu, 21 Apr 2022 08:11:41 +0000 (16:11 +0800)]
[RISCV] Do not outline CFI instructions when they are needed in EH
We saw a failure caused by unwinding with incomplete CFIs, so we
can't outline CFI instructions when they are needed in EH.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/
D122634
wangpc [Thu, 21 Apr 2022 08:07:57 +0000 (16:07 +0800)]
[RISCV] Precommit test for
D122634
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/
D123364
Nikita Popov [Thu, 21 Apr 2022 08:06:47 +0000 (10:06 +0200)]
[GVNSink] Regenerate test checks (NFC)
Tobias Hieta [Thu, 21 Apr 2022 07:42:08 +0000 (09:42 +0200)]
[CMake] Check for problematic MSVC + /arch:AVX configuration
Add a new CMake file to expand on for more problematic configurations
in the future.
Related to #54645
Reviewed By: beanz, phosek, smeenai
Differential Revision: https://reviews.llvm.org/
D123777
Chuanqi Xu [Thu, 21 Apr 2022 07:32:39 +0000 (15:32 +0800)]
[NFC] Code cleanups for coroutine after we remvoed legacy passes
Nimish Mishra [Thu, 21 Apr 2022 03:45:45 +0000 (09:15 +0530)]
Added lowering support for atomic read and write constructs
This patch adds lowering support for atomic read and write constructs.
Also added is pointer modelling code to allow FIR pointer like types to
be inferred and converted while lowering.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/
D122725
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
Xiang Li [Thu, 7 Apr 2022 20:48:39 +0000 (13:48 -0700)]
[HLSL] Add shader attribute
Shader attribute is for shader library identify entry functions.
Here's an example,
[shader("pixel")]
float ps_main() : SV_Target {
return 1;
}
When compile this shader to library target like -E lib_6_3, compiler needs to know ps_main is an entry function for pixel shader. Shader attribute is to offer the information.
A new attribute HLSLShader is added to support shader attribute. It has an EnumArgument which included all possible shader stages.
Reviewed By: aaron.ballman, MaskRay
Differential Revision: https://reviews.llvm.org/
D123907
Fraser Cormack [Tue, 19 Apr 2022 08:25:40 +0000 (09:25 +0100)]
[RISCV] Don't emit fractional VIDs with negative steps
We can't shift-right negative numbers to divide them, so avoid emitting
such sequences. Use negative numerators as a proxy for this situation, since
the indices are always non-negative.
An alternative strategy could be to add a compiler flag to emit division
instructions, which would at least allow us to test the VID sequence
matching itself.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/
D123796
Fraser Cormack [Tue, 19 Apr 2022 08:25:40 +0000 (09:25 +0100)]
[RISCV] Add another test showing incorrect BUILD_VECTOR lowering
This test shows a (contrived) BUILD_VECTOR which is correctly identified
as a sequence of ((vid * -3) / 8) + 5. However, the issue is that using
shift-right for the divide is invalid as the step values are negative.
This patch just adds the test: the fix is added in
D123796.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/
D123989
Fangrui Song [Thu, 21 Apr 2022 05:49:49 +0000 (22:49 -0700)]
[ELF] Fix spurious GOT/PLT assertion failure when .dynsym is discarded
Linux kernel arch/arm64/kernel/vmlinux.lds.S discards .dynsym .
D123985 triggers
a spurious assertion failure. Detect the case with
`!mainPart->dynSymTab->getParent()`.
River Riddle [Thu, 21 Apr 2022 04:39:02 +0000 (21:39 -0700)]
[mlir][NFC] Update remaining textual references of un-namespaced `func` operations
The special case parsing of operations in the `func` dialect is being removed, and
operations will require the dialect namespace prefix.
River Riddle [Wed, 20 Apr 2022 23:22:21 +0000 (16:22 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in Transform tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:22:03 +0000 (16:22 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in Pass/Target tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:21:36 +0000 (16:21 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in tool/runner tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:20:54 +0000 (16:20 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in IR/Interface tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:20:21 +0000 (16:20 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in Integration tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:19:48 +0000 (16:19 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in Tensor/Tosa/Vector tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:19:21 +0000 (16:19 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in SPIRV tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:18:14 +0000 (16:18 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in SparseTensor tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:17:16 +0000 (16:17 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in LLVM/Math/MemRef/NVGPU/OpenACC/OpenMP/Quant/SCF/Shape tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:16:23 +0000 (16:16 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in Linalg tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:15:59 +0000 (16:15 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in Bufferization/Complex/EmitC/CF/Func/GPU tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:14:19 +0000 (16:14 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in AMX/Arithmetic/ArmSVE/Async tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:13:44 +0000 (16:13 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in Affine/ tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:12:25 +0000 (16:12 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in Conversion/ tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:06:22 +0000 (16:06 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in Analysis/ tests
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:05:29 +0000 (16:05 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in ODS documentation
The special case parsing of `func` operations is being removed.
River Riddle [Wed, 20 Apr 2022 23:01:51 +0000 (16:01 -0700)]
[mlir][NFC] Update textual references of `func` to `func.func` in examples+python scripts
The special case parsing of `func` operations is being removed.
Craig Topper [Thu, 21 Apr 2022 05:00:10 +0000 (22:00 -0700)]
[RISCV] Make getInstSeqCost handle other Zb* instructions.
We haven't been updating this as Zb* instructions have been used
for immediate materialization. They will hit the default case and
trigger an llvm_unreachable. Instead of trying to list them all,
assume instructions that aren't explicitly listed aren't compressible.
Spotted while looking at integer materialization for other reasons.
I haven't seen a crash from this yet.
Chuanqi Xu [Thu, 21 Apr 2022 03:08:52 +0000 (11:08 +0800)]
[C++20] [Modules] Judge current module correctly
Now the implementation would accept following code:
```
//--- impl.cppm
module M:impl;
class A {};
//--- M.cppm
export module M;
import :impl;
//--- Use.cpp
import M;
void test() {
A a; // Expected error. A is not visible here.
}
```
which is clearly wrong. The root cause is the implementation of
`isInCurrentModule` would return true if the module is a partition! So
in the above example, although Use.cpp is not a module unit,
`isInCurrentModule ` would still return true when the compiler tries to
see if the owning module of `A` is the current module. I believe this is
an oversight. This patch tries to fix this problem.
Reviewed By: iains
Differential Revision: https://reviews.llvm.org/
D123837
Chuanqi Xu [Thu, 21 Apr 2022 02:57:01 +0000 (10:57 +0800)]
[Pipelines] Remove Legacy Passes in Coroutines
The legacy passes are deprecated now and would be removed in near
future. This patch tries to remove legacy passes in coroutines.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/
D123918
hsmahesha [Thu, 21 Apr 2022 02:27:26 +0000 (07:57 +0530)]
[AMDGPU] On gfx908, reserve VGPR for AGPR copy based on register budget.
Based on available register budget, reserve highest available VGPR for
AGPR copy before RA. After RA, shift it to lowest unused VGPR if the one
exist.
Fixes SWDEV-330006.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/
D123525
Weining Lu [Tue, 29 Mar 2022 12:50:41 +0000 (20:50 +0800)]
[LoongArch] Add basic floating-point instructions definition
These instructions are added by following the `LoongArch Reference
Manual Volume 1: Basic Architecture Version 1.00`.
Differential Revision: https://reviews.llvm.org/
D123988
Shraiysh Vaishay [Thu, 21 Apr 2022 01:22:38 +0000 (06:52 +0530)]
[mlir][OpenMP] Add checks and tests for hint clause and fix empty hint
This patch handles empty hint value for critical and atomic constructs.
This also adds checks and tests for hint clause on atomic constructs.
Reviewed By: peixin, kiranchandramohan, NimishMishra
Differential Revision: https://reviews.llvm.org/
D123186
hsmahesha [Thu, 21 Apr 2022 01:18:16 +0000 (06:48 +0530)]
[AMDGPU] Split the lit test spill-vgpr-to-agpr.ll to different tests
[1]. Move the test which reject the usage of agpr before gfx908 into a separate file - reject-agpr-usage-before-gfx908.ll.
[2]. Move those tests which are applicable to both gfx900 and gfx908 into a separate file - spill-vgpr.ll.
[3]. Keep those tests which are specific to only gfx908 in the file spill-vgpr-to-agpr.ll.
Above split is required to properly update the tests in
D123525.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/
D123973
Richard Smith [Thu, 21 Apr 2022 00:13:56 +0000 (17:13 -0700)]
Treat `std::move`, `forward`, etc. as builtins.
This is extended to all `std::` functions that take a reference to a
value and return a reference (or pointer) to that same value: `move`,
`forward`, `move_if_noexcept`, `as_const`, `addressof`, and the
libstdc++-specific function `__addressof`.
We still require these functions to be declared before they can be used,
but don't instantiate their definitions unless their addresses are
taken. Instead, code generation, constant evaluation, and static
analysis are given direct knowledge of their effect.
This change aims to reduce various costs associated with these functions
-- per-instantiation memory costs, compile time and memory costs due to
creating out-of-line copies and inlining them, code size at -O0, and so
on -- so that they are not substantially more expensive than a cast.
Most of these improvements are very small, but I measured a 3% decrease
in -O0 object file size for a simple C++ source file using the standard
library after this change.
We now automatically infer the `const` and `nothrow` attributes on these
now-builtin functions, in particular meaning that we get a warning for
an unused call to one of these functions.
In C++20 onwards, we disallow taking the addresses of these functions,
per the C++20 "addressable function" rule. In earlier language modes, a
compatibility warning is produced but the address can still be taken.
The same infrastructure is extended to the existing MSVC builtin
`__GetExceptionInfo`, which is now only recognized in namespace `std`
like it always should have been.
This is a re-commit of
fc3090109643af8d2da9822d0f99c84742b9c877,
a571f82a50416b767fd3cce0fb5027bb5dfec58c,
64c045e25b8471bbb572bd29159c294a82a86a2, and
de6ddaeef3aaa8a9ae3663c12cdb57d9afc0f906,
and reverts
aa643f455a5362de7189eac630050d2c8aefe8f2.
This change also includes a workaround for users using libc++ 3.1 and
earlier (!!), as apparently happens on AIX, where std::move sometimes
returns by value.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/
D123345
Revert "Fixup
D123950 to address revert of
D123345"
This reverts commit
aa643f455a5362de7189eac630050d2c8aefe8f2.
Muhammad Omair Javaid [Thu, 21 Apr 2022 00:09:33 +0000 (05:09 +0500)]
[LLDB] Skip TestCrashDuringStep.py AArch64/Windows
TestCrashDuringStep.py hangs on AArch64 windows with no resonable
possible fix. I am marking it skipped for now.
Maksim Panchenko [Wed, 20 Apr 2022 23:59:41 +0000 (16:59 -0700)]
[BOLT] Add fuzzy function name matching for LLVM LTO
LLVM with LTO can generate function names in the form
func.llvm.<number>, where <number> could vary based on the compilation
environment. As a result, if a profiled binary originated from a
different build than a corresponding binary used for BOLT optimization,
then profiles for such LTO functions will be ignored.
To fix the problem, use "fuzzy" matching with "func.llvm.*" form.
Reviewed By: yota9, Amir
Differential Revision: https://reviews.llvm.org/
D124117
David Tenty [Wed, 20 Apr 2022 23:59:07 +0000 (19:59 -0400)]
Fixup
D123950 to address revert of
D123345
Since
D123345 got reverted Builtin::BIaddressof and Builtin::BI__addressof don't exist and cause build breaks.
Alexander Yermolovich [Wed, 20 Apr 2022 23:40:46 +0000 (16:40 -0700)]
[BOLT][DWARF] Handle Error returned by visitLocationList
Looks like implementation in llvm changed, and now we need to process error
being returned.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/
D124133
David Tenty [Wed, 20 Apr 2022 23:06:48 +0000 (19:06 -0400)]
Revert "Treat `std::move`, `forward`, etc. as builtins."
This reverts commit
b27430f9f46b88bcd54d992debc8d72e131e1bd0 as the
parent https://reviews.llvm.org/
D123345 breaks the AIX CI:
https://lab.llvm.org/buildbot/#/builders/214/builds/819
David Tenty [Wed, 20 Apr 2022 23:03:04 +0000 (19:03 -0400)]
Revert "Don't treat 'T &forward(T&&)' as builtin."
This reverts commit
e43c93dd63cca295ef26ab69cd305816a71d45fd as the
parent https://reviews.llvm.org/
D123345 breaks the AIX CI.
Evgeny Mankov [Wed, 20 Apr 2022 21:41:20 +0000 (00:41 +0300)]
[clang][CUDA][Windows] Fix compilation error on Windows with `uint32_t __nvvm_get_smem_pointer`
The change fixes https://github.com/llvm/llvm-project/issues/54609 (the second reported issue) by eliminating a compilation error occurring only on Windows while trying to compile any CUDA source file by clang (-x cuda).
[Repro]
clang -x cuda <any_cu_source>
[Error]
__clang_cuda_runtime_wrapper.h:473:
__clang_cuda_intrinsics.h(517,19): error GC871EEFB: unknown type name 'uint32_t'; did you mean 'cuuint32_t'?
__device__ inline uint32_t __nvvm_get_smem_pointer(void *__ptr) {
^
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include\cuda.h:57:26: note: 'cuuint32_t' declared here
typedef unsigned __int32 cuuint32_t;
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/
D122897
Jez Ng [Wed, 20 Apr 2022 22:11:19 +0000 (18:11 -0400)]
[MC][NFC] Ensure tests that intended to cover compact unwind code paths do so
These two tests were intended to cover the CU code paths, but invoked
llvm-mc using a generic "darwin" platform. However, MC only attempts to
emit CU for `macos >= 10.6` [1]. Thus we adjust the tests accordingly.
compact-unwind-cfi_def_cfa.s was added in
2fca51d3b45efcf00ffcfe2879cd6d7d98c26258
fp-setup-macho.s was added in
03ffa797ad4fe8f85da532aa3f687841a60b4c0c
[1]: https://github.com/llvm/llvm-project/blob/
16c93aaa4a955676fe05f876bd036719a1b14b2d/llvm/lib/MC/MCObjectFileInfo.cpp#L43
Reviewed By: MaskRay, smeenai
Differential Revision: https://reviews.llvm.org/
D124126
V Donaldson [Wed, 20 Apr 2022 18:42:44 +0000 (11:42 -0700)]
[flang] Semantics limits on kP scale factors
When known at compile time, Ew.d and Dw.d output edit descriptors
should respect limitations from the standard on the value of a
kP scale factor with respect to the digit count (d), at least for
values of k other than zero.
Krzysztof Parzyszek [Wed, 20 Apr 2022 16:51:35 +0000 (09:51 -0700)]
[Hexagon] Establish size limit for RegisterSet in hexbit
This should reduce compilation time for huge functions.
Nathan James [Wed, 20 Apr 2022 21:09:03 +0000 (22:09 +0100)]
[clang] Add a raw_ostream operator<< overload for QualType
Under the hood this prints the same as `QualType::getAsString()` but cuts out the middle-man when that string is sent to another raw_ostream.
Also cleaned up all the call sites where this occurs.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/
D123926
Nikolas Klauser [Sun, 17 Apr 2022 14:01:38 +0000 (16:01 +0200)]
[libc++] Granularize <functional> includes
Reviewed By: Mordante, #libc
Spies: libcxx-commits, miyuki
Differential Revision: https://reviews.llvm.org/
D123912
Mehdi Amini [Wed, 20 Apr 2022 20:39:44 +0000 (20:39 +0000)]
Improve invalid-ir-print-after-failure.mlir to show the effects of -mlir-print-assume-verified (NFC)
Muhammad Omair Javaid [Wed, 20 Apr 2022 20:32:23 +0000 (01:32 +0500)]
[LLDB] Update inspect getargspec to getfullargspec
This patch replaces getargspec with getfullargspec in funcutils.py.
getargspec has been deprecated by python 11x release. This is
important to run LLDB testsuite in Windows/Arm64 platform
where Python native will be available from python release onwards.
Note: getfullargspec is not available in python 2
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/
D121786
Pengxuan Zheng [Fri, 15 Apr 2022 21:57:40 +0000 (14:57 -0700)]
Reland "[COFF, ARM64] Add __break intrinsic"
https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170
Reland after fixing the test failure. The failure was due to conflict with a
change (
D122983) which was merged right before this patch.
Reviewed By: rnk, mstorsjo
Differential Revision: https://reviews.llvm.org/
D124032
serge-sans-paille [Wed, 13 Apr 2022 13:28:58 +0000 (15:28 +0200)]
[clang-tblgen] Automatically document options values
This is a port of
f5c666742f7bb4ae79ec79c8acf61dced4d37cc9 to clang's tablegen,
with a better wording.
Differential Revision: https://reviews.llvm.org/
D123682
Siva Chandra Reddy [Wed, 20 Apr 2022 08:29:22 +0000 (08:29 +0000)]
[libc] Add the implementation of the fflush function.
Note that the underlying flush implementation does not yet fully implement
the POSIX standard. It is complete with respect to the C standard
however. A future change will add the POSIX behavior. It should not affect
the implementation of the fflush function however as the POSIX behavior
will be added in a lower layer.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/
D124073
Pengxuan Zheng [Wed, 20 Apr 2022 18:57:49 +0000 (11:57 -0700)]
Revert "[COFF, ARM64] Add __break intrinsic"
This reverts commit
8a9b4fb4aa6d2dde026d9ae08459aa9e7a1edb05.