Commit Graph

417632 Commits

Author SHA1 Message Date
Jon Chesterfield 75779435f3 [nfc][openmp] Swap arguments to remove noise from upcoming diff 2022-03-11 23:08:37 +00:00
Anna Thomas a4aa97d578 [InlineCost] Add cl::opt for target attributes compatibility check. NFC
This patch adds a CL option for avoiding the attribute compatibility
check between caller and callee in TTI. TTI attribute compatibility
checks for target CPU and target features.
In our downstream compiler, this attribute always remains the same
between callee and caller. By avoiding the addition of this attribute to
each of our inline candidate (and then checking them here during inline
cost), we save some compile time.

The option is kept false, so this change is an NFC upstream.
2022-03-11 18:05:16 -05:00
Julian Lettner 46626bc873 [NFC] Improve comment and rename test file 2022-03-11 14:47:54 -08:00
Johannes Doerfert e92891f864 [Attributor] Allow not to default initialize AAs for live internal functions
Outside users of the Attributor, e.g., OpenMP-opt, want to seed AAs
themselves. We should not seed all default AAs one an internal function
becomes live. That said, there should be a callback such that they can
do lazy seeding as well.

Differential Revision: https://reviews.llvm.org/D121489
2022-03-11 16:46:03 -06:00
Johannes Doerfert f3ad8cf00e [Attributor] Cleanup manifest and liveness for CGSCC passes
There was some ad-hoc handling of liveness and manifest to avoid
breaking CGSCC guarantees. Things always slipped through though.
This cleanup will:

1) Prevent us from manifesting any "information" outside the CGSCC.
   This might be too conservative but we need to opt-in to annotation
   not try to avoid some problematic ones.
2) Avoid running any liveness analysis outside the CGSCC. We did have
   some AAIsDeadFunction handling to this end but we need this for all
   AAIsDead classes. The reason is that AAIsDead information is only
   correct if we actually manifest it, since we don't (see point 1) we
   cannot actually derive/use it at all. We are currently trying to
   avoid running any AA updates outside the CGSCC but that seems to
   impact things quite a bit.
3) Assert, don't check, that our modifications (during cleanup) modifies
   only CGSCC functions.
2022-03-11 16:46:02 -06:00
Fangrui Song 6ca22623c9 [MC][test] Improve compression.s
* Actually test compressed .debug_line for 32-bit
* Test .debug_frame can be compressed
* Test a section not named .debug_* is not compressed
2022-03-11 14:42:07 -08:00
owenca 9f616a467f [clang-format][NFC] Group QualifierAlignment with other C++ passes
Also increases the initial size of Passes to 8 and move the
definition of BracesInserter up.

Differential Revision: https://reviews.llvm.org/D121434
2022-03-11 14:18:00 -08:00
Richard 602ea53cb7 [clang-tidy] Refactor: Prefer single quoted strings over double quoted strings [NFC] 2022-03-11 15:08:24 -07:00
Fangrui Song a7ac200fd0 [MC] Remove unneeded zlib opt-out for .debug_frame
The opt-out from rL236267 (2015) is untested and seems no longer needed (or not
needed when rL236267 was committed): there is nothing special with uncompressed
alignment. This brings us in line with GCC which compresses .debug_frame .

Checked that -g -fno-asynchronous-unwind-tables + objcopy
--decompress-debug-sections output is identical to -g
-fno-asynchronous-unwind-tables -gz + objcopy --decompress-debug-sections
output.
2022-03-11 13:32:24 -08:00
Dave Lee 94bda3aaa1 [lldb] Removed scoped timer from ReadMemoryFromFileCache
`ReadMemoryFromFileCache` can be called at a high rate, and has fast execution.
Signposts for high rate & brief duration can have a negative impact on tracing;
emitting a high volume signposts can lead to blocking, affecting performance,
and total volume makes human review of the trace harder because of the noise.

Differential Revision: https://reviews.llvm.org/D121226
2022-03-11 12:46:38 -08:00
Dave Lee 3ca91adef8 [lldb] Move FindTypes scoped timer to SymbolFileDWARFDebugMap 2022-03-11 12:40:06 -08:00
Jonas Devlieghere a6eeffa106
[lldb] Include lldb/Host/HostInfo.h in ProcessWindows.cpp 2022-03-11 12:34:41 -08:00
Stanislav Mekhanoshin 31f215ab0c [AMDGPU] Support v_mov_b64 in dpp combine
Differential Revision: https://reviews.llvm.org/D121411
2022-03-11 11:37:32 -08:00
Stanislav Mekhanoshin 6181458662 [AMDGPU] gfx940 MUBUF format changes
Differential Revision: https://reviews.llvm.org/D121234
2022-03-11 11:36:49 -08:00
Jonas Devlieghere 530bc61901
[lldb] Fix typo in ProcessWindows.h 2022-03-11 11:33:16 -08:00
Ivan Butygin 4df9544108 [mlir][spirv] Make EntryPointABIAttr.local_size optional
* It doesn't required by OpenCL/Intel Level Zero and can be set programmatically.
* Add GPU to spirv lowering in case when attribute is not present.
* Set higher benefit to WorkGroupSizeConversion pattern so it will always try to lower first from the attribute.

Differential Revision: https://reviews.llvm.org/D120399
2022-03-11 22:25:23 +03:00
Fangrui Song bd0bddc1ea [CommandLine] Remove `may only occur zero or one times!` error
Early adoption of new technologies or adjusting certain code generation/IR optimization thresholds
is often available through some cl::opt options (which have unstable surfaces).
Specifying such an option twice will lead to an error.

```
% clang -c a.c -mllvm -disable-binop-extract-shuffle -mllvm -disable-binop-extract-shuffle
clang (LLVM option parsing): for the --disable-binop-extract-shuffle option: may only occur zero or one times!
% clang -c a.c -mllvm -hwasan-instrument-reads=0 -mllvm -hwasan-instrument-reads=0
clang (LLVM option parsing): for the --hwasan-instrument-reads option: may only occur zero or one times!
% clang -c a.c -mllvm --scalar-evolution-max-arith-depth=32 -mllvm --scalar-evolution-max-arith-depth=16
clang (LLVM option parsing): for the --scalar-evolution-max-arith-depth option: may only occur zero or one times!
```

The option is specified twice, because there is sometimes a global setting and
a specific file or project may need to override (or duplicately specify) the
value.

The error is contrary to the common practice of getopt/getopt_long command line
utilities that let the last option win and the `getLastArg` behavior used by
Clang driver options. I have seen such errors for several times. I think the
error just makes users inconvenient, while providing very little value on
discouraging production usage of unstable surfaces (this goal is itself
controversial, because developers might not want to commit to a stable surface
too early, or there is just some subtle codegen toggle which is infeasible to
have a driver option). Therefore, I suggest we drop the diagnostic, at least
before the diagnostic gets sufficiently better support for the overridding needs.

Removing the error is a degraded error checking experience. I think this error
checking behavior, if desirable, should be enabled explicitly by tools. Users
preferring the behavior can figure out a way to do so.

Reviewed By: jhenderson, rnk

Differential Revision: https://reviews.llvm.org/D120455
2022-03-11 11:25:04 -08:00
Jonas Devlieghere 68099b1d5c
[lldb] Add a getter for the process' system architecture
This patch adds a getter for the process' system architecture. I went
with Process::GetSystemArchitecture to match
Platform::GetSystemArchitecture.

Differential revision: https://reviews.llvm.org/D121443
2022-03-11 10:58:04 -08:00
Jez Ng 9b7b21d2f7 [lld-macho] Don't allocate memory in parallelForEach
... since BumpPtrAllocator isn't thread-safe.

Reviewed By: #lld-macho, Roger

Differential Revision: https://reviews.llvm.org/D121458
2022-03-11 13:32:24 -05:00
Ivan Butygin f3676c3273 [mlir][memref] memref.reinterpret_cast folding
* reinterpret_cast(reinterpret_cast(x)) -> reinterpret_cast(x)
* reinterpret_cast(cast(x)) -> reinterpret_cast(x)
* reinterpret_cast(subview(x)) -> reinterpret_cast(x) if subview offsets are 0

Differential Revision: https://reviews.llvm.org/D120242
2022-03-11 21:22:43 +03:00
Benjamin Kramer dbc32e2aa7 [LoopUnswitch] Use SmallPtrSet instead of std::set. NFCI. 2022-03-11 19:14:34 +01:00
Florian Hahn d3e1094473
[VPlan] Implement VPCanonicalIVPHIRecipe::onlyFirstLaneUsed.
The recipe only uses the first lane of its operands.

Suggested & split off D120827.
2022-03-11 18:07:26 +00:00
Craig Topper d0969e485c [RISCV] Optimize vfmv.s.f intrinsic with scalar 0.0 to vmv.s.x with x0.
We already do this for RISCVISD::VFMV_S_F_VL and the vfmv.v.f
intrinsic.

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D121429
2022-03-11 10:05:43 -08:00
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