Kai Luo [Tue, 25 Jul 2023 00:08:53 +0000 (08:08 +0800)]
[PowerPC][AIX] Enable quadword atomics by default for AIX
On AIX, a libatomic supporting inline quadword atomic operations has been released, so that compatibility is not an issue now, we can enable quadword atomics by default.
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D151312
Alex Richardson [Mon, 24 Jul 2023 23:41:44 +0000 (16:41 -0700)]
[builtins] Avoid using CRT_LDBL_128BIT in implementation. NFC
Currently the *tf builtin functions can only be built if long double is an
IEEE float, which prevents them from being available e.g. for x86 targets
(unlike libgcc which has them). This non-functional change prepares the
builtins library *tf functions for being able to target x86 by decoupling
their presence from CRT_LDBL_128BIT and instead checking for a
CRT_HAS_TF_MODE macro. This change is NFC since the CRT_HAS_TF_MODE is
currently only set if long double is an IEEE 128-bit float.
Reviewed By: compnerd
Differential Revision: https://reviews.llvm.org/D153812
Alex Richardson [Mon, 26 Jun 2023 21:58:29 +0000 (14:58 -0700)]
[builtins] Drop -fnested-functions flag from tests
This flag does nothing for clang and is apparently not supported by GCC:
aarch64-linux-gnu-gcc: error: unrecognized command-line option '-fnested-functions'; did you mean '-Wunused-function'?
It looks like it was maybe supported by Apple GCC, but that is no longer
a supported compiler.
Differential Revision: https://reviews.llvm.org/D153819
Alex Richardson [Mon, 26 Jun 2023 18:09:34 +0000 (11:09 -0700)]
[builtins] Fix building trunc*fhf2_test with GCC
GCC does not support __fp16, use the TYPE_FP16 macro instead.
Differential Revision: https://reviews.llvm.org/D153813
Matt Arsenault [Sat, 22 Jul 2023 12:12:23 +0000 (08:12 -0400)]
ConstantFolding: Constant fold denormal inputs to canonicalize for IEEE
This makes it possible to use canonicalize to perform a dynamic check
for whether denormal flushing is enabled, which will fold out when the
denormal mode is known. Previously it would only fold if denormal
flushing were known enabled.
https://reviews.llvm.org/D156107
Nicolas Vasilache [Mon, 24 Jul 2023 23:26:00 +0000 (01:26 +0200)]
[mlir][gpu][transforms] Only depend on ExecutionEngine if MLIR_ENABLE_CUDA_RUNNER is true
This fixes a compilation bug where we would try to depend on ExecutionEngine but it wasn't actually built.
Nicolas Vasilache [Mon, 24 Jul 2023 22:50:42 +0000 (00:50 +0200)]
[mlir][linalg] NFC - Move some utils in preparation for revamping mapping of scf.forall
Vitaly Buka [Mon, 24 Jul 2023 22:52:16 +0000 (15:52 -0700)]
[NFC] Add MprotectReadWrite
It's unused, but I need it for debuging.
Seems usefull for completeness.
Reviewed By: thurston
Differential Revision: https://reviews.llvm.org/D156180
Ivan Butygin [Mon, 24 Jul 2023 19:35:28 +0000 (21:35 +0200)]
[mlir][spirv] Convert `ub.poison` to `spirv.undef`
SPIR-V doesn't have poison, but poison can be converted to undef.
Differential Revision: https://reviews.llvm.org/D156163
varconst [Mon, 24 Jul 2023 21:56:44 +0000 (14:56 -0700)]
[libc++][hardening] Categorize more assertions.
Differential Revision: https://reviews.llvm.org/D155873
Cyndy Ishida [Mon, 24 Jul 2023 21:25:21 +0000 (14:25 -0700)]
[TextAPI] Remove TBD file attributes that aren't used anymore.
UUID's & `installapi` flag are no longer useful in recent apple linker/tapi.
The reason for removing them is that these are attributes that record
how a library was built but not really about the library itself. TBD
files now only track information this is important as link time
dependencies.
Reviewed By: ributzka
Differential Revision: https://reviews.llvm.org/D149861
Joshua Batista [Mon, 24 Jul 2023 20:09:21 +0000 (13:09 -0700)]
clang: Add elementwise pow builtin
Add codegen for llvm pow elementwise builtin
The pow elementwise builtin is necessary for HLSL codegen.
Tests were added to make sure that the expected errors are encountered when these functions are given inputs of incompatible types, or too many inputs.
The new builtin is restricted to floating point types only.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D153310
Jonathan Peyton [Thu, 6 Jul 2023 20:05:59 +0000 (15:05 -0500)]
[OpenMP] Move KMP_VERSION printout logic to post-serial-init
Get the KMP_VERSION printout logic out of environment variable file
(kmp_settings.cpp) and move to end of serial initialization where
KMP_SETTINGS and OMP_DISPLAY_ENV are.
Differential Revision: https://reviews.llvm.org/D154652
Jonathan Peyton [Mon, 24 Jul 2023 21:01:03 +0000 (16:01 -0500)]
[OpenMP] Restore comment accidently deleted in D154650
Jonathan Peyton [Thu, 6 Jul 2023 18:50:34 +0000 (13:50 -0500)]
[OpenMP] Re-use affinity raii class in worker spawning
Get rid of explicit mask alloc, getthreadaffinity, set temp affinity,
reset to old affinity, dealloc steps in favor of existing
kmp_affinity_raii_t to push/pop a temporary affinity.
Differential Revision: https://reviews.llvm.org/D154650
Jacek Caban [Mon, 24 Jul 2023 20:49:58 +0000 (22:49 +0200)]
Revert "[llvm-objdump] [NFC] Factor out DisassemblerTarget class."
This reverts commit
6c48f57c14dcfe2410afcb4c6778dcbb40d294b5.
Build broken on GCC.
Nick Desaulniers [Mon, 24 Jul 2023 20:40:14 +0000 (13:40 -0700)]
[clang][ConstantEmitter] have tryEmitPrivate[ForVarInit] try ConstExprEmitter fast-path first
As suggested by @efriedma in:
https://reviews.llvm.org/D76096#4370369
This should speed up evaluating whether an expression is constant or
not, but due to the complexity of these two different implementations,
we may start getting different answers for edge cases for which we do
not yet have test cases in-tree (or perhaps even performance regressions
for some cases). As such, contributors have carte blanche to revert if
necessary.
For additional historical context about ExprConstant vs CGExprConstant,
here's snippets from a private conversation on discord:
ndesaulniers:
why do we have clang/lib/AST/ExprConstant.cpp and
clang/lib/CodeGen/CGExprConstant.cpp? Does clang constant fold during
ast walking/creation AND during LLVM codegen?
efriedma:
originally, clang needed to handle two things: integer constant
expressions (the "5" in "int x[5];"), and constant global initializers
(the "5" in "int x = 5;"). pre-C++11, the two could be handled mostly
separately; so we had the code for integer constants in AST/, and the
code for globals in CodeGen/. C++11 constexpr sort of destroyed that
separation, though. so now we do both kinds of constant evaluation on
the AST, then CGExprConstant translates the result of that evaluation
to LLVM IR. but we kept around some bits of the old cgexprconstant to
avoid performance/memory usage regressions on large arrays.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D151587
Craig Topper [Mon, 24 Jul 2023 20:38:51 +0000 (13:38 -0700)]
[RISCV] Add lowering for scalar fmaximum/fminimum.
Unlike fmaxnum and fminnum, these operations propagate nan and
consider -0.0 to be less than +0.0.
Without Zfa, we don't have a single instruction for this. The
lowering I've used forces the other input to nan if one input
is a nan. If both inputs are nan, they get swapped. Then use
the fmax or fmin instruction.
New ISD nodes are needed because fmaxnum/fminnum to not define
the order of -0.0 and +0.0.
This lowering ensures the snans are quieted though that is probably not
required in default environment). Also ensures non-canonical nans
are canonicalized, though I'm also not sure that's needed.
Another option could be to use fmax/fmin and then overwrite the
result based on the inputs being nan, but I'm not sure we can do
that with any less code.
Future work will handle nonans FMF, and handling the case where
we can prove the input isn't nan.
This does fix the crash in #64022, but we need to do more work
to avoid scalarization.
Reviewed By: fakepaper56
Differential Revision: https://reviews.llvm.org/D156069
Jacek Caban [Wed, 19 Apr 2023 21:39:53 +0000 (23:39 +0200)]
[llvm-objdump] [NFC] Factor out DisassemblerTarget class.
This is a preparation for ARM64EC/ARM64X binaries, which may contain both ARM64
and x86_64 code in the same file. llvm-objdump already has partial support for
mixing disassemblers for ARM thumb mode support. However, for ARM64EC we can't
share MCContext, MCInstrAnalysis and PrettyPrinter instances. This patch
provides additional abstraction which makes adding mixed code support later in
the series easier.
Reviewed By: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D149093
Piotr Zegar [Mon, 24 Jul 2023 19:43:47 +0000 (19:43 +0000)]
[clang-tidy] Initialize DiagnosticEngine in ExpandModularHeaders
Fix issue preventing suppression of compiler warnings with
-Wno-<warning> under C++20 and above. Add call to
ProcessWarningOptions and propagate DiagnosticOpts more properly.
Fixes: #56709, #61969
Reviewed By: carlosgalvezp
Differential Revision: https://reviews.llvm.org/D156056
Anton Dukeman [Mon, 24 Jul 2023 19:14:35 +0000 (19:14 +0000)]
[clang-tidy] Add folly::Optional to unchecked-optional-access
The unchecked-optional-access check identifies attempted value
unwrapping without checking if the value exists. These changes extend
that support to checking folly::Optional.
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D155890
Philip Reames [Mon, 24 Jul 2023 19:30:25 +0000 (12:30 -0700)]
[RISCV] Adjust memcpy lowering test coverage w/V
This is fixing a mistake in
4f4f49137.
Mehdi Amini [Mon, 24 Jul 2023 19:27:01 +0000 (12:27 -0700)]
Revert "Update ODS variadic segments "magic" attributes to use native Properties"
This reverts commit
20b93abca6516bbb23689c3777536fea04e46e14.
One python test is broken, WIP.
Fangrui Song [Mon, 24 Jul 2023 19:27:14 +0000 (12:27 -0700)]
[Driver][test] Remove XRay/lit.local.cfg
This was needed when XRay/* tests relied on the default target triple.
Now that we set a default target triple for every test we can remove
this customization.
This cleanup is intrigued by D156090.
Philip Reames [Mon, 24 Jul 2023 19:18:04 +0000 (12:18 -0700)]
[RISCV] Add memcpy lowering test coverage with and without V
LLVM GN Syncbot [Mon, 24 Jul 2023 19:02:32 +0000 (19:02 +0000)]
[gn build] Port
0882c70df222
Cyndy Ishida [Mon, 24 Jul 2023 18:55:01 +0000 (11:55 -0700)]
[TextAPI] Introduce SymbolSet
SymbolSet is a structure that acts as a simple container class for exported symbols that
belong to a library interface. It allows tapi to decouple the globals
from the other library attributes. It's uniqued by symbol name and `kind`, which all contain their assigned target triples.
Reviewed By: zixuw
Differential Revision: https://reviews.llvm.org/D149860
Jacek Caban [Mon, 24 Jul 2023 18:55:49 +0000 (20:55 +0200)]
[llvm-objdump] [NFC] Add missing REQUIRES to arm64ec.yaml.
Differential Revision: https://reviews.llvm.org/D149091
Jacek Caban [Wed, 12 Apr 2023 19:18:37 +0000 (21:18 +0200)]
Recognize ARM64EC binaries in COFFObjectFile::getMachine.
ARM64EC/ARM64X binaries use ARM64 or AMD64 machine types, but provide
additional CHPE metadata that may be used to distinguish them from
pure ARM64/AMD64 binaries.
Reviewed By: jhenderson, MaskRay, mstorsjo
Differential Revision: https://reviews.llvm.org/D149091
Jacek Caban [Fri, 28 Apr 2023 12:35:38 +0000 (14:35 +0200)]
[yaml2obj] Add support for load config section data.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D149440
Mehdi Amini [Fri, 21 Jul 2023 05:51:35 +0000 (22:51 -0700)]
Update ODS variadic segments "magic" attributes to use native Properties
The operand_segment_sizes and result_segment_sizes Attributes are now inlined
in the operation as native propertie. We continue to support building an
Attribute on the fly for `getAttr("operand_segment_sizes")` and setting the
property from an attribute with `setAttr("operand_segment_sizes", attr)`.
A new bytecode version is introduced to support backward compatibility and
backdeployments.
Differential Revision: https://reviews.llvm.org/D155919
Advenam Tacet [Mon, 24 Jul 2023 17:57:22 +0000 (19:57 +0200)]
[NFC][libc++] Update comments to reflect changes in ASan
ASan capabilities were extended, but some comments were not updated and describe old behavior. This commit updates outdated comments, which I found.
Mentioned changes are:
- All allocators in containers (`std::vector` and `std::deque`; D146815 D136765) are supported, but it's possible to turn off annotations for a specific allocator (D145628).
- Buffers don't have to be aligned (D132522).
Reviewed By: #libc, philnik
Differential Revision: https://reviews.llvm.org/D156155
Joseph Huber [Mon, 24 Jul 2023 18:25:53 +0000 (13:25 -0500)]
[OpenMP] Add a few release notes
Summary:
Release notes
Reid Kleckner [Mon, 24 Jul 2023 17:17:35 +0000 (10:17 -0700)]
Add Adrian and David as owners for debug info
Reviewed By: aprantl, probinson
Differential Revision: https://reviews.llvm.org/D156143
Kelvin Li [Tue, 11 Jul 2023 03:13:34 +0000 (23:13 -0400)]
[flang] Add PowerPC vec_abs, vec_nmadd, vec_msub and vec_sel intrinsics
Co-authored-by: Paul Scoropan <1paulscoropan@gmail.com>
Differential Revision: https://reviews.llvm.org/D154985
Michael Maitland [Sat, 22 Jul 2023 21:02:23 +0000 (14:02 -0700)]
[LAA] Make MaxSafeDepDistBytes private in LoopAccessAnalysis. NFC
Any users of LoopAccessAnalysis should use MaxSafeVectorWidthInBits.
Differential Revision: https://reviews.llvm.org/D156034
Paul Robinson [Fri, 21 Jul 2023 20:34:41 +0000 (13:34 -0700)]
[DWARF] Make sure file entry for artificial functions has an MD5 checksum
The DIFile cache was keyed on a string pointer instead of string content,
which was causing misses and resulted in an entry without a checksum.
In DWARF v5 if any checksum is missing, we can't write any to the output
file, so this had consequences.
Fixes https://github.com/llvm/llvm-project/issues/63955
Differential revision: https://reviews.llvm.org/D155991
Paul Robinson [Thu, 20 Jul 2023 15:56:39 +0000 (08:56 -0700)]
[Headers][doc] Add misc non-AVX2 intrinsic descriptions
Adds descriptions for adxintrin.h, bmi2intrin.h, clflushoptintrin.h,
clzerointrin.h, rdseedintrin.h, and xsavecintrin.h.
Differential revision: https://reviews.llvm.org/D155859
Alex Langford [Tue, 18 Jul 2023 22:36:15 +0000 (15:36 -0700)]
[lldb][NFCI] Add some missing SB class forward declarations
I noticed these were missing.
Differential Revision: https://reviews.llvm.org/D155653
Po-yao Chang [Mon, 24 Jul 2023 17:30:23 +0000 (01:30 +0800)]
[Clang] Reject programs declaring namespace std to be inline
Fixes #64041
Differential Revision: https://reviews.llvm.org/D156063
Mehdi Amini [Mon, 24 Jul 2023 17:20:02 +0000 (10:20 -0700)]
Revert "[mlir][gpu] Fallback to JIT compilation" "[mlir][gpu] Increase default SM version from 35 to 50" and "[mlir][gpu] Improving Cubin Serialization with ptxas Compiler"
This reverts commit
2e0e00ed841951e358a85a871647be9b3a622f51
and reverts commit
a6eb40692c795a9cc29266779ceca2e304141114
and reverts commit
585cbe3f639783bf0307b47504acbd205f135310.
15 tests are broken on the mlir-nvidia buildbot:
'cuModuleLoadData(&module, data)' failed with 'CUDA_ERROR_INVALID_SOURCE'
'cuModuleGetFunction(&function, module, name)' failed with 'CUDA_ERROR_INVALID_HANDLE'
'cuLaunchKernel(function, gridX, gridY, gridZ, blockX, blockY, blockZ, smem, stream, params, extra)' failed with 'CUDA_ERROR_INVALID_HANDLE'
'cuModuleUnload(module)' failed with 'CUDA_ERROR_INVALID_HANDLE'
Benjamin Kramer [Mon, 24 Jul 2023 17:21:18 +0000 (19:21 +0200)]
Benjamin Kramer [Mon, 24 Jul 2023 17:15:26 +0000 (19:15 +0200)]
[bazel] Turn off layering_check for //llvm/unittests:target_aarch64_tests
llvm/unittests/Target/AArch64/AArch64SVESchedPseudoTest.cpp:38:10: error: module @llvm-project//llvm/unittests:target_aarch64_tests does not depend on a module exporting 'AArch64GenInstrInfo.inc'
Test was added in
57329ca94630742ce3b0f6b239b263d757a9eb4a
Slava Zakharin [Mon, 24 Jul 2023 16:22:38 +0000 (09:22 -0700)]
[flang][hlfir] Fixed KindMapping for HLFIR intrinsics lowering.
hlfir.count lowering was using incorrect default integer kind
by ignoring the kind specified in the ModuleOp.
Reviewed By: tblah
Differential Revision: https://reviews.llvm.org/D156017
Slava Zakharin [Mon, 24 Jul 2023 16:22:13 +0000 (09:22 -0700)]
[flang][hlfir] Inherit constant length for the result of hlfir.transpose.
Character length may be unknown for the type of Fortran::evaluate::FunctionRef
expression, but we can try to propagate it from the argument of
TRANSPOSE if it is known constant. Alternatively, we could relax
hlfir.transpose verification (i.e. allow character types mismatch
for the argument and the result).
Depends on D155912
Reviewed By: tblah
Differential Revision: https://reviews.llvm.org/D155913
Fangrui Song [Mon, 24 Jul 2023 17:05:34 +0000 (10:05 -0700)]
[Driver][test] Clean up some xray tests
Add explicit --target= so that the tests run on all targets, not some
that support XRay, similar to commit
e1051414a16e970c2e36c2ab7dfe2b17353c4751.
For option testing, we often use a placeholder architecture (e.g., x86_64).
Fix https://github.com/llvm/llvm-project/issues/64028
Piotr Zegar [Mon, 24 Jul 2023 16:53:11 +0000 (16:53 +0000)]
[clang-tidy][NFC] Improve release notes
Fix formating, merge few entrys.
LLVM GN Syncbot [Mon, 24 Jul 2023 16:49:12 +0000 (16:49 +0000)]
[gn build] Port
7c36b416b6b1
Fangrui Song [Mon, 24 Jul 2023 16:47:49 +0000 (09:47 -0700)]
[SLP] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D154891
Ivan Butygin [Fri, 21 Jul 2023 12:16:41 +0000 (14:16 +0200)]
[mlir] Convert `ub.poison` to `llvm.poison`
Differential Revision: https://reviews.llvm.org/D155945
Podchishchaeva, Mariya [Mon, 24 Jul 2023 16:28:09 +0000 (09:28 -0700)]
[clang] Fix specialization of non-templated member classes of class templates
Explicit specialization doesn't increase depth of template parameters,
so need to be careful when gathering template parameters for
instantiation.
For the case:
```
template<typename T>
struct X {
struct impl;
};
template <>
struct X<int>::impl {
template<int ct>
int f() { return ct; };
};
```
instantiation of `f` used to crash because type template parameter
`int` of explicit specialization was taken into account, but non-type
template parameter `ct` had zero depth and index so wrong parameter
ended up inside of a wrong handler.
Fixes https://github.com/llvm/llvm-project/issues/61159
Reviewed By: aaron.ballman, shafik
Differential Revision: https://reviews.llvm.org/D155705
Valentin Clement [Mon, 24 Jul 2023 16:34:00 +0000 (09:34 -0700)]
[flang][openacc] Keep original array size in reduction init region with slice
Keep the original array size when materializing the private copy.
Depends on D155882
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D155893
Valentin Clement [Mon, 24 Jul 2023 16:33:09 +0000 (09:33 -0700)]
[flang][openacc] Update materialization recipe for private copy in reduction init region
Update the code generated in the init region to materialize the private
copy.
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D155882
Alexey Bataev [Mon, 10 Jul 2023 20:49:26 +0000 (13:49 -0700)]
[SLP]Check scalars before trying scheduling.
Need to check the scalars if they can be vectorized before trying to
schedule them. It may save compile time and improve vectorization on
large functions/basic blocks.
Differential Revision: https://reviews.llvm.org/D154891
Owen Pan [Sun, 23 Jul 2023 20:45:22 +0000 (13:45 -0700)]
[clang-format] Insert namespace comments with leading spaces
Insert missing namespace comments with SpacesBeforeTrailingComments
leading spaces.
Fixes #64051.
Differential Revision: https://reviews.llvm.org/D156065
Matt Arsenault [Tue, 27 Jun 2023 14:16:23 +0000 (10:16 -0400)]
RegisterCoaleser: Fix empty subrange verifier error
In this example an implicit def had live-out undef subrange
defs. After coalescing with the def from a previous block, the
undef-defed lanes are no longer live out of the block in the new
interval. An empty subrange was tenatively created for these lanes,
but it must be deleted.
Matt Arsenault [Wed, 21 Jun 2023 12:36:22 +0000 (08:36 -0400)]
RegisterCoalescer: Fix verifier error on redef of subregister for live out implicit_defs
A live out implicit_def wasn't deleted, but the subranges weren't
correctly updated. The main range was correct but the def
corresponding to the initial main range def instruction was missing
from the lanes redefined in another block.
The written lanes are not quite the same as the valid lanes in the
case of an implicit_def.
Fixes verifier error in blender. There is an additional verifier in
some of the testcase variants where an empty subrange remains.
Corentin Jabot [Mon, 10 Jul 2023 06:54:15 +0000 (08:54 +0200)]
[Clang] Fix consteval propagation for aggregates and defaulted constructors
This patch does a few things:
* Fix aggregate initialization.
When an aggregate has an initializer that is immediate-escalating,
the context in which it is used automatically becomes an immediate function.
The wording does that by rpretending an aggregate initialization is itself
an invocation which is not really how clang works, so my previous attempt
was... wrong.
* Fix initialization of defaulted constructors with immediate escalating
default member initializers.
The wording was silent about that case and I did not handled it fully
https://cplusplus.github.io/CWG/issues/2760.html
* Fix diagnostics
In some cases clang would produce additional and unhelpful
diagnostics by listing the invalid references to consteval
function that appear in immediate escalating functions
Fixes https://github.com/llvm/llvm-project/issues/63742
Reviewed By: aaron.ballman, #clang-language-wg, Fznamznon
Differential Revision: https://reviews.llvm.org/D155175
Lang Hames [Mon, 24 Jul 2023 00:56:49 +0000 (17:56 -0700)]
[llvm-jitlink] Don't return immediately in -noexec mode, just skip execution.
Skipping execution rather than bailing out early means that:
1. Explicit teardown of JIT'd code will happen at the same point (via the call
to ExecutionSession::endSession) regardless of whether -noexec is used.
2. The -show-times option will work with -noexec.
Lang Hames [Thu, 20 Jul 2023 16:32:38 +0000 (09:32 -0700)]
[llvm-jitlink] Move statistics code into a separate file.
Further isolates statistics gathering / reporting code from the rest of llvm-jitlink.
Craig Topper [Mon, 24 Jul 2023 16:05:43 +0000 (09:05 -0700)]
[RISCV] Remove combineCmpOp and associated code. NFCI
This code was originally added in D134277. This transform is now
available in target independent DAG combine after D153502.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D156075
Alex Bradbury [Mon, 24 Jul 2023 15:58:21 +0000 (16:58 +0100)]
Revert "[clang][RISCV] Fix ABI handling of empty structs with hard FP calling conventions in C++"
This reverts commit
17a58b3ca7ec18585e9ea8ed8b39d72fe36fb6cb and the
minor documentation fix
569e99a471f618b7fdf045d5e96f21d3e3a7f898.
An issue was reported in https://reviews.llvm.org/D142327#inline-1510301
so reverting until it can be investigated and fixed.
Matt Arsenault [Sun, 2 Jul 2023 00:28:48 +0000 (20:28 -0400)]
AMDGPU: Implement combineRepeatedFPDivisors
Yuanqiang Liu [Mon, 24 Jul 2023 15:00:34 +0000 (17:00 +0200)]
[NVPTX] Expand select_cc on bfloat16 type
Expand select_cc on bfloat16 and bfloat16v2 type.
Differential Revision: https://reviews.llvm.org/D156085
Nikita Popov [Mon, 24 Jul 2023 14:57:57 +0000 (16:57 +0200)]
[ConstantFolding] Avoid use of ConstantExpr::getOr() (NFC)
Constant folding cannot fail here, because we're really working
on plain integers. It might be better to make all of this work
on APInts instead of Constants.
Sander de Smalen [Mon, 24 Jul 2023 14:47:19 +0000 (14:47 +0000)]
[AArch64] Ignore instructions not supported by CPU in AArch64SVESchedPseudoTest
When adding new Pseudos for instructions that are not supported
by the CPU for which the scheduler model is being tested, the test fails
if these pseudos are not covered by the regex's in the scheduling model.
Rather than failing, this test should check that the CPU supports the
original instruction modelled by the pseudo. If not, the pseudo is
not relevant to the scheduling model being tested.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D156094
Nikita Popov [Mon, 24 Jul 2023 14:45:32 +0000 (16:45 +0200)]
[InstCombine] Avoid uses of ConstantExpr::getOr()
Replace these with IRBuilder uses, as we don't (from a type
perspective) care about Constant results.
Switch the predicate to m_ImmConstant() instead of isa<Constant>
to guarantee that these do get folded away and our assumptions
about simplifications hold true.
Craig Topper [Mon, 24 Jul 2023 14:43:01 +0000 (07:43 -0700)]
[RISCV] Add CZERO_EQZ/CZERO_NEZ to ComputeNumSignBitsForTargetNode.
Reviewed By: wangpc
Differential Revision: https://reviews.llvm.org/D156082
Craig Topper [Mon, 24 Jul 2023 14:42:45 +0000 (07:42 -0700)]
[RISCV] Add test case for D156082 to condops.ll
This test is copied from select-cc.ll. It wasn't worth adding
Zicond RUN lines to that file.
Reviewed By: asb, wangpc
Differential Revision: https://reviews.llvm.org/D156083
Craig Topper [Mon, 24 Jul 2023 14:18:22 +0000 (07:18 -0700)]
[RISCV] Add CZERO_EQZ/CZERO_NEZ to computeKnownBitsForTargetNode.
Reviewed By: wangpc
Differential Revision: https://reviews.llvm.org/D156081
Sander de Smalen [Mon, 24 Jul 2023 13:57:12 +0000 (13:57 +0000)]
[Clang][AArch64] svldr_vnum/svstr_vnum should use cntsb iso vscale for the offset
The specification for LDR/STR says that:
The ZA array vector is selected by the sum of the vector select register
and immediate offset, modulo the number of bytes in a Streaming SVE
vector. [..] This instruction does not require the PE to be in Streaming
SVE mode
When the instruction is used outside of streaming mode, 'vscale' will result
in the wrong value being used for the offset because LLVM's code-generator
will emit the non-streaming 'RDVL/ADDVL' instead of the 'RDSVL/ADDSVL'
instructions which are used to get the Streaming-SVE vector length.
Reviewed By: bryanpkc
Differential Revision: https://reviews.llvm.org/D156121
Lorenzo Chelini [Mon, 24 Jul 2023 09:01:36 +0000 (11:01 +0200)]
[MLIR][Linalg] Move AggregatedOpInterface in linalg namespace (NFC)
For now, the interface is specific to linalg only.
Reviewed By: qcolombet
Differential Revision: https://reviews.llvm.org/D156091
Pravin Jagtap [Mon, 24 Jul 2023 14:19:36 +0000 (10:19 -0400)]
[AMDGPU] Fix llvm.amdgcn.wave.reduce.umax/umin MIR tests
Fixes the MIR tests reported in https://lab.llvm.org/buildbot/#/builders/16/builds/51955
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D156125
Simon Pilgrim [Mon, 24 Jul 2023 14:11:15 +0000 (15:11 +0100)]
[X86] fpclamptosat.ll - add nounwind to get rid of cfi noise
Helps cleanup D150372
Quinn Dawkins [Sun, 23 Jul 2023 21:02:14 +0000 (17:02 -0400)]
[mlir][Transform] Allow printing inside matchers
Enables printf style debugging of matchers through `transform.print`
within the body of a matcher.
Differential Revision: https://reviews.llvm.org/D156078
David Green [Mon, 24 Jul 2023 13:55:38 +0000 (14:55 +0100)]
[AArch64] Add vselect(fmin/fmax) SVE patterns
For both minnum/maxnum and minimum/maximum, this adds tablegen patterns for
vselect(fmin/fmax), creating a predicate fminnm/fmaxnm/fmin/fmax nodes.
Differential Revision: https://reviews.llvm.org/D155872
David Green [Fri, 21 Jul 2023 07:50:27 +0000 (08:50 +0100)]
[AArch64] Extra testing for vselect(fmin/max patterns. NFC
See D155872.
Simon Pilgrim [Mon, 24 Jul 2023 13:50:10 +0000 (14:50 +0100)]
[X86] combineConcatVectorOps - add concat(ctpop)/concat(ctlz)/concat(cttz) handling
Simon Pilgrim [Mon, 24 Jul 2023 13:41:26 +0000 (14:41 +0100)]
[X86] Add some basic concat(ctpop)/concat(ctlz)/concat(cttz) widening tests
Zain Jaffal [Mon, 24 Jul 2023 13:46:48 +0000 (14:46 +0100)]
[Remark] Overload `<<` for Remark, RemarkType and RemarkLocation.
Represent different remark concepts as strings by overloading the `<<`
operator.
Reviewed By: thegameg
Differential Revision: https://reviews.llvm.org/D155058
Jie Fu [Mon, 24 Jul 2023 13:35:52 +0000 (21:35 +0800)]
[clang][dataflow] Fix build failure due to -Wunused-variable in DataflowEnvironment.cpp (NFC)
/data/llvm-project/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:125:11: error: unused variable 'StructVal2' [-Werror,-Wunused-variable]
auto *StructVal2 = cast<StructValue>(&Val2);
^
1 error generated.
Joseph Huber [Mon, 24 Jul 2023 13:28:16 +0000 (08:28 -0500)]
[OpenMP] Make the nested parallelism global hidden
Summary:
These will probably be removed with the kernel environment, but they
should have hidden visibliity so they can be optimized out.
pvanhout [Mon, 24 Jul 2023 13:18:06 +0000 (15:18 +0200)]
[GlobalISel] Fix GIM_CheckIsSameOperandIgnoreCopies
If the MI had more than one def it incorrectly returrned true.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D156119
David Spickett [Mon, 24 Jul 2023 13:23:30 +0000 (13:23 +0000)]
[lldb] Remove Windows XFAIL for TestDollarInVariable.py
Since
5d66f9fd8e97c05a5dba317d3ad2566e61ead1ff this test has
been upassing on Linaro's Windows on Arm lldb bot:
https://lab.llvm.org/buildbot/#/builders/219/builds/4320
I can't explain exactly how that happened, but I do see a bunch
of QEnvironment packets going by in that test. It is very likely
that the order would have been different on Windows.
Indeed, when it was xfailed back in
df9051e7cfda5519f4584cda22e9ef2006517e94
the reason was not known either.
Martin Braenne [Thu, 20 Jul 2023 11:12:58 +0000 (11:12 +0000)]
[clang][dataflow] Remove checks that test for consistency between `StructValue` and `AggregateStorageLocation`.
Now that the redundancy between these two classes has been eliminated, these
checks aren't needed any more.
Reviewed By: ymandel, xazax.hun
Differential Revision: https://reviews.llvm.org/D155813
Martin Braenne [Thu, 20 Jul 2023 11:12:39 +0000 (11:12 +0000)]
[clang][dataflow] Eliminate duplication between `AggregateStorageLocation` and `StructValue`.
After this change, `StructValue` is just a wrapper for an `AggregateStorageLocation`. For the wider context, see https://discourse.llvm.org/t/70086.
## How to review
- Start by looking at the comments added / changed in Value.h, StorageLocation.h,
and DataflowEnvironment.h. This will give you a good overview of the semantic
changes.
- Look at the corresponding .cpp files that implement the semantic changes.
- Transfer.cpp, TypeErasedDataflowAnalysis.cpp, and RecordOps.cpp show how the
core of the framework is affected by the semantic changes.
- UncheckedOptionalAccessModel.cpp shows how this complex model is affected by
the changes.
- Many of the changes in the rest of the patch are mechanical in nature.
Reviewed By: ymandel, xazax.hun
Differential Revision: https://reviews.llvm.org/D155446
Florian Hahn [Mon, 24 Jul 2023 13:17:17 +0000 (15:17 +0200)]
[LAA] Add assertion to check both Start and End are invariant (NFC).
Add extra assert to check invariant of RuntimePointerChecking::insert to
guard against subtle changes when extending the scope of LAA.
Guray Ozen [Thu, 20 Jul 2023 15:28:51 +0000 (17:28 +0200)]
[llvm][nvptx] Add sm_90a
This works adds `sm_90a` as nvptx target. `sm_90a` is required to generate wgmma and setmaxnreg instructions.
Here is information about "a" prefix in PTX document:
Target architectures with suffix “a”, such as sm_90a, include architecture-accelerated features that are supported on the specified architecture only, hence such targets do not follow the onion layer model. Therefore, PTX code generated for such targets cannot be run on later generation devices. Architecture-accelerated features can only be used with targets that support these features.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D155851
Guray Ozen [Mon, 24 Jul 2023 10:51:22 +0000 (12:51 +0200)]
[mlir][gpu] Increase default SM version from 35 to 50
Current SM version is 35 but it is deprecated long time ago. D155563 introduced ptxas compilations, using sm_35 causes failures in builtbot. This change increase default SM version to 50.
Differential Revision: https://reviews.llvm.org/D156098
Guray Ozen [Mon, 24 Jul 2023 10:45:04 +0000 (12:45 +0200)]
[mlir][gpu] Fallback to JIT compilation
Recent change introduces compilation with ptxas compiler. The change is important to be able to different versions of ptxas compiler without changing the compiler.
It causes some failures in builtbot. This change adds fallback mechanism to JIt compilation that is original path.
Differential Revision: https://reviews.llvm.org/D156096
Tony Tao [Mon, 24 Jul 2023 13:02:59 +0000 (09:02 -0400)]
[SystemZ][z/OS] Add OpenFlags to CreateMissingDirectories path when creating temp files
Additional patch to https://reviews.llvm.org/D103806 to add the same flags in the path where the CreateMissingDirectories booleans is set to true.
Reviewed By: abhina.sreeskantharajan
Differential Revision: https://reviews.llvm.org/D155651
Simon Pilgrim [Mon, 24 Jul 2023 12:49:45 +0000 (13:49 +0100)]
[X86] combineConcatVectorOps - add basic concat(unpack(x,y),unpack(z,w)) -> unpack(concat(x,z),concat(y,w)) handling
Very limited support as we don't want to interfere with build_vector patterns
Podchishchaeva, Mariya [Mon, 24 Jul 2023 12:31:47 +0000 (05:31 -0700)]
[NFC][clang] Fix static analyzer concerns
HeaderIncludesCallback and HeaderIncludesJSONCallback classes may own
resources and free them in the destructor. However they don't have copy
user-written constructors/assignment operators, so an attempt to copy a
HeaderIncludesCallback object will use compiler-generated copy
constructor which will only do dummy copy and afterwards there will be
use-after-free issues.
Reviewed By: aaron.ballman, tahonermann
Differential Revision: https://reviews.llvm.org/D155842
John Brawn [Mon, 24 Jul 2023 12:29:22 +0000 (13:29 +0100)]
Revert "[Sema] Fix handling of functions that hide classes"
This reverts commit
dfca88341794eec88c5009a93c569172fff62635.
Causes clang/test/Modules/stress1.cpp to fail.
Podchishchaeva, Mariya [Mon, 24 Jul 2023 12:15:40 +0000 (05:15 -0700)]
[NFC][clang] Fix static analyzer concerns
OMPTransformDirectiveScopeRAII doesn't have user-written copy
constructor/assignment operator but it frees memory in the destructor.
Delete these members since doesn't seem that OMPTransformDirectiveScopeRAII
objects are intended for copy.
Reviewed By: tahonermann, ABataev
Differential Revision: https://reviews.llvm.org/D155849
John Brawn [Wed, 28 Jun 2023 09:31:38 +0000 (10:31 +0100)]
[Sema] Fix handling of functions that hide classes
When a function is declared in the same scope as a class with the same
name then the function hides that class. Currently this is done by a
single check after the main loop in LookupResult::resolveKind, but
this can give the wrong result when we have a using declaration in
multiple namespace scopes in two different ways:
* When the using declaration is hidden in one namespace but not the
other we can end up considering only the hidden one when deciding
if the result is ambiguous, causing an incorrect "not ambiguous"
result.
* When two classes with the same name in different namespace scopes
are both hidden by using declarations this can result in
incorrectly deciding the result is ambiguous. There's currently a
comment saying this is expected, but I don't think that's correct.
Solve this by checking each Decl to see if it's hidden by some other
Decl in the same scope. This means we have to delay removing anything
from Decls until after the main loop, in case a Decl is hidden by
another that is removed due to being non-unique.
Differential Revision: https://reviews.llvm.org/D154503
Sander de Smalen [Fri, 14 Jul 2023 08:45:10 +0000 (09:45 +0100)]
[AArch64] NFC: Move fadda tests to separate file.
We want to test the fadda tests with 'streaming-compatible' flags,
such that we can ensure no 'fadda' (not valid in streaming mode) is
generated.
Sander de Smalen [Thu, 13 Jul 2023 09:45:22 +0000 (10:45 +0100)]
[AArch64][SME] NFC: Pass target feature on RUN line, instead of function attribute.
This is anticipating adding new RUN lines testing for +sme, alongside +sve/+sve2.
Joseph Huber [Sat, 22 Jul 2023 02:30:36 +0000 (21:30 -0500)]
[NVPTX] Fix lack of `.noreturn` on certain functions for aliases
Forgot to include this special handling on the declaration of the alias
function.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D156012
Aaron Ballman [Mon, 24 Jul 2023 11:32:48 +0000 (07:32 -0400)]
Fix the Clang sphinx build
This addresses issues found by:
https://lab.llvm.org/buildbot/#/builders/92/builds/47783