Commit Graph

417659 Commits

Author SHA1 Message Date
Jean Perier f2da8f5e4f [flang][NFC] rename IsKindParameterizedDerivedType and fix comment typos
Following post-review feedback on https://reviews.llvm.org/D120804 and
https://reviews.llvm.org/D120801 about type descriptor changes, fix typos in
comments and rename IsKindParameterizedDerivedType to
IsDerivedTypeWithKindParameter. Remove a useless `;`.

Reviewed By: clementval, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121470
2022-03-11 19:03:27 +01:00
Greg Clayton 0bc845fe24 Return an error when dsymutil might produce an invalid mach-o file.
64 bit mach-o files have sections that only have 32 bit file offsets. If dsymutil tries to produce an invalid mach-o file, then error out with a good error string.

Differential Revision: https://reviews.llvm.org/D121398
2022-03-11 10:00:39 -08:00
Valentin Clement 179ea3559d
[flang] Add tests for allocatable global
This patch adds couple of tests for allocatable
globals and missing lowering for them

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121473

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-11 18:40:17 +01:00
Valentin Clement 80f8c6dd16
[flang] Lower of elemental calls in array expression
This patch adds tests and missing lowering
code to lower elemental function/subroutine calls
in array expression

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121474

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-11 18:39:06 +01:00
Akira Hatanaka aa4ea0ee54 [NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in a couple
more files

Differential Revision: https://reviews.llvm.org/D121135
2022-03-11 09:30:31 -08:00
Jonas Devlieghere 4ef07e5ffe
[lldb] Don't overwrite the host arch with the process arch
Don't overwrite the host architecture (obtained from qHostInfo) with the
process info (obtained from qProcessInfo).

Differential revision: https://reviews.llvm.org/D121442
2022-03-11 09:23:01 -08:00
Kirill Stoimenov d477f1bb15 [ASan] Export optimized callbacks.
This is a part of optimized callback reverts. This is needed to export the callbacks from the rt-asan libraries.

Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D121464
2022-03-11 17:18:40 +00:00
Simon Pilgrim 1a4148666a [X86] Add PR38960 comineqss test case
This inverts the flags result compared to the original PR38960 comieqss test case
2022-03-11 16:46:47 +00:00
Nikita Popov 2182665305 [Bitcode] Don't confuse type attributes on declaration and call
We should not be using APIs here that try to fetch the attribute
from both the call attributes and the function attributes. Otherwise
we'll try to upgrade a non-existent sret attribute on the call using
the attribute on the function.
2022-03-11 17:32:40 +01:00
Nikita Popov a803cb9e52 [AsmParser] Check forward reference type with opaque pointers
While we don't need to check the element type in this case, we
do need to make sure that the pointers have the same address space,
otherwise RAUW will assert.
2022-03-11 17:16:34 +01:00
Andrzej Warzynski 85e2731aa3 [flang] Fix DYLIB builds
https://reviews.llvm.org/D120568 broke builds that set
both `LLVM_BUILD_LLVM_DYLIB` and `LLVM_LINK_LLVM_DYLIB`. This patch
fixes that.

The build failure was caused by the fact that some LLVM libraries (which
are also LLVM components) were listed directly as link-time dependencies
instead of using `LINK_COMPONENTS` in CMake files. This lead to a linker
invocation like this (simplified version to demonstrate the problem):
```
ld lib/libLLVM.so lib/libLLVMAnalysis.a lib/libLLVMTarget.a
```
That's problematic and unnecessary because `libLLVM.so` incorporates
`libLLVMAnalysis` and `libLLVMTarget`. A correct invocation would look
like this (`LLVM_LINK_LLVM_DYLIB` _is not_ set):
```
ld  lib/libLLVMAnalysis.a lib/libLLVMTarget.a
```
or this (`LLVM_LINK_LLVM_DYLIB` _is_ set):
```
ld lib/libLLVM.so
```

Differential Revision: https://reviews.llvm.org/D121461
2022-03-11 16:12:36 +00:00
Johannes Doerfert 9ddb1a49ac [Attributor][FIX] Avoid double free (and useless state copy)
In an attempt to remove the memory leak we introduced a double free.
The problem was that we allowed a plain copy of the state and it was
actually used. The use was useless, so it is gone now. The copy
constructor is gone as well. The move constructor ensures the Accesses
pointers are owned by a single state, I hope.

Reported by: https://lab.llvm.org/buildbot/#/builders/16/builds/25820
2022-03-11 10:10:36 -06:00
Bixia Zheng 30c5269d93 [mlir][sparse][taco] Add a few unary operations.
Add operations -, abs, ceil and floor to the index notation.

Add test cases.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D121388
2022-03-11 08:08:55 -08:00
David Truby 058c92f2a4 [clang][SVE] Add aarch64-registered-target to sve vector op tests
This fixes failing tests where aarch64 isn't available.
2022-03-11 16:01:00 +00:00
Johannes Doerfert 3570b0c5c7 [Attributor][FIX] Remove memory leak
The leak was introduced when we made things deterministic. It was
reported by the sanitizer buildbot:
 https://lab.llvm.org/buildbot/#/builders/168
2022-03-11 09:52:44 -06:00
Nikita Popov a0d2b0aa65 [Bitcode] Clarify that extractvalue/insertvalue constexprs are not supported
Bitcode currently cannot encode these. Throw a more obvious error
in this case, rather than failing an operand count assertion.
2022-03-11 16:50:24 +01:00
David Truby 3aca0ffd50 [clang][SVE] Add support for arithmetic operators on SVE types
This patch implements support for the +, -, *, / and % operators on sizeless SVE
types. Support for these operators on svbool_t is excluded.

Differential Revision: https://reviews.llvm.org/D120323
2022-03-11 15:39:44 +00:00
Nikita Popov b7585a08d5 [Bitcode] Enumerate constexpr GEP source element type in initializer
The constexpr source element type was enumerated if the GEP was
used as part of an instruction. However, things like global
initializers go through a different code path, and we need to
enumerate the type there as well.
2022-03-11 16:38:58 +01:00
Balazs Benics 60cb83d549 [analyzer] Fix include typo introduced by e61a1a9 2022-03-11 16:09:25 +01:00
Nikita Popov b190108693 [Bitcode] Encode alloca address space
Since D101045, allocas are no longer required to be part of the
default alloca address space. There may be allocas in multiple
different address spaces. However, the bitcode reader would
simply assume the default alloca address space, resulting in
either an error or incorrect IR.

Add an optional record for allocas which encodes the address
space.
2022-03-11 16:08:38 +01:00
serge-sans-paille e61a1a9849 Conditional include of missing headers under Z3 2022-03-11 15:52:24 +01:00
serge-sans-paille efec6b800f Conditional include of Twine.h under Z3 2022-03-11 15:48:06 +01:00
Benjamin Kramer 3b15a7c042 [BFI] Use SmallPtrSets. NFCI. 2022-03-11 15:20:57 +01:00
Louis Dionne a805a15b28 [libc++] Remove workaround for missing declarations on Windows store apps
We don't need preprocessor logic to exclude those declarations when compiling for
the Windows App Store, because that is handled by using_if_exists now.

Differential Revision: https://reviews.llvm.org/D108632
2022-03-11 09:08:30 -05:00
Louis Dionne 21f73d5826 [libc++] Remove workaround for C11 features on compilers that don't support using_if_exists
Instead of carrying around #ifdefs to determine whether those functions
are available on the platform, unconditionally use the using_if_exists
attribute to import it into namespace std only when available. That was
the purpose of this attribute from the start.

This change means that trying to use libc++ with an old SDK (or on an
old platform for platforms that ship system headers in /usr/include)
will require a recent Clang that supports the using_if_exists attribute.
When using an older Clang or GCC, the underlying platform has to support
a C11 standard library.

Differential Revision: https://reviews.llvm.org/D108203
2022-03-11 09:06:43 -05:00
Louis Dionne 611469c5c5 [libc++] Remove raw call to debug handler from __char_traits_length_checked
As a fly-by fix, also move it closer to where it is needed, and add a
comment explaining the existence of this weird function.

Differential Revision: https://reviews.llvm.org/D121231
2022-03-11 09:05:29 -05:00
Nikita Popov 237df15c08 [Verifier] Check type of swifterror alloca
Per LangRef, swifterror alloca must be a pointer.

Not checking this may result in a verifier error after transforms
instead, so make sure it's discarded early.
2022-03-11 14:52:56 +01:00
Florian Hahn ecea477df3
[VPlan] Helper to check if a recipe uses scalar values of op.
This patch adds a helper to check if a recipe only uses scalars of a
given operand. This is similar to onlyFirstLaneUsed, which was
introduced earlier.

By default, usesScalars falls back on onlyFirstLaneUsed.

Will be used by D120828.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D120827
2022-03-11 13:41:08 +00:00
Nikita Popov 7781f61efa [ConstantFold] Fix scalable shufflevector fold with all-undef mask
If the input is scalable, we should not be returning a fixed-width
vector as a result.
2022-03-11 14:30:02 +01:00
Nikita Popov 853beb55e1 [FuzzMutate] Support scalable shufflevector 2022-03-11 14:20:40 +01:00
Nikita Popov a3aac5693d [IRMutator] Handle module with only declarations
There was a mismatch here, with one check checking whether there
are any functions, and the other collecting only non-declaration
functions.
2022-03-11 14:20:39 +01:00
Nikita Popov 806450805d [ConstFold] Don't fold calls with mismatching function type
With opaque pointers, this is no longer ensured through pointer
type identity.
2022-03-11 14:09:23 +01:00
Tue Ly 38cadd90b7 [libc] Implement expf function that is correctly rounded for all rounding modes.
Implement expf function that is correctly rounded for all rounding modes.

Reviewed By: sivachandra, zimmermann6

Differential Revision: https://reviews.llvm.org/D121440
2022-03-11 07:16:47 -05:00
Marek Kurdej b44eb207e9 [clang-format] Refactor condition in AnnotatingParser::modifyContext(). NFC. 2022-03-11 13:12:43 +01:00
Florian Hahn e07b899192
[FunctionAttrs] Rename addReadAttrs -> addMemoryAttrs.
The addReadAttrs name is out of date, as the function also adds
the writeonly attribute. addMemoryAttrs is more accurate.
2022-03-11 11:49:22 +00:00
Andrzej Warzynski 125a4d915e [flang] Remove deprecated fields from FIROps.td
This patch removes deprecated parser/printer/verifier fields from
FIROps.td. This is a follow-up of https://reviews.llvm.org/D119776 - it
takes care of operations deriving from `fir_IntegralSwitchTerminatorOp`
and `region_Op`.

No new functionality is added, hence no tests. This patch addresses:
https://github.com/llvm/llvm-project/issues/54314.

Differential Revision: https://reviews.llvm.org/D121406

Some changes were extracted from D121090 (by River Riddle).

co-authored-by: River Riddle <riddleriver@gmail.com>
2022-03-11 11:29:20 +00:00
Matt Devereau 6c5da880e0 [AArch64][SVE][Clang] Fix crash for incorrect svptrue and svcnt parameters
Giving an int parameter to SVE intrinsics svptrue and svcnt caused Clang
to crash on compilation. Changing their parameter types to void instead of
omitting args results in a diagnostic error message instead.

Differential Revision: https://reviews.llvm.org/D121294
2022-03-11 11:19:53 +00:00
Nikita Popov cda82d39f3 [Bitcode] Check for type mismatch when assigning value
If the value is forward-declared, then the type must match,
otherwise we can't RAUW.
2022-03-11 12:12:54 +01:00
serge-sans-paille fbbc41f8dd Cleanup include: TableGen
This also includes a few cleanup from Support.

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D121331
2022-03-11 11:41:32 +01:00
Nikita Popov 36be8fabb0 [Bitcode] Delete phi node on error
These error conditions are checked after the phi node has been
created, so we also need to delete it.
2022-03-11 11:37:29 +01:00
Nikita Popov ba3380026a [Bitcode] Improve some error messages
It's not particularly helpful if 95% of our errors just say
"Invalid record". This at least adds the record type to a subset
of errors.
2022-03-11 11:37:29 +01:00
Florian Hahn aa590e5823
[AArch64] Improve costs for some conversions to fp16.
Currently the cost model under-estimates the cost of certain
FP16 conversions.

This patch updates getCastInstrCost to return more accurate costs for
the cases improved in c2ed9fd054.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D113700
2022-03-11 10:27:39 +00:00
Pavel Labath 161bddf3af [ADT] Make BitmaskEnum operations constant expressions
This avoids runtime initialization (a global constructor) whenever they appear
in the initializer.

The patch just adds the constexpr keyword to a couple of functions.

Differential Revision: https://reviews.llvm.org/D121281
2022-03-11 11:11:55 +01:00
David Sherwood aeeb1199b4 [AArch64][SVE] Change the asserts in LowerToPredicatedOp to check for legal types
When building the LLVM test suite with SVE I discovered a crash
when compiling some Halide tests, which occurs because we try to
use SVE to lower 64-bit vector multiplies and there is no
vscale_range attribute on the function. In this case the min SVE
vector bits was 0, which caused an assert in LowerToPredicatedOp
to fire. I have amended the asserts in this function to check that the
fixed-width type is legal. If the fixed-width type is larger than NEON
and is legal then it must be because we've set the min SVE vector
bits to something > 128. Or if the min SVE bits is 0, then the only
legal types allowed are 128 bit types - for any other types the assert
will fire.

Tests added here:

  CodeGen/AArch64/sve-fixed-length-no-vscale-range.ll

Differential Revision: https://reviews.llvm.org/D121297
2022-03-11 09:57:58 +00:00
Nikita Popov 02c2106002 [InstSimplify] Handle vector GEP when simplifying zero indices
If the base is a scalar and the index is a vector, we can't
simplify, as this is effectively a splat operation.
2022-03-11 10:56:44 +01:00
Nikita Popov d7645f4ef8 [Bitcode] Delete instruction on error
As these errors are detected after the instruction has already been
created (but before it has been inserted into the function), we
also need to delete it.
2022-03-11 10:56:43 +01:00
Yun Long 5c3861b277 [MLIR][python binding] Add OpaqueAttribute to python binding.
Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D120847
2022-03-11 10:56:21 +01:00
Vassil Vassilev 788e0f7f3e [clang-repl] Add an accessor to our underlying execution engine
This patch will allow better incremental adoption of these changes in downstream
cling and other users which want to experiment by customizing the execution
engine.
2022-03-11 09:24:47 +00:00
Nikita Popov e732f69ea1 [Bitcode] Report error for missing element type for attr upgrade
Otherwise this is going to crash either the TypeFinder or the
Verifier.
2022-03-11 10:18:42 +01:00
Dmitry Vassiliev dfeb978155 Fixed a roll-over on size_t in getNewUninitMemBuffer()
Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D121399
2022-03-11 13:16:58 +04:00