Commit graph

421667 commits

Author SHA1 Message Date
Fangrui Song f4a3569d0a [ELF] Fix spurious GOT/PLT assertion failure when .dynsym is discarded
Linux kernel arch/arm64/kernel/vmlinux.lds.S discards .dynsym . D123985 triggers
a spurious assertion failure. Detect the case with
`!mainPart->dynSymTab->getParent()`.
2022-04-20 22:49:49 -07:00
River Riddle 0fd3a1ce60 [mlir][NFC] Update remaining textual references of un-namespaced func operations
The special case parsing of operations in the `func` dialect is being removed, and
operations will require the dialect namespace prefix.
2022-04-20 22:17:31 -07:00
River Riddle cda6aa78f8 [mlir][NFC] Update textual references of func to func.func in Transform tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:30 -07:00
River Riddle a4936cb3e8 [mlir][NFC] Update textual references of func to func.func in Pass/Target tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:30 -07:00
River Riddle 63237cddc1 [mlir][NFC] Update textual references of func to func.func in tool/runner tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:30 -07:00
River Riddle 6a99d29022 [mlir][NFC] Update textual references of func to func.func in IR/Interface tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:30 -07:00
River Riddle 87db8e4439 [mlir][NFC] Update textual references of func to func.func in Integration tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:29 -07:00
River Riddle c48e3a13f3 [mlir][NFC] Update textual references of func to func.func in Tensor/Tosa/Vector tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:29 -07:00
River Riddle 2c7836ef15 [mlir][NFC] Update textual references of func to func.func in SPIRV tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:29 -07:00
River Riddle fb35cd3baf [mlir][NFC] Update textual references of func to func.func in SparseTensor tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:29 -07:00
River Riddle 0254b0bcf0 [mlir][NFC] Update textual references of func to func.func in LLVM/Math/MemRef/NVGPU/OpenACC/OpenMP/Quant/SCF/Shape tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:28 -07:00
River Riddle 92d38adb83 [mlir][NFC] Update textual references of func to func.func in Linalg tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:28 -07:00
River Riddle 412b8850f6 [mlir][NFC] Update textual references of func to func.func in Bufferization/Complex/EmitC/CF/Func/GPU tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:28 -07:00
River Riddle 5e7dea225b [mlir][NFC] Update textual references of func to func.func in AMX/Arithmetic/ArmSVE/Async tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:28 -07:00
River Riddle 227ed2f448 [mlir][NFC] Update textual references of func to func.func in Affine/ tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:27 -07:00
River Riddle 3028bf740e [mlir][NFC] Update textual references of func to func.func in Conversion/ tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:27 -07:00
River Riddle ccaabff131 [mlir][NFC] Update textual references of func to func.func in Analysis/ tests
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:27 -07:00
River Riddle 8ae83bb8be [mlir][NFC] Update textual references of func to func.func in ODS documentation
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:26 -07:00
River Riddle 2310ced874 [mlir][NFC] Update textual references of func to func.func in examples+python scripts
The special case parsing of `func` operations is being removed.
2022-04-20 22:17:26 -07:00
Craig Topper 186d5c8af5 [RISCV] Make getInstSeqCost handle other Zb* instructions.
We haven't been updating this as Zb* instructions have been used
for immediate materialization. They will hit the default case and
trigger an llvm_unreachable. Instead of trying to list them all,
assume instructions that aren't explicitly listed aren't compressible.

Spotted while looking at integer materialization for other reasons.
I haven't seen a crash from this yet.
2022-04-20 22:08:04 -07:00
Chuanqi Xu ce2257d69f [C++20] [Modules] Judge current module correctly
Now the implementation would accept following code:
```
//--- impl.cppm
module M:impl;
class A {};

//--- M.cppm
export module M;
import :impl;

//--- Use.cpp
import M;
void test() {
    A a; // Expected error. A is not visible here.
}
```

which is clearly wrong.  The root cause is the implementation of
`isInCurrentModule` would return true if the module is a partition! So
in the above example, although Use.cpp is not a module unit,
`isInCurrentModule ` would still return true when the compiler tries to
see if the owning module of `A` is the current module. I believe this is
an oversight. This patch tries to fix this problem.

Reviewed By: iains

Differential Revision: https://reviews.llvm.org/D123837
2022-04-21 11:09:55 +08:00
Chuanqi Xu 483efc9ad0 [Pipelines] Remove Legacy Passes in Coroutines
The legacy passes are deprecated now and would be removed in near
future. This patch tries to remove legacy passes in coroutines.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D123918
2022-04-21 10:59:11 +08:00
hsmahesha 5bd87350a5 [AMDGPU] On gfx908, reserve VGPR for AGPR copy based on register budget.
Based on available register budget, reserve highest available VGPR for
AGPR copy before RA. After RA, shift it to lowest unused VGPR if the one
exist.

Fixes SWDEV-330006.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D123525
2022-04-21 07:57:26 +05:30
Weining Lu 3a49ad717c [LoongArch] Add basic floating-point instructions definition
These instructions are added by following the `LoongArch Reference
Manual Volume 1: Basic Architecture Version 1.00`.

Differential Revision: https://reviews.llvm.org/D123988
2022-04-21 10:04:20 +08:00
Shraiysh Vaishay 88bb2521b0 [mlir][OpenMP] Add checks and tests for hint clause and fix empty hint
This patch handles empty hint value for critical and atomic constructs.

This also adds checks and tests for hint clause on atomic constructs.

Reviewed By: peixin, kiranchandramohan, NimishMishra

Differential Revision: https://reviews.llvm.org/D123186
2022-04-21 07:31:03 +05:30
hsmahesha 7895c87367 [AMDGPU] Split the lit test spill-vgpr-to-agpr.ll to different tests
[1]. Move the test which reject the usage of agpr before gfx908 into a separate file - reject-agpr-usage-before-gfx908.ll.
[2]. Move those tests which are applicable to both gfx900 and gfx908 into a separate file - spill-vgpr.ll.
[3]. Keep those tests which are specific to only gfx908 in the file spill-vgpr-to-agpr.ll.

Above split is required to properly update the tests in D123525.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D123973
2022-04-21 07:16:58 +05:30
Richard Smith 72315d02c4 Treat std::move, forward, etc. as builtins.
This is extended to all `std::` functions that take a reference to a
value and return a reference (or pointer) to that same value: `move`,
`forward`, `move_if_noexcept`, `as_const`, `addressof`, and the
libstdc++-specific function `__addressof`.

We still require these functions to be declared before they can be used,
but don't instantiate their definitions unless their addresses are
taken. Instead, code generation, constant evaluation, and static
analysis are given direct knowledge of their effect.

This change aims to reduce various costs associated with these functions
-- per-instantiation memory costs, compile time and memory costs due to
creating out-of-line copies and inlining them, code size at -O0, and so
on -- so that they are not substantially more expensive than a cast.
Most of these improvements are very small, but I measured a 3% decrease
in -O0 object file size for a simple C++ source file using the standard
library after this change.

We now automatically infer the `const` and `nothrow` attributes on these
now-builtin functions, in particular meaning that we get a warning for
an unused call to one of these functions.

In C++20 onwards, we disallow taking the addresses of these functions,
per the C++20 "addressable function" rule. In earlier language modes, a
compatibility warning is produced but the address can still be taken.

The same infrastructure is extended to the existing MSVC builtin
`__GetExceptionInfo`, which is now only recognized in namespace `std`
like it always should have been.

This is a re-commit of
  fc30901096,
  a571f82a50,
  64c045e25b, and
  de6ddaeef3,
and reverts aa643f455a.
This change also includes a workaround for users using libc++ 3.1 and
earlier (!!), as apparently happens on AIX, where std::move sometimes
returns by value.

Reviewed By: aaron.ballman

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

Revert "Fixup D123950 to address revert of D123345"

This reverts commit aa643f455a.
2022-04-20 17:58:31 -07:00
Muhammad Omair Javaid e3cd8fedca [LLDB] Skip TestCrashDuringStep.py AArch64/Windows
TestCrashDuringStep.py hangs on AArch64 windows with no resonable
possible fix. I am marking it skipped for now.
2022-04-21 05:10:37 +05:00
Maksim Panchenko 76981fbcf6 [BOLT] Add fuzzy function name matching for LLVM LTO
LLVM with LTO can generate function names in the form
func.llvm.<number>, where <number> could vary based on the compilation
environment. As a result, if a profiled binary originated from a
different build than a corresponding binary used for BOLT optimization,
then profiles for such LTO functions will be ignored.

To fix the problem, use "fuzzy" matching with "func.llvm.*" form.

Reviewed By: yota9, Amir

Differential Revision: https://reviews.llvm.org/D124117
2022-04-20 17:00:21 -07:00
David Tenty aa643f455a Fixup D123950 to address revert of D123345
Since D123345 got reverted Builtin::BIaddressof and Builtin::BI__addressof don't exist and cause build breaks.
2022-04-20 19:59:07 -04:00
Alexander Yermolovich 7d6716786f [BOLT][DWARF] Handle Error returned by visitLocationList
Looks like implementation in llvm changed, and now we need to process error
being returned.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D124133
2022-04-20 16:40:46 -07:00
David Tenty 98d911e01f Revert "Treat std::move, forward, etc. as builtins."
This reverts commit b27430f9f4 as the
    parent https://reviews.llvm.org/D123345 breaks the AIX CI:

    https://lab.llvm.org/buildbot/#/builders/214/builds/819
2022-04-20 19:14:37 -04:00
David Tenty de6ddaeef3 Revert "Don't treat 'T &forward(T&&)' as builtin."
This reverts commit e43c93dd63 as the
parent https://reviews.llvm.org/D123345 breaks the AIX CI.
2022-04-20 19:14:36 -04:00
Evgeny Mankov c23147106f [clang][CUDA][Windows] Fix compilation error on Windows with uint32_t __nvvm_get_smem_pointer
The change fixes https://github.com/llvm/llvm-project/issues/54609 (the second reported issue) by eliminating a compilation error occurring only on Windows while trying to compile any CUDA source file by clang (-x cuda).

[Repro]
clang -x cuda <any_cu_source>

[Error]

__clang_cuda_runtime_wrapper.h:473:
__clang_cuda_intrinsics.h(517,19): error GC871EEFB: unknown type name 'uint32_t'; did you mean 'cuuint32_t'?
__device__ inline uint32_t __nvvm_get_smem_pointer(void *__ptr) {
                          ^
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/include\cuda.h:57:26: note: 'cuuint32_t' declared here
typedef unsigned __int32 cuuint32_t;

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D122897
2022-04-21 00:41:20 +03:00
Jez Ng 9c4b2ff9cd [MC][NFC] Ensure tests that intended to cover compact unwind code paths do so
These two tests were intended to cover the CU code paths, but invoked
llvm-mc using a generic "darwin" platform. However, MC only attempts to
emit CU for `macos >= 10.6` [1]. Thus we adjust the tests accordingly.

compact-unwind-cfi_def_cfa.s was added in 2fca51d3b4
fp-setup-macho.s was added in 03ffa797ad

[1]: 16c93aaa4a/llvm/lib/MC/MCObjectFileInfo.cpp (L43)

Reviewed By: MaskRay, smeenai

Differential Revision: https://reviews.llvm.org/D124126
2022-04-20 18:11:33 -04:00
V Donaldson 7d61a8419b [flang] Semantics limits on kP scale factors
When known at compile time, Ew.d and Dw.d output edit descriptors
should respect limitations from the standard on the value of a
kP scale factor with respect to the digit count (d), at least for
values of k other than zero.
2022-04-20 14:43:21 -07:00
Krzysztof Parzyszek 16c93aaa4a [Hexagon] Establish size limit for RegisterSet in hexbit
This should reduce compilation time for huge functions.
2022-04-20 14:16:24 -07:00
Nathan James cfb8169059
[clang] Add a raw_ostream operator<< overload for QualType
Under the hood this prints the same as `QualType::getAsString()` but cuts out the middle-man when that string is sent to another raw_ostream.

Also cleaned up all the call sites where this occurs.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D123926
2022-04-20 22:09:05 +01:00
Nikolas Klauser faef447e72 [libc++] Granularize <functional> includes
Reviewed By: Mordante, #libc

Spies: libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D123912
2022-04-20 22:49:18 +02:00
Mehdi Amini 02eac667ed Improve invalid-ir-print-after-failure.mlir to show the effects of -mlir-print-assume-verified (NFC) 2022-04-20 20:40:41 +00:00
Muhammad Omair Javaid 5341b5f8d3 [LLDB] Update inspect getargspec to getfullargspec
This patch replaces getargspec with getfullargspec in funcutils.py.
getargspec has been deprecated by python 11x release. This is
important to run LLDB testsuite in Windows/Arm64 platform
where Python native will be available from python release onwards.

Note: getfullargspec is not available in python 2

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D121786
2022-04-21 01:33:26 +05:00
Pengxuan Zheng 38612fbc89 Reland "[COFF, ARM64] Add __break intrinsic"
https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170

Reland after fixing the test failure. The failure was due to conflict with a
change (D122983) which was merged right before this patch.

Reviewed By: rnk, mstorsjo

Differential Revision: https://reviews.llvm.org/D124032
2022-04-20 13:01:30 -07:00
serge-sans-paille af7b98c383 [clang-tblgen] Automatically document options values
This is a port of f5c666742f to clang's tablegen,
with a better wording.

Differential Revision: https://reviews.llvm.org/D123682
2022-04-20 22:00:06 +02:00
Siva Chandra Reddy 22f9dca113 [libc] Add the implementation of the fflush function.
Note that the underlying flush implementation does not yet fully implement
the POSIX standard. It is complete with respect to the C standard
however. A future change will add the POSIX behavior. It should not affect
the implementation of the fflush function however as the POSIX behavior
will be added in a lower layer.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D124073
2022-04-20 19:43:39 +00:00
Pengxuan Zheng bff8356b19 Revert "[COFF, ARM64] Add __break intrinsic"
This reverts commit 8a9b4fb4aa.
2022-04-20 11:57:49 -07:00
Stanislav Mekhanoshin aa14e2ef3e [AMDGPU] Remove obsolete hack from allowsMisalignedMemoryAccesses. NFCI.
Differential Revision: https://reviews.llvm.org/D124035
2022-04-20 11:52:56 -07:00
Florian Hahn bea69b232f
[VPlan] Initial modeling of middle block in VPlan.
This patch extends the scope of VPlan to also include the exit (aka
middle) block.

For now, the exit block remains empty, but handling of exit values will
subsequently be moved to VPlan, by adding recipes to model exit values
in the exit block.

As a first step, this will allow fixing #51366.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D123457
2022-04-20 19:34:41 +01:00
Eli Friedman ecc8479a01 Look through calls to std::addressof to compute pointer alignment.
This is sort of a followup to D37310; that basically fixed the same
issue, but then the libstdc++ implementation of <atomic> changed. Re-fix
the the issue in essentially the same way: look through the addressof
operation to find the alignment of the underlying object.

Differential Revision: https://reviews.llvm.org/D123950
2022-04-20 11:30:11 -07:00
Paul Kirth 61e36e87df [safestack] Support safestack in stack size diagnostics
Current stack size diagnostics ignore the size of the unsafe stack.
This patch attaches the size of the static portion of the unsafe stack
to the function as metadata, which can be used by the backend to emit
diagnostics regarding stack usage.

Reviewed By: phosek, mcgrathr

Differential Revision: https://reviews.llvm.org/D119996
2022-04-20 18:29:40 +00:00
Jan Svoboda 340654e0f2 Revert "[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::load*()"
This reverts commit 1d3ba05e4a which caused failures of the VFS/real-path-found-first.m test on Windows build bots.
2022-04-20 20:27:14 +02:00