Andrew Young [Tue, 24 Jan 2023 04:08:35 +0000 (20:08 -0800)]
[MLIR] Add LocationAttr declarations to ODS
This commit adds location attributes and arrays of locations to OpBase.td.
Using LocationAttrs directly in an operation is useful when the location does
not correspond 1-1 to an operation or value in the IR. We use this in CIRCT to
store the declaration location of result ports of HWModule operations.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D142148
Johannes Doerfert [Tue, 24 Jan 2023 03:41:02 +0000 (19:41 -0800)]
[Attributor] Check assumptions to improve `isAlignedBarrier` queries
Johannes Doerfert [Tue, 24 Jan 2023 03:40:17 +0000 (19:40 -0800)]
[Attributor] Allow to delete (assume) intrinsics outside the SCC
Johannes Doerfert [Tue, 24 Jan 2023 03:58:20 +0000 (19:58 -0800)]
[Attributor][FIX] Ensure not to run new queries during manifest
If we modified the IR during manifest, e.g., SPMDzation, we might end up
with un-cached reachability queries. This is not good as the result is
going to be optimistic. We now cache the updateImpl result and use it
during manifest.
Bug was exposed in a follow up extension.
Johannes Doerfert [Tue, 24 Jan 2023 03:38:46 +0000 (19:38 -0800)]
[Attributor][FIX] Reachability needs to process the entire worklist
Johannes Doerfert [Tue, 24 Jan 2023 04:09:09 +0000 (20:09 -0800)]
[Attributor][FIX] Replace typo with something more sane
Xiang Li [Sat, 21 Jan 2023 06:50:40 +0000 (01:50 -0500)]
[mlir] support !shape.value_shape when replace WithOp in OutlineShapeComputationPass.
Fixes #60069 https://github.com/llvm/llvm-project/issues/60069
In case like:
%1 = shape.with_shape %arg1, %0 : !shape.value_shape, !shape.shape
%2 = shape.value_of %1 : tensor<?xf32>
cannot replace %2 with %arg1.
Transform it into
%2 = shape.value_of %arg1 : tensor<?xf32>
Differential Revision: https://reviews.llvm.org/D142275
Haowei Wu [Tue, 24 Jan 2023 02:43:23 +0000 (18:43 -0800)]
Revert "[Fuchsia] Build windows runtimes using cross compilation on Linux"
This reverts commit
20bb7658f53b0b8db165ff4d404ede3f9b34862d.
It breaks Fuchsia stage2 builders.
Alexey Bader [Tue, 24 Jan 2023 01:19:26 +0000 (17:19 -0800)]
[bugpoint] Fix compilation of bugpoint-passes on Windows
Bugpoint also depends on libLLVMSupport.dll for 'llvm_unreachable'
Reviewed By: beanz
Differential Revision: https://reviews.llvm.org/D140609
Vitaly Buka [Tue, 24 Jan 2023 01:05:59 +0000 (17:05 -0800)]
Revert "[profile] Disable test which needs update after D141512"
Work around with -fno-slp-vectorize.
This reverts commit
31260a4ce43aab7c04f501095a9032de063ccaf9.
Louis Dionne [Mon, 23 Jan 2023 15:19:27 +0000 (10:19 -0500)]
[libc++] Fix installation path for the modulemap
As pointed out in a post-commit comment of https://reviews.llvm.org/rGd00e035a4270.
Differential Revision: https://reviews.llvm.org/D142365
Siva Chandra Reddy [Mon, 23 Jan 2023 18:18:08 +0000 (18:18 +0000)]
[libc][NFC] Another round of replacement of static inline with LIBC_INLINE.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D142398
Kirill Stoimenov [Mon, 23 Jan 2023 17:55:53 +0000 (17:55 +0000)]
[HWASAN] Fix PointsIntoChunk to untag pointers. Also added some checks where we know that the pointer should be untagged.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D142389
Francesco Petrogalli [Tue, 24 Jan 2023 00:25:26 +0000 (01:25 +0100)]
Re-apply [build] Fix stand-alone builds of clang.
This reverts commit
0e09bb8b143c80426c497a924ee4fa57a26af6b5.
Differential Revision: https://reviews.llvm.org/D142403
Francesco Petrogalli [Tue, 24 Jan 2023 00:23:41 +0000 (01:23 +0100)]
Revert "[build] Fix stand-alone builds of clang."
There is a typo in the cmake configuration. It should be
RISCVTargetParserTableGen, not RISCVTargetParserTablegen.
This reverts commit
5d02e38f56dfa6c46dd71658c185582af1ffb07b.
Nadeem, Usman [Mon, 23 Jan 2023 19:13:58 +0000 (11:13 -0800)]
[WoA] Use fences for sequentially consistent stores/writes
LLVM currently uses LDAR/STLR and variants for acquire/release
as well as seq_cst operations. This is fine as long as all code uses
this convention.
Normally LDAR/STLR act as one way barriers but when used in
combination they provide a sequentially consistent model. i.e.
when an LDAR appears after an STLR in program order the STLR
acts as a two way fence and the store will be observed before
the load.
The problem is that normal loads (unlike ldar), when they appear
after the STLR can be observed before STLR (if my understanding
is correct). Possibly providing weaker than expected guarantees if
they are used for ordered atomic operations.
Unfortunately in Microsoft Visual Studio STL seq_cst ld/st are
implemented using normal load/stores and explicit fences:
dmb ish + str + dmb ish
ldr + dmb ish
This patch uses fences for MSVC target whenever we write to the
memory in a sequentially consistent way so that we don't rely on
the assumptions that just using LDAR/STLR will give us sequentially
consistent ordering.
Differential Revision: https://reviews.llvm.org/D141748
Change-Id: I48f3500ff8ec89677c9f089ce58181bd139bc68a
Nadeem, Usman [Sat, 14 Jan 2023 04:16:39 +0000 (20:16 -0800)]
[NFC][WoA] Precommit test for aarch64 atomics
This copies the atomic-ops file.
Committed without review.
Differential Revision: https://reviews.llvm.org/D141964
Change-Id: I7d7b05339d9ca23f88848c56f73a3e4d3e1abeba
Kirill Stoimenov [Mon, 23 Jan 2023 23:59:56 +0000 (23:59 +0000)]
[Sanitizer] Make GetBlockBeginFastLocked parameters const.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D142402
Kirill Stoimenov [Mon, 23 Jan 2023 23:56:41 +0000 (23:56 +0000)]
[HWASAN] Fix memory leaks in tests.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D142383
Joseph Huber [Mon, 23 Jan 2023 23:56:22 +0000 (17:56 -0600)]
[Clang][NFC] Fix documentation and remove unused tool
Summary:
I removed some documentation but not its Sphinx index, this fixes that.
Also I realized that we had a tool in the header still around so that's
gone too.
Francesco Petrogalli [Mon, 23 Jan 2023 23:56:37 +0000 (00:56 +0100)]
[build] Fix stand-alone builds of clang.
The target RISCVTargetParserTablegen needs to be visible for stand-alone [1] builds of clang to prevent configuration failures.
[1] https://llvm.org/docs/GettingStarted.html#stand-alone-builds
Reviewed By: tstellar
Differential Revision: https://reviews.llvm.org/D142403
Scott Linder [Mon, 23 Jan 2023 23:50:44 +0000 (23:50 +0000)]
[NFC] Add missing llvm:: specifier
This was omitted in
25c0ea2a5370813f46686918a84e0de27e107d08
Scott Linder [Mon, 23 Jan 2023 23:26:11 +0000 (23:26 +0000)]
[NFC] Use int underlying type for CodeGenOpt::Level
In practice the change from an unspecified underlying type to uint8_t in
25c0ea2a5370813f46686918a84e0de27e107d08 means some builds break due to
ambiguity resolving operator<< on ostreams (I assume because they define
uint8_t differently).
There were also valid points raised on the review saying that we can
just use int here anyway. Pinning it to any type removes the potential
for UB when constructing it, and int is the de-facto default.
Sanjay Patel [Mon, 23 Jan 2023 23:29:30 +0000 (18:29 -0500)]
[Support] revert accidentally removed "std::" specifiers
This snuck into
e76c95fb40b1 but wasn't intended.
Note: for some reason, these prefixes are causing build failures
on a macOS XCode project of LLVM.
Matthias Braun [Mon, 23 Jan 2023 17:54:15 +0000 (09:54 -0800)]
CoroFrame: Fix missing bitcast for some frame merges
The code to adjust types when merging fields on the coroutine frame
accidentally used `GetElementPtrInst::getResultElementType()` which does
the return the type the resulting pointer points to (so misses a pointer
type). This worked most of the time by accident because the type nearly
never matched, but failed to add a necessary bitcast for from `i8**` to
`i8*`.
Differential Revision: https://reviews.llvm.org/D142385
Joseph Huber [Mon, 23 Jan 2023 21:06:44 +0000 (15:06 -0600)]
[Libomptarget] Use the nextgen plugins by default.
The next-gen plugins are complete drop-in replacements for the old
versions. We should strive to replace the old ones as quickly as
possible now that we have a viable alternative.
The only test failing is the `prelock.cpp` test as the support has not landed in
the next-gen plugins.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D142399
Sanjay Patel [Mon, 23 Jan 2023 22:58:10 +0000 (17:58 -0500)]
[InstCombine] allow matching vector types for icmp-of-mask/cast
Also use a more specific matcher to simplify the mask
compare to type size.
Sanjay Patel [Mon, 23 Jan 2023 22:46:14 +0000 (17:46 -0500)]
[InstCombine] relax one-use check for icmp with mask/cast
Sanjay Patel [Mon, 23 Jan 2023 22:45:18 +0000 (17:45 -0500)]
[InstCombine] add tests for masked/casted icmp; NFC
Sanjay Patel [Mon, 23 Jan 2023 21:55:25 +0000 (16:55 -0500)]
[InstCombine] remove dead pattern matching code; NFC
Complexity canonicalization guarantees that a binop and cast
are op0/op1 respectively. Adjusted generic test names to
show that this pattern is still useful.
Sanjay Patel [Mon, 23 Jan 2023 20:48:15 +0000 (15:48 -0500)]
[InstCombine] add tests for signbit compares; NFC
Scott Linder [Mon, 23 Jan 2023 23:00:15 +0000 (23:00 +0000)]
[NFC] Remove redundant range check
Remove gratuitous check introduced in
25c0ea2a5370813f46686918a84e0de27e107d08 which was generating a warning
when compiling under GCC.
Aaron Puchert [Mon, 23 Jan 2023 22:58:43 +0000 (23:58 +0100)]
[CMake] Replace list(FIND) by if(IN_LIST) where index isn't used
If we don't use the index otherwise, if(IN_LIST) is more readable and
doesn't clutter the local scope with index variables.
This was pointed out by @beanz in D96670.
Reviewed By: beanz
Differential Revision: https://reviews.llvm.org/D142405
Vitaly Buka [Mon, 23 Jan 2023 22:50:52 +0000 (14:50 -0800)]
[profile] Disable test which needs update after D141512
Scott Linder [Mon, 16 Jan 2023 23:55:22 +0000 (23:55 +0000)]
[NFC] Consolidate llvm::CodeGenOpt::Level handling
Add free functions llvm::CodeGenOpt::{getLevel,getID,parseLevel} to
provide common implementations for functionality that has been
duplicated in many places across the codebase.
Differential Revision: https://reviews.llvm.org/D141968
Owen Pan [Sun, 22 Jan 2023 03:46:41 +0000 (19:46 -0800)]
[clang-format] Fix bugs in parsing C++20 module import statements
Also fixes #60145.
Differential Revision: https://reviews.llvm.org/D142296
serge-sans-paille [Mon, 23 Jan 2023 22:11:05 +0000 (23:11 +0100)]
[clang] Fix unused variable warning in isBuiltinSupported
Warnings introduced by
cf1756146d386667a80501fb8161505d12950804
Haowei Wu [Sat, 14 Jan 2023 00:51:14 +0000 (16:51 -0800)]
[Fuchsia] Build windows runtimes using cross compilation on Linux
This patch provides initial support of building Clang runtimes for
Windows when using Fuchsia Clang toolchains under Linux.
Differential Revision: https://reviews.llvm.org/D141738
Andy Getzendanner [Mon, 23 Jan 2023 13:36:55 +0000 (13:36 +0000)]
readability-const-return-type: don't diagnose a template function returning T, even if sometimes instantiated with e.g. T = const int.
It's not really a readability problem since there's no `const` to read at the declaration site, and returning std::remove_const_t<T> instead usually only hurts readability.
Reviewed By: ymandel
Differential Revision: https://reviews.llvm.org/D140434
Nuno Lopes [Mon, 23 Jan 2023 22:04:55 +0000 (22:04 +0000)]
Fix test expected result [NFC]
Take 2
Aopologies for the noise. Metadata numbering doesn't seem to be stable..
Martin Storsjö [Mon, 23 Jan 2023 12:09:56 +0000 (14:09 +0200)]
[docs] Add/update docs regarding LLVM_NATIVE_TOOL_DIR vs LLVM_TABLEGEN
Differential Revision: https://reviews.llvm.org/D142349
Nuno Lopes [Mon, 23 Jan 2023 21:36:56 +0000 (21:36 +0000)]
Fix test expected result [NFC]
For some reason, it only fails on some buildbots, but not in all, and not on my computer..
Francesco Petrogalli [Mon, 23 Jan 2023 21:31:34 +0000 (22:31 +0100)]
Revert "[build] Fix stand-alone builds of clang."
It breaks some builds [1] with the following error:
```
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/omp-vega20-0/bbot/openmp-offload-amdgpu-runtime/llvm.build/tools/clang/lib/Basic -I/home/omp-vega20-0/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/lib/Basic -I/home/omp-vega20-0/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/include -I/home/omp-vega20-0/bbot/openmp-offload-amdgpu-runtime/llvm.build/tools/clang/include -I/home/omp-vega20-0/bbot/openmp-offload-amdgpu-runtime/llvm.build/include -I/home/omp-vega20-0/bbot/openmp-offload-amdgpu-runtime/llvm.src/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -fno-exceptions -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/RISCV.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/RISCV.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/RISCV.cpp.o -c /home/omp-vega20-0/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/lib/Basic/Targets/RISCV.cpp
In file included from /home/omp-vega20-0/bbot/openmp-offload-amdgpu-runtime/llvm.src/clang/lib/Basic/Targets/RISCV.cpp:19:
/home/omp-vega20-0/bbot/openmp-offload-amdgpu-runtime/llvm.src/llvm/include/llvm/TargetParser/RISCVTargetParser.h:29:10: fatal error: llvm/TargetParser/RISCVTargetParserDef.inc: No such file or directory
29 | #include "llvm/TargetParser/RISCVTargetParserDef.inc"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
2.225 [3029/31/825] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Version.cpp.o
2.524 [3029/30/826] Building RISCVTargetParserDef.inc...
```
[1] https://lab.llvm.org/buildbot/#/builders/193/builds/25362
This reverts commit
52bcdac3b8425e20023151bb726b56fd6f62ec17.
Chris Cotter [Mon, 23 Jan 2023 21:24:01 +0000 (21:24 +0000)]
[clang-tidy] Improve rename_check.py
rename_check.py now find and renames the test file. rename_check.py
also will now use 'git mv', so the developer no longer has to manually
add the file after running the script.
Reviewed By: carlosgalvezp
Differential Revision: https://reviews.llvm.org/D141463
Carlos Galvez [Sun, 22 Jan 2023 16:30:10 +0000 (16:30 +0000)]
[clang-tidy][NFC] Use C++17 nested namespaces in clang-tidy headers
We forgot to apply the change to headers in the previous patch,
due to missing "-header-filter" in the run-clang-tidy invocation.
Differential Revision: https://reviews.llvm.org/D142307
Sam James [Mon, 9 Jan 2023 04:32:10 +0000 (04:32 +0000)]
[Clang] [Python] Fix tests when default config file contains -include
In Gentoo, we make use of Clang's recently-enhanced config file support
and add a default include to `clang` invocations using '-include ...'.
This breaks clang-python tests like so:
```
======================================================================
ERROR: test_includes (tests.cindex.test_translation_unit.TestTranslationUnit)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/tmp/portage/dev-python/clang-python-15.0.6/work/clang/bindings/python/tests/cindex/test_translation_unit.py", line 145, in test_includes
eq(i[0], i[1])
File "/var/tmp/portage/dev-python/clang-python-15.0.6/work/clang/bindings/python/tests/cindex/test_translation_unit.py", line 132, in eq
self.assert_normpaths_equal(expected[0], actual.source.name)
AttributeError: 'NoneType' object has no attribute 'name'
======================================================================
FAIL: test_inclusion_directive (tests.cindex.test_translation_unit.TestTranslationUnit)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/tmp/portage/dev-python/clang-python-15.0.6/work/clang/bindings/python/tests/cindex/test_translation_unit.py", line 157, in test_inclusion_directive
self.assert_normpaths_equal(i[0], i[1])
File "/var/tmp/portage/dev-python/clang-python-15.0.6/work/clang/bindings/python/tests/cindex/test_translation_unit.py", line 126, in assert_normpaths_equal
self.assertEqual(os.path.normpath(path1),
AssertionError: '/var/tmp/portage/dev-python/clang-python-1[58 chars]r1.h' != '/usr/include/gentoo/fortify.h'
- /var/tmp/portage/dev-python/clang-python-15.0.6/work/clang/bindings/python/tests/cindex/INPUTS/header1.h
+ /usr/include/gentoo/fortify.h
```
Disable using the default Clang configuration files on the system, like
we did for other tests.
Bug: https://bugs.gentoo.org/890204
Differential Revision: https://reviews.llvm.org/D141248
Francesco Petrogalli [Mon, 23 Jan 2023 12:27:10 +0000 (13:27 +0100)]
[build] Fix stand-alone builds of clang.
The header file `llvm/include/llvm/Targetparser/RISCVTargetParser.h`
relies on the auto-generated *.inc file associated to the tablegen
target `RISCVTargetParserTableGen`.
Both clangBasic and clangDriver include `RISCVTargetParser.h`,
therefore we need to make sure that the *.inc file is avaiable to
avoid compilation errors like the following:
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/RISCV.cpp.o
/usr/bin/c++ [bunch of non interesting stuff] -c <path-to>/llvm-project/clang/lib/Basic/Targets/RISCV.cpp
In file included from <path-to>/llvm-project/clang/lib/Basic/Targets/RISCV.cpp:19:
<path-to>/llvm-project/llvm/include/llvm/TargetParser/RISCVTargetParser.h:29:10: fatal error: llvm/TargetParser/RISCVTargetParserDef.inc: No such file or directory
29 | #include "llvm/TargetParser/RISCVTargetParserDef.inc"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The stand-alone build of `clang` has been tested with the following
script (see [*] for further information):
```
build_llvm=`pwd`/build-llvm
build_clang=`pwd`/build-clang
installprefix=`pwd`/install
llvm=`pwd`/llvm-project
mkdir -p $build_llvm
mkdir -p $installprefix
cmake -G Ninja -S $llvm/llvm -B $build_llvm \
-DLLVM_INSTALL_UTILS=ON \
-DCMAKE_INSTALL_PREFIX=$installprefix \
-DCMAKE_BUILD_TYPE=Release
ninja -C $build_llvm install
cmake -G Ninja -S $llvm/clang -B $build_clang \
-DLLVM_EXTERNAL_LIT=$build_llvm/utils/lit \
-DLLVM_ROOT=$installprefix
```
[*] https://llvm.org/docs/GettingStarted.html#stand-alone-builds
Differential Revision: https://reviews.llvm.org/D141581
Hui [Tue, 3 Jan 2023 18:51:34 +0000 (18:51 +0000)]
[libc++] implement P1020R1 P1973R1 make_unique[shared]_for_overwrite
Differential Revision: https://reviews.llvm.org/D140913
Carlos Galvez [Mon, 23 Jan 2023 21:05:08 +0000 (21:05 +0000)]
[clang-tidy][NFC] Fix Release Notes build error
Carlos Galvez [Wed, 4 Jan 2023 16:42:16 +0000 (16:42 +0000)]
[clang-tidy] Introduce HeaderFileExtensions and ImplementationFileExtensions options
We have a number of checks designed to analyze problems
in header files only, for example:
bugprone-suspicious-include
google-build-namespaces
llvm-header-guard
misc-definitions-in-header
...
All these checks duplicate the same logic and options
to determine whether a location is placed in the main
source file or in the header. More checks are coming
up with similar requirements.
Thus, to remove duplication, let's move this option
to the top-level configuration of clang-tidy (since
it's something all checks should share).
Since the checks fetch the option via getLocalOrGlobal,
the behavior is unchanged.
Add a deprecation notice for all checks that use the
local option, prompting to update to the global option.
The functionality for parsing the option will need to
remain in the checks during the transition period.
Once the local options are fully removed, the goal
is to store the parsed options in the ClangTidyContext,
that checks can easily have access to.
Differential Revision: https://reviews.llvm.org/D141000
Fangrui Song [Mon, 23 Jan 2023 20:56:23 +0000 (12:56 -0800)]
[bazel] Enable layering_check for llvm/unittests
Fangrui Song [Mon, 23 Jan 2023 20:55:00 +0000 (12:55 -0800)]
[bazel] Fix --features=layering_check issues for llvm/unittests
Nicolai Hähnle [Thu, 1 Dec 2022 10:00:30 +0000 (11:00 +0100)]
AMDGPU: Clean up LDS-related occupancy calculations
Occupancy is expressed as waves per SIMD. This means that we need to
take into account the number of SIMDs per "CU" or, to be more precise,
the number of SIMDs over which a workgroup may be distributed.
getOccupancyWithLocalMemSize was wrong because it didn't take SIMDs
into account at all.
At the same time, we need to take into account that WGP mode offers
access to a larger total amount of LDS, since this can affect how
non-power-of-two LDS allocations are rounded. To make this work
consistently, we distinguish between (available) local memory size and
addressable local memory size (which is always limited by 64kB on
gfx10+, even with WGP mode).
This change results in a massive amount of test churn. A lot of it is
caused by the fact that the default work group size is 1024, which means
that (due to rounding effects) the default occupancy on older hardware
is 8 instead of 10, which affects scheduling via register pressure
estimates. I've adjusted most tests by just running the UTC tools, but
in some cases I manually changed the work group size to 32 or 64 to make
sure that work group size chunkiness has no effect.
Differential Revision: https://reviews.llvm.org/D139468
Nicolai Hähnle [Tue, 6 Dec 2022 22:10:15 +0000 (23:10 +0100)]
AMDGPU: Add a scheduler test to demonstrate an upcoming change
Nicolai Hähnle [Tue, 6 Dec 2022 21:41:08 +0000 (22:41 +0100)]
AMDGPU: Re-run UTC scripts on some test cases
Reduce the diff of subsequent changes.
Nicolai Hähnle [Thu, 1 Dec 2022 09:57:22 +0000 (10:57 +0100)]
AMDGPU: Add AMDGPUSubtarget::getEUsPerCU()
We will use this for more accurate occupancy computations. Note that
IsaInfo takes WGP mode vs. CU mode into account on gfx10+.
Differential Revision: https://reviews.llvm.org/D139467
Philip Reames [Mon, 23 Jan 2023 20:29:36 +0000 (12:29 -0800)]
[RISCV] Add a test case for a missed PRE oppurtunity when inserting vsetvlis
Slava Zakharin [Sat, 21 Jan 2023 03:58:36 +0000 (19:58 -0800)]
[flang] Avoid unnecessary temporaries in ArrayValueCopy.
Assume no conflict between pointer arrays and arrays without the target
attribute, if the fact of an array not having the target attribute
can be reliably computed.
This change speeds up SPEC CPU2017/527.cam from 2.5k seconds to 880 seconds
on Icelake, and makes further performance investigation easier.
Differential Revision: https://reviews.llvm.org/D142273
Martin Storsjö [Mon, 23 Jan 2023 11:25:55 +0000 (13:25 +0200)]
[docs] Add release notes for news in 16.x done by me, or otherwise relating to MinGW targets
Differential Revision: https://reviews.llvm.org/D142346
Aart Bik [Sat, 21 Jan 2023 21:05:32 +0000 (13:05 -0800)]
[mlir][sparse] clean vectorization bail-out for VL=0
Fixes https://github.com/llvm/llvm-project/issues/59970
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D142290
Fangrui Song [Mon, 23 Jan 2023 20:08:13 +0000 (12:08 -0800)]
[bazel] Fix layering_check issues of {llvm,clang}:all
Valentin Clement [Mon, 23 Jan 2023 19:23:02 +0000 (20:23 +0100)]
[flang] Keep polymorphic aspect when lowering intrinsic arguments
Make sure the source passed to an intrinsic is still polymorphic when
it is an element of a polymorphic array. This was not handled properly
before.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D142380
Lei Zhang [Mon, 23 Jan 2023 19:08:06 +0000 (11:08 -0800)]
[mlir][spirv] Move uint asm name test to the proper place
Anshil Gandhi [Mon, 23 Jan 2023 16:19:55 +0000 (09:19 -0700)]
[InstCombine] Handle select inst when eliminating constant memcpy
Allow iterating through SelectInst use of the alloca when
checking if it is only ever overwritten from constant memory.
Recursively determine if the SelectInst is replacable and insert
it into the Worklist if so. Finally, define a new SelectInst to
replace the old one, with both of it's values replaced according
to the WorkMap.
Differential Revision: https://reviews.llvm.org/D136524
Stanislav Mekhanoshin [Mon, 23 Jan 2023 18:59:46 +0000 (10:59 -0800)]
[AMDGPU] Use more consistemt way to avoid overflow in the scheduler
Use more consistent way to avoid overflow when calculating SGPR
and VGPR pressure limits.
Differential Revision: https://reviews.llvm.org/D142262
Kazu Hirata [Mon, 23 Jan 2023 18:57:56 +0000 (10:57 -0800)]
[llvm] Fix warnings
This patch fixes:
llvm/lib/IR/DataLayout.cpp:942:13: warning: unused variable ‘VecTy’
[-Wunused-variable]
llvm/lib/Transforms/IPO/OpenMPOpt.cpp:2899:27: warning: unused
variable ‘MI’ [-Wunused-variable]
Jay Foad [Mon, 23 Jan 2023 18:21:04 +0000 (18:21 +0000)]
[TableGen] Avoid repeated lookups of Uses and Defs records. NFC.
Aaron Ballman [Mon, 23 Jan 2023 18:43:41 +0000 (13:43 -0500)]
Silence an MSVC "not all control paths return" warning; NFC
Jason Molenda [Mon, 23 Jan 2023 18:42:31 +0000 (10:42 -0800)]
Run cmdline address expressions through ABI's FixAddress
On systems like ARM, where the non-addressable bits of a pointer
value may be used for metadata (ARMv8.3 pointer authentication, or
Type Byte Ignore), those bits need to be cleared before the address
points to a valid memory location. Add a call to the target's ABI
to clear those from address expression arguments to the lldb
commands (e.g. `disassemble -a`).
Differential Revision: https://reviews.llvm.org/D141629
Stanislav Mekhanoshin [Mon, 16 Jan 2023 23:17:06 +0000 (15:17 -0800)]
[AMDGPU] Tune scheduler on GFX10 and GFX11 for regions with spilling
Unlike older ASICs GFX10+ have a lot of VGPRs. Therefore, it is possible
to achieve high occupancy even with all or almost all addressable VGPRs
used. Our scheduler was never tuned for this scenario. The VGPR Critical
Limit threshold always comes very high, even if maximum occupancy is
targeted. For example on gfx1100 it is set to 192 registers even with
the requested occupancy 16. As a result scheduler starts prioritizing
register pressure reduction very late and we easily end up spilling.
This patch makes VGPR critical limit similar to what we would have on
pre-gfx10 targets with much more limited VGPR budget while still trying
to maintain occupancy as it does now.
Pre-gfx10 ASICs shall not be affected as the limit shall be the same
as before, and on gfx10+ it shall only affect regions where we have
to spill.
Fixes: SWDEV-377300
Differential Revision: https://reviews.llvm.org/D141876
David Green [Mon, 23 Jan 2023 18:39:17 +0000 (18:39 +0000)]
[AArch64] Remove AES, SHA2, SHA3 and SM4 features from armv8.6-a+
The Armv8.6-a and later architecture definitions included AES, SHA2,
SHA3 and SM4, but this did not have an effect when specifying
-march=armv8.6-a. The did not set preprocessor features
(https://godbolt.org/z/1YKad6M8e) or enable the relevant instructions
(like eor3 from sha3: https://godbolt.org/z/vY9v4MqvG). Similarly
architectures armv8 to armv8.5 defined +crypto, but this did not effect
the -march's, only the -mcpu with those architectures. I believe this
was working as intended.
After D141411 we now add the default features for architectures except
for +crypto, which has had the effect of enabling aes/sha2/sha3/sm4 when
-march=armv8.6-a is used. This patch removed those crypto features
again, going back to how things were before. It also removes the
AEK_CRYPTO feature from lower architecture levels, moving it to the cpus
that use it. This shouldn't make any changes, but a few extra tests have
been added for preprocessor features that have improved since llvm 15.
The -mcpu=ampere1 cpu is the only armv8.6+ cpu at present. For that, the
AES, SHA2 and SHA3 features have been re-added to the CPU definition to
keep it in-line with the gcc definition from
https://github.com/gcc-mirror/gcc/commit/
db2f5d661239737157cf131de7d4df1c17d8d88d.
Differential Revision: https://reviews.llvm.org/D141606
Pavel Iliin [Fri, 20 Jan 2023 23:31:53 +0000 (23:31 +0000)]
[AArch64] Function multi-versioning release notes added. NFC.
Differential Revision: https://reviews.llvm.org/D142265
Han Zhu [Fri, 13 Jan 2023 20:18:32 +0000 (12:18 -0800)]
[tsan] Always initialize tsan when building shared lib
Differential Revision: https://reviews.llvm.org/D142039
Pavel Iliin [Mon, 23 Jan 2023 18:22:20 +0000 (18:22 +0000)]
Revert "[AArch64] Function multi-versioning release notes added. NFC."
This reverts commit
5474d7d932710c260f03ce6c6387ec9d82bd10e2.
Wrong differential revision link was used.
Shivam Gupta [Mon, 23 Jan 2023 18:18:37 +0000 (23:48 +0530)]
[Clang] Fix a Wbitfield-enum-conversion warning in DirectoryLookup.h
When compiling clang/Lex/DirectoryLookup.h with option -Wbitfield-enum-conversion, we get the following warning:
DirectoryLookup.h:77:17: warning:
bit-field 'DirCharacteristic' is not wide enough to store all enumerators of
'CharacteristicKind' [-Wbitfield-enum-conversion]
: u(Map), DirCharacteristic(DT), LookupType(LT_HeaderMap),
DirCharacteristic is a bitfield with 2 bits (4 values)
/// DirCharacteristic - The type of directory this is: this is an instance of
/// SrcMgr::CharacteristicKind.
unsigned DirCharacteristic : 2;
Whereas SrcMgr::CharacterKind is an enum with 5 values:
enum CharacteristicKind {
C_User,
C_System,
C_ExternCSystem,
C_User_ModuleMap,
C_System_ModuleMap
};
Solution is to increase DirCharacteristic bitfield from 2 to 3.
Patch by Dimitri van Heesch
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D142304
Craig Topper [Mon, 23 Jan 2023 18:03:06 +0000 (10:03 -0800)]
[RISCV] Move Processors and Features from RISCV.td to their own files.
This reduces RISCV.td to mainly being a top level include file.
Reviewed By: asb, luismarques
Differential Revision: https://reviews.llvm.org/D142239
Adrian Prantl [Mon, 23 Jan 2023 18:14:15 +0000 (10:14 -0800)]
Mark BuiltinHeaders.def as textual
Pavel Iliin [Fri, 20 Jan 2023 23:31:53 +0000 (23:31 +0000)]
[AArch64] Function multi-versioning release notes added. NFC.
Differential Revision: https://reviews.llvm.org/D141606
Dave Lee [Mon, 23 Jan 2023 17:51:43 +0000 (09:51 -0800)]
Revert "[lldb] Remove timer from SBModule copy ctor"
This reverts commit
84c6129c943135e2c32b9254f08d0a2e7b21116a.
Caroline Concatto [Mon, 23 Jan 2023 17:15:34 +0000 (17:15 +0000)]
[AArch64][SME2] Add Multi-vector saturating extract narrow intrinsics
Add the following intrinsic:
SQCVT
SQCVTU
UQCVT
NOTE: These intrinsics are still in development and are subject to future changes.
Reviewed By: kmclaughlin
Differential Revision: https://reviews.llvm.org/D142035
Florian Hahn [Mon, 23 Jan 2023 17:41:12 +0000 (17:41 +0000)]
[SCCPSolver] Move helper functions inside SCCPSolver (NFC).
This patch moves a couple of helper functions from the global llvm::
namespace into the SCCPSolver class. This reduces the need for separate
SCCPSolver arguments and also limits the scope of those functions that
have quite generic names.
(The remaining isConstant and isOverdefined should ideally be removed)
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D142370
Florian Hahn [Mon, 23 Jan 2023 17:40:30 +0000 (17:40 +0000)]
[SCCP] Auto-generate check lines for ip-ranges-select.ll.
Mark de Wever [Mon, 23 Jan 2023 17:26:18 +0000 (18:26 +0100)]
[libc++][doc] Fixes the usage of improper markup.
Caroline Concatto [Mon, 23 Jan 2023 16:25:07 +0000 (16:25 +0000)]
[AArch64][SME2] Add multi-vector convert to/from floating-point intrinsic
Add the following intrinsic:
FCVT
BFCVT
FCVTZS
FCVTZU
SCVTF
UCVTF
This patch also adds SelectCVTIntrinsic to handle the cases when the
intrinsic returns multiple (two or four) outputs
NOTE: These intrinsics are still in development and are subject to future changes.
Reviewed By: kmclaughlin
Differential Revision: https://reviews.llvm.org/D142032
Zahira Ammarguellat [Mon, 23 Jan 2023 15:40:10 +0000 (10:40 -0500)]
Add support for clang-cl's option `-fexcess-precision`.
This option is useful for clang and clang-cl.
Differential Revision: https://reviews.llvm.org/D142367
Xiang Li [Sun, 22 Jan 2023 03:24:41 +0000 (22:24 -0500)]
[mlir] support unsigned int in mlir::spirv::ConstantOp::getAsmResultNames
Fixes #60184 https://github.com/llvm/llvm-project/issues/60184
Differential Revision: https://reviews.llvm.org/D142295
Guillaume Chatelet [Mon, 23 Jan 2023 16:52:46 +0000 (16:52 +0000)]
[libc][NFC] Reduce CMake configuration time
This patch reduces CMake configuration time drastically by removing a non-linear behavior.
Time to execute CMake configure step goes from 45s to 15s.
Differential Revision: https://reviews.llvm.org/D142374
Lucas Prates [Wed, 21 Dec 2022 16:45:38 +0000 (16:45 +0000)]
[AArch64][Clang] Adjust default features for v8.9-A/v9.4-A in clang driver
Update the clang driver to include the following features as default for
the v8.9-A/v9.4-A architecture versions:
* FEAT_SPECRES2
* FEAT_CSSC
* FEAT_RASv2
Patch by Sam Elliott.
Reviewed By: lenary, tmatheson
Differential Revision: https://reviews.llvm.org/D141404
Lucas Prates [Thu, 19 Jan 2023 14:46:06 +0000 (14:46 +0000)]
[AArch64] Add command line support for v9.4-A's Instrumentation Extension
This introduces command line support (`+ite`) for the v9.4-A's
Instrumentation Extension (FEAT_ITE).
Patch by Son Tuan Vu.
Reviewed By: lenary, tmatheson
Differential Revision: https://reviews.llvm.org/D141403
Florian Hahn [Mon, 23 Jan 2023 16:14:56 +0000 (16:14 +0000)]
[SCCP] Add initial tests for NUW/NSW inference.
Ties Stuij [Mon, 23 Jan 2023 16:08:28 +0000 (16:08 +0000)]
[docs] add early Arm arch support improvements to release notes
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D142229
Quentin Colombet [Mon, 23 Jan 2023 10:37:02 +0000 (10:37 +0000)]
[mlir][MemRefToLLVM] Remove the code for lowering collaspe/expand_shape
collapse/expand_shape are supposed to be expanded before we hit the
lowering code.
The expansion is done with the pass called expand-strided-metadata.
This patch is NFC in spirit but not in practice because
expand-strided-metadata won't try to accomodate for "invalid" strides
for dynamic sizes that are 1 at runtime.
The previous code was broken in that respect too, but differently: it
handled only the case of row-major layouts.
That whole part is being reworked separately.
Differential Revision: https://reviews.llvm.org/D136483
Krasimir Georgiev [Mon, 23 Jan 2023 15:38:46 +0000 (15:38 +0000)]
bazel: adapt for https://github.com/llvm/llvm-project/commit/
a4699a43e42615281c96599d20977cabf10bfb9c
Archibald Elliott [Tue, 20 Dec 2022 16:08:06 +0000 (16:08 +0000)]
[AArch64] Check 128-bit Sysreg Builtins
This patch contains several related changes:
1. We move to using TARGET_BUILTIN for the 128-bit system register
builtins to give better error messages when d128 has not been
enabled, or has been enabled in a per-function manner.
2. We now validate the inputs to the 128-bit system register builtins,
like we validate the other system register builtins.
3. We update the list of named PSTATE accessors for MSR (immediate), and
now correctly enforce the expected ranges of the immediates. There is
a long comment about how we chose to do this to comply with the ACLE
when most of the PSTATE accessors for MSR (immediate) have aliased
system registers for MRS/MSR which expect different values. In short,
the MSR (immediate) names are prioritised, rather than falling-back
to the register form when the value is out of range.
Differential Revision: https://reviews.llvm.org/D140222
Alex Zinenko [Fri, 20 Jan 2023 13:42:09 +0000 (13:42 +0000)]
[mlir] fix outdated assert in affine symbol verification
The verification of affine value classification for symbols was
expecting, incorrectly, that the dimension operand of `memref.dim` was
being produced by a constant-like operation. This is legacy of the
dimension being an attribute originally, and was never updated after it
was switched to be an operation. Treat such cases conservatively and
classify the value as non-symbol.
A more advanced version could attempt to check that the value would be a
valid symbol for all possible values the dimension attribute could take,
but this does not seem immediately useful.
Fixes #59993.
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D142204
Alex Zinenko [Fri, 20 Jan 2023 12:17:59 +0000 (12:17 +0000)]
[mlir] fix side effects for transform.AlternativesOp
It should have an "Allocate" effect on entry block arguments of all
regions in addition to consuming the operand.
Also relax the assertion in transform-dialect-check-uses until we can
properly support region-based control flow.
Fixes #60075.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D142200
Xiang Li [Sat, 21 Jan 2023 16:36:05 +0000 (11:36 -0500)]
[mlir] add RemoveConstantIfCondition to populateOpenACCToSCFConversionPatterns
Fixes #60058 https://github.com/llvm/llvm-project/issues/60058
It hit assert when legalizePatternResult on success of ExpandIfCondition which did nothing just return success when if condition is constant.
Added RemoveConstantIfCondition to remove the if cond by getCanonicalizationPatterns.
Also remove the check for constant if cond in ExpandIfCondition and
change check ifCond to assert because only op with ifCond will need legalize in ConvertOpenACCToSCFPass
Differential Revision: https://reviews.llvm.org/D142286
Lucas Prates [Wed, 21 Dec 2022 16:22:35 +0000 (16:22 +0000)]
[AArch64] Support v8.9-A/v9.4-A in .arch_extension directive
This adds support for the v8.9-A/v9.4-A architectural extensions to be
used in .arch_extension assembly directives.
Patch by Sam Elliott.
Reviewed By: lenary, tmatheson
Differential Revision: https://reviews.llvm.org/D141402
Lucas Prates [Tue, 20 Dec 2022 17:34:01 +0000 (17:34 +0000)]
[AArch64] Add missing system register for v8.9-A/v9.4-A Permission Indirection Extension
This adds support for the missing `PIRE0_EL12` system register, part of
v8.9-A/v9.4-A's Permission Indirection Extension.
Patch by Son Tuan Vu.
Reviewed By: tmatheson
Differential Revision: https://reviews.llvm.org/D141400
Joseph Huber [Mon, 23 Jan 2023 14:55:35 +0000 (08:55 -0600)]
[Libomptarget][NFC] Address a few warnings in libomptarget
Summary:
Fix a few minor warnings that show up in `libomptarget`.