David Green [Thu, 15 Jun 2023 07:47:10 +0000 (08:47 +0100)]
[AArch64] Don't look at type size for scalable types in isExtFreeImpl
This fixes one of those 'Request for a fixed element count on a scalable
object' errors in the AArch64 isExtFreeImpl method, where the uses of a sext
are checked to see if the instruction can be considered free.
https://godbolt.org/z/debYP9c4G
Differential Revision: https://reviews.llvm.org/D152930
Animesh Kumar [Tue, 6 Jun 2023 10:46:13 +0000 (16:16 +0530)]
[OpenMP] Update the default version of OpenMP to 5.1
The default version of OpenMP is updated from 5.0 to 5.1 which means if -fopenmp is specified but -fopenmp-version is not specified with clang, the default version of OpenMP is taken to be 5.1. After modifying the Frontend for that, various LIT tests were updated. This patch contains all such changes. At a high level, these are the patterns of changes observed in LIT tests -
# RUN lines which mentioned `-fopenmp-version=50` need to kept only if the IR for version 5.0 and 5.1 are different. Otherwise only one RUN line with no version info(i.e. default version) needs to be there.
# Test cases of this sort already had the RUN lines with respect to the older default version 5.0 and the version 5.1. Only swapping the version specification flag `-fopenmp-version` from newer version RUN line to older version RUN line is required.
# Diagnostics: Remove the 5.0 version specific RUN lines if there was no difference in the Diagnostics messages with respect to the default 5.1.
# Diagnostics: In case there was any difference in diagnostics messages between 5.0 and 5.1, mention version specific messages in tests.
# If the test contained version specific ifdef's e.g. "#ifdef OMP5" but there were no RUN lines for any other version than 5.X, then bring the code guarded by ifdef's outside and remove the ifdef's.
# Some tests had RUN lines for both 5.0 and 5.1 versions, but it is found that the IR for 5.0 is not different from the 5.1, therefore such RUN lines are redundant. So, such duplicated lines are removed.
# To generate CHECK lines automatically, use the script llvm/utils/update_cc_test_checks.py
Reviewed By: saiislam, ABataev
Differential Revision: https://reviews.llvm.org/D129635
(cherry picked from commit
9dd2999907dc791136a75238a6000f69bf67cf4e)
Nikita Popov [Fri, 9 Jun 2023 07:57:21 +0000 (09:57 +0200)]
[Clang] Directly create opaque pointers
In CGTypes, directly create opaque pointers, without computing the
LLVM element type. This is not as straightforward as I though it
would be, because apparently computing the LLVM type also causes a
number of side effects.
In particular, we no longer produce diagnostics like -Wpacked for
typed (only) behind pointers, because we no longer depend on their
layout.
Differential Revision: https://reviews.llvm.org/D152505
Fangrui Song [Thu, 15 Jun 2023 06:57:03 +0000 (23:57 -0700)]
[MC] Properly report errors for .subsection
For the out-of-range error, MCConstantExpr doesn't have a location, so we
can only show "<unknown>:0:".
Also, allow subsection numbers up to
2147483647, which is the maximum value GNU
assembler supports. (GNU assembler also supports negative numbers.)
AdityaK [Thu, 15 Jun 2023 06:13:59 +0000 (23:13 -0700)]
Remove small data limit for riscv64.*android triples
On Android GP register has been repurposed for SCS so there is no need to have .sdata section.
Reviewers: enh, craig.topper, pirama, kito-cheng, jrtc27
Differential Revision: https://reviews.llvm.org/D151512
eopXD [Wed, 14 Jun 2023 14:39:31 +0000 (07:39 -0700)]
[lldb][RISCV] Replace enumeration of RVV builtin types with inclusion to RISCVVTypes.def
This approach prevents us from adding new lines into the switch case
when new types are introduced.
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D152922
esmeyi [Thu, 15 Jun 2023 05:28:45 +0000 (01:28 -0400)]
[XCOFF] FixupOffsetInCsect should be 0 for R_REF relocation.
Summary: The FixupOffsetInCsect should be 0 for R_REF relocation since it specifies a nonrelocating reference. Otherwise liker would try to relocate the symbol through its address and an error like following occurred.
```
ld: 0711-547 SEVERE ERROR: Object /tmp/1-2a7ea1.o cannot be processed.
RLD address 0x65 for section 2 (.data) is
not contained in the section.
```
Reviewed By: shchenz
Differential Revision: https://reviews.llvm.org/D152777
Pravin Jagtap [Thu, 15 Jun 2023 05:18:38 +0000 (01:18 -0400)]
[AMDGPU] Enable Atomic Optimizer and Default to Iterative Scan Strategy.
The D147408 implemented new Iterative approach for scan computations
and added new flag `amdgpu-atomic-optimizer-strategy` which is
defaulted to DPP.
The changeset https://github.com/GPUOpen-Drivers/llpc/pull/2506
adapts to the new changes in LLPC.
This patch enables atomic optimizer pass and selects Iterative
approach for scan computations by default for compute pipeline.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D152649
Carl Ritson [Thu, 15 Jun 2023 04:45:15 +0000 (13:45 +0900)]
[AMDGPU] Place returns on stack if they would violate VGPR limit
Check no VGPRs above configured maximum would be used by a return
when deciding if it can be lowered.
Reviewed By: sebastian-ne
Differential Revision: https://reviews.llvm.org/D152912
Carl Ritson [Thu, 15 Jun 2023 04:44:54 +0000 (13:44 +0900)]
[AMDGPU] Remove return VGPRs from callee save list
There is no need to generate spill/restore for registers used in
return value. This matters for amdgpu_gfx calling convention
where CSR and Ret definitions overlap.
Reviewed By: sebastian-ne
Differential Revision: https://reviews.llvm.org/D152892
Kazu Hirata [Thu, 15 Jun 2023 05:04:47 +0000 (22:04 -0700)]
[mlir] Remove unused forward declaration OpAsmParserResult
The corresponding class definition was removed by:
commit
17ef97bf7e124d7cba023011a7764e64b2889212
Author: Chris Lattner <clattner@google.com>
Date: Tue Aug 7 09:12:35 2018 -0700
Kazu Hirata [Thu, 15 Jun 2023 05:04:46 +0000 (22:04 -0700)]
[mlir] Remove unused forward declaration FilteredValueUseIterator
The corresponding class definition was removed by:
commit
48e9ef4320a315ba1f2358db7295d53917a14f4b
Author: River Riddle <riddleriver@gmail.com>
Date: Thu Apr 23 16:23:34 2020 -0700
Kazu Hirata [Thu, 15 Jun 2023 05:04:44 +0000 (22:04 -0700)]
[mlir] Remove unused forward declaration AffineSymbolExprStorage
The corresponding struct definition was removed by:
commit
c74996d199e8931d4fc3d72acd50754b43c4ec2d
Author: Alex Zinenko <zinenko@google.com>
Date: Tue May 21 01:34:13 2019 -0700
Kazu Hirata [Thu, 15 Jun 2023 05:04:43 +0000 (22:04 -0700)]
[lldb] Remove unused forward declaration RecordingMemoryManager
The corresponding class definition was removed by:
commit
8dfb68e0398ef48d41dc8ea058e9aa750b5fc85f
Author: Sean Callanan <scallanan@apple.com>
Date: Tue Mar 19 00:10:07 2013 +0000
Kazu Hirata [Thu, 15 Jun 2023 05:04:41 +0000 (22:04 -0700)]
[lld] Remove unused forward declarations for DefinedRelative
The corresponding class definition was removed by:
commit
502d4ce2e4921cc38ef1226ae093e594d900fe46
Author: Reid Kleckner <rnk@google.com>
Date: Mon Jun 26 15:39:52 2017 +0000
Kazu Hirata [Thu, 15 Jun 2023 05:04:40 +0000 (22:04 -0700)]
[CodeGen] Remove unused function GetOrCreateRTTIProxyGlobalVariable
The last use was removed by:
commit
46f366494f3ca8cc98daa6fb4f29c7c446c176b6
Author: Fangrui Song <i@maskray.me>
Date: Sat May 20 08:24:20 2023 -0700
This patch also removes RTTIProxyMap, which becomes unused once I
remove GetOrCreateRTTIProxyGlobalVariable.
Differential Revision: https://reviews.llvm.org/D152782
Kazu Hirata [Thu, 15 Jun 2023 05:04:38 +0000 (22:04 -0700)]
[mlir] Remove unused declaration createComposedAffineApplyOp
The corresponding function definition was removed by:
commit
362557e11c8185e172a49f7542dc04c519857230
Author: Nicolas Vasilache <ntv@google.com>
Date: Fri Jan 11 16:08:16 2019 -0800
Kazu Hirata [Thu, 15 Jun 2023 05:04:37 +0000 (22:04 -0700)]
[mlir] Use DenseMapBase::lookup (NFC)
Martin Braenne [Tue, 13 Jun 2023 07:05:15 +0000 (07:05 +0000)]
Prevent deadlocks in death tests.
We have recently started seeing deadlocks in death tests while running in an internal test environment.
Per the documentation here, there are issues with death tests in the presence of threads:
https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests-and-threads
To avoid the deadlocks, I first tried appending `DeathTest` to the relevant test suite names, which has the effect of running these test suites before all other tests. However, this did not prevent the deadlocks.
This patch therefore uses the option of setting the `death_test_style` flag to `"threadsafe"` (see description in the page linked above under "Death Test Styles"), and this prevents the deadlocks.
The documentation notes that the "threadsafe" death test style "trades increased test execution time (potentially dramatically so) for improved thread safety". This is because, to execute a death test, "threadsafe" does a "fork + exec", then re-executes the current test in the child process, whereas the default "fast" death test style does only a fork (on those platforms that support it). However, as we have relatively few death tests, the increased execution time does not make a big difference in total test execution time in my testing.
Note that other projects, such as Chromium, also choose to set the "threadsafe" death test style globally:
https://source.chromium.org/chromium/chromium/src/+/main:base/test/test_suite.cc;l=367
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D152696
Younan Zhang [Wed, 14 Jun 2023 01:59:30 +0000 (09:59 +0800)]
[clang][NFC] Add a notice to desugarForDiagnostic
`desugarForDiagnostic` only sets ShouldAKA to true if desugaring
happens, otherwise ShouldAKA is left intact and might be uninitialized.
Victims (including me):
https://github.com/llvm/llvm-project/commit/
25bf8cb3c0e3c41231289a6ff0a37b6d49b24011
https://github.com/llvm/llvm-project/commit/
0e8384a0fe4f03d60cd92aba1cae074512481ca2
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D152880
Yaxun (Sam) Liu [Thu, 15 Jun 2023 03:39:35 +0000 (23:39 -0400)]
Fix test target_cpu_features.f90
Change-Id: Iae75abc3e4d1508f08080f687aba0ee1af74da2b
Yaxun (Sam) Liu [Wed, 24 May 2023 16:59:01 +0000 (12:59 -0400)]
[HIP] emit macro `__HIP_NO_IMAGE_SUPPORT`
HIP texture/image support is optional as some devices
do not have image instructions. A macro __HIP_NO_IMAGE_SUPPORT
is defined for device not supporting images (https://github.com/ROCm-Developer-Tools/HIP/blob/
d0448aa4c4dd0f4b29ccf6a663b7f5ad9f5183e0/docs/reference/kernel_language.md?plain=1#L426 )
Currently the macro is defined by HIP header based on predefined macros
for GPU, e.g __gfx*__ , which is error prone. This patch let clang
emit the predefined macro.
Reviewed by: Matt Arsenault, Artem Belevich
Differential Revision: https://reviews.llvm.org/D151349
Jim Lin [Thu, 15 Jun 2023 02:18:27 +0000 (10:18 +0800)]
[RISCV] Remove redundant line `NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py` from riscv64-zknd-zkne.c
Craig Topper [Thu, 15 Jun 2023 01:03:57 +0000 (18:03 -0700)]
[RISCV] Remove fcvt.d.l(u) and fcvt.l(u).d instructions with _IN32X suffix.
This is the same as D152950 without depending on D152948.
_IN32X instructions are for Zdinx on RV32 where doubles are split
across 2 registers.
fcvt.d.l(u) and fcvt.l(u).d are RV64 only instructions so we don't
need _IN32X versions of them.
Reviewed By: sunshaoce
Differential Revision: https://reviews.llvm.org/D152952
Jonas Devlieghere [Thu, 15 Jun 2023 00:15:28 +0000 (17:15 -0700)]
[lldb] Have crashlog warn when remapped paths are inaccessible.
It can be tricky to troubleshoot why the crashlog script can't show
inline sources. The two most common causes are that we couldn't find the
dSYM or, if we find the dSYM, that the path remapping included in the
dSYMForUUID output isn't accessible. The former is already easy to
diagnose, but the latter is harder because you'd have to manually invoke
dsymForUUID on the UUID and check the remapped path. This patch
automates that process and prints a warning if the remapped path doesn't
exist or is not accessible.
Differential revision: https://reviews.llvm.org/D152886
Jonas Devlieghere [Thu, 15 Jun 2023 00:12:42 +0000 (17:12 -0700)]
[lldb] Remove lldbassert from DebugNamesDWARFIndex::GetGlobalVariables
34a8e6eee666 changed SymbolFileDWARF::GetDwoNum to
SymbolFileDWARF::GetFileIndex but changed the meaning from just DWO to
DWO and OSO which changed the meaning of the assert. The assert was
therefore removed from ManualDWARFIndex::GetGlobalVariables and
ManualDWARFIndex::GetGlobalVariables but was still present in
DebugNamesDWARFIndex::GetGlobalVariables. If we want to reintroduce the
assert, we need something with the old semantics for all 3.
Cyndy Ishida [Wed, 14 Jun 2023 23:24:42 +0000 (16:24 -0700)]
[TextAPI] add osx to possible string to platform input
Pranav Kant [Wed, 14 Jun 2023 23:28:50 +0000 (23:28 +0000)]
Nico Weber [Wed, 14 Jun 2023 23:19:48 +0000 (16:19 -0700)]
Revert "[Clang][MS] Remove assertion on BaseOffset can't be smaller than Size."
This reverts commit
5d54213ee557a86fae82af0f75498adf02f24e82.
Breaks check-clang on Windows, see https://reviews.llvm.org/D152472#4422913
Nico Weber [Wed, 14 Jun 2023 23:17:31 +0000 (16:17 -0700)]
Revert "[ABI] [C++20] [Modules] Don't generate vtable if the class is defined in other module unit"
Breaks check-clang on win and mac, see comments on https://reviews.llvm.org/D150023
This reverts commit
d8a36b00d198fdc2ea866ea5da449628db07070f.
Also revert follow-up "[NFC] skip the test modules-vtable.cppm on windows"
This reverts commit
baf0b12ca6c624b2a59aa6f2fd0310c72d35ac56.
Pranav Kant [Wed, 14 Jun 2023 23:11:53 +0000 (23:11 +0000)]
Christopher Ferris [Wed, 14 Jun 2023 20:49:37 +0000 (13:49 -0700)]
[scudo] Disable new/delete mismatch tests on Android.
Android does not do any checking of new/delete mismatches, so disable
this test when compiling for Android.
Reviewed By: Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D152958
Alex Langford [Wed, 14 Jun 2023 21:14:58 +0000 (14:14 -0700)]
[lldb] Fix SBPlatform after
f4be9ff6458f
If you pass `nullptr` (or `None` from python) to SBPlatform::SetSDKRoot,
LLDB crashes. Let's be more resilient to `nullptr` here.
Differential Revision: https://reviews.llvm.org/D152962
Krzysztof Parzyszek [Sat, 3 Jun 2023 13:59:19 +0000 (06:59 -0700)]
[RDF] Create build config
- Add option to ignore reserved registers
- Add possibility to track selected registers or register classes only
Tracking is done based on register units, so the set of registers to track
is translated into a set of register units.
Vitaly Buka [Wed, 14 Jun 2023 22:22:32 +0000 (15:22 -0700)]
[hwasan] Fixup mmap tagging regions
Reviewed By: thurston
Differential Revision: https://reviews.llvm.org/D152893
Jonas Devlieghere [Wed, 14 Jun 2023 20:00:38 +0000 (13:00 -0700)]
[DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple platforms
On Apple platforms, we generate .apple_names, .apple_types,
.apple_namespaces and .apple_objc Apple accelerator tables for DWARF 4
and earlier. For DWARF 5 we should generate .debug_names, but instead we
get no accelerator tables at all.
In the backend we are correctly determining that we should be emitting
.debug_names instead of .apple_names. However, when we get to the point
of emitting the section, if the CU debug name table kind is not
"default", the accelerator table emission is skipped.
This patch sets the DebugNameTableKind to Apple in the frontend when
target an Apple target. That way we know that the CU was compiled with
the intent of emitting accelerator tables. For DWARF 4 and earlier, that
means Apple accelerator tables. For DWARF 5 and later, that means .debug
names.
Differential revision: https://reviews.llvm.org/D118754
Amaury Séchet [Wed, 14 Jun 2023 22:06:04 +0000 (22:06 +0000)]
[NFC] Autogenerate several Mips test.
Andreu Carminati [Wed, 14 Jun 2023 22:26:31 +0000 (15:26 -0700)]
[ELF] Fix early overflow check in finalizeAddressDependentContent
LLD terminates with errors when it detects overflows in the
finalizeAddressDependentContent calculation. Although, sometimes, those errors
are not really errors, but an intermediate result of an ongoing address
calculation. If we continue the fixed-point algorithm we can converge to the
correct result.
This patch
* Removes the verification inside the fixed point algorithm.
* Calls checkMemoryRegions at the end.
Reviewed By: peter.smith, MaskRay
Differential Revision: https://reviews.llvm.org/D152170
Andreu Carminati [Wed, 14 Jun 2023 22:23:14 +0000 (15:23 -0700)]
[ELF] Refine warning condition for memory region assignment for non-allocatable section
The warning "ignoring memory region assignment for non-allocatable section" should be generated under the following conditions:
* sections without SHF_ALLOC attribute and,
* presence of input sections or data commands (ByteCommand)
The goal of the change is to reduce spurious warnings that are generated for some output sections that have no input section.
Reviewed By: MaskRay, peter.smith
Differential Revision: https://reviews.llvm.org/D151802
Vitaly Buka [Wed, 14 Jun 2023 22:21:41 +0000 (15:21 -0700)]
[test][hwasan] Use perror and abort in test
Valentin Clement [Wed, 14 Jun 2023 22:20:16 +0000 (15:20 -0700)]
[flang][openacc] Add lowering for max operator
Add support for the max operator in the reduction
clause.
Depdns on D151671
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D151672
Nico Weber [Wed, 14 Jun 2023 22:07:27 +0000 (15:07 -0700)]
Revert "[gn build] Port
2700da5fe28d (lld/unittests etc)"
2700da5fe28d got reverted in
aa495214b39d.
This reverts commit
9239cde390e2c8e7cc4ffd13bff7030a5172c805.
Also revert follow-up "[gn] Fix case of directory I added in
9239cde390e"
This reverts commit
4de67143babd20f44c1f806404df356bff6825a2.
Hristo Hristov [Wed, 14 Jun 2023 21:49:11 +0000 (00:49 +0300)]
[libc++][ranges][NFC] Status page: Adds `views::enumerate`
Chia-hung Duan [Wed, 14 Jun 2023 21:25:59 +0000 (21:25 +0000)]
Revert "[scudo] Temporariy dispatch region from `RegionBeg`"
This reverts commit
9d9a7732e14d7d4c0db7b46d6ebe588e8f43b951.
This was a workaround for some platform and it has been fixed in
bfa02523b2e7ed66368ea61866a474e55ef354a3
Differential Revision: https://reviews.llvm.org/D152964
Amaury Séchet [Wed, 14 Jun 2023 21:45:06 +0000 (21:45 +0000)]
[NFC] Autogenerate numerous SystemZ tests
Alex Langford [Wed, 14 Jun 2023 21:45:18 +0000 (14:45 -0700)]
[lldb][NFCI] Remove unused method ProcessStructReader::GetOffsetOf
Completely unused here, AFAICT. It's also not used in the swift
downstream forks.
Alex Langford [Wed, 14 Jun 2023 21:37:44 +0000 (14:37 -0700)]
[lldb][NFCI] Remove ProcessStructReader header where unused
Hristo Hristov [Tue, 13 Jun 2023 05:05:11 +0000 (08:05 +0300)]
[libc++][spaceship][NFC] P1614R2: Status page - mark header synopsis sections as "Complete"
Header synospis sections of P1614R2 are implemented by other items usually. For completeness, let's mark some of them as "Complete".
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D152775
Kazu Hirata [Wed, 14 Jun 2023 21:22:17 +0000 (14:22 -0700)]
[mlir] Fix warnings in release builds
This patch fixes:
mlir/lib/Dialect/SparseTensor/Transforms/LoopEmitter.cpp:846:16:
error: unused variable 'lvlTp' [-Werror,-Wunused-variable]
mlir/lib/Dialect/SparseTensor/Transforms/LoopEmitter.cpp:1059:13:
error: unused variable '[t, l]' [-Werror,-Wunused-variable]
Piotr Zegar [Wed, 14 Jun 2023 21:15:36 +0000 (21:15 +0000)]
[clang-tidy][NFC] Update ReleaseNotes to mention some performance changes in checks
Included a note in the release documentation about the improved
performance of certain checks, allowing users who had previously
disabled them due to slowness to reconsider their decision.
Muhammad Asif Manzoor [Wed, 14 Jun 2023 19:24:23 +0000 (15:24 -0400)]
[SampleFDO] Remove 'using namespace' (NFC)
Remove 'using namespace' statement from header file to avoid propagating it to
other locations unnecessarily and avoid potential name collisions.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D152727
Amaury Séchet [Wed, 14 Jun 2023 21:17:40 +0000 (21:17 +0000)]
[NFC] Autogenerate various Thumb2 tests.
Jonas Devlieghere [Wed, 14 Jun 2023 21:16:16 +0000 (14:16 -0700)]
Revert "[DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple platforms"
This reverts commit
e0d57295bf6a3c04f2901d9c70f529d570f48b65 because the
accel-tables-apple.ll test is failing on a few buildbots.
Frank (Fang) Gao [Wed, 14 Jun 2023 21:03:36 +0000 (17:03 -0400)]
[mlir][ArmSME] Dialect and Intrinsic Op Definition
This patch creates the ArmSME dialect, and provides the intrinsic op
definition necessary for lowering to LLVM IR.
This will cover most instructions interacting with the ZA tile register,
not covering SME2 instructions.
Source: https://developer.arm.com/documentation/ddi0616/latest
Reviewed By: awarzynski, c-rhodes
Differential Revision: https://reviews.llvm.org/D152878
Alan Zhao [Wed, 14 Jun 2023 21:10:31 +0000 (14:10 -0700)]
Revert "[InstSimplify] Fold all global variables with initializers"
This reverts commit
17b7df3daee85c1a4d1d955e558d42b34ce17549.
Reason: causes chrome builds to crash: https://crbug.com/1454861
Jason Molenda [Wed, 14 Jun 2023 20:43:53 +0000 (13:43 -0700)]
Clear non-addressable bits from pc/fp/sp in unwinds
Some Darwin corefiles can have the pc/fp/sp/lr in the
live register context signed with pointer authentication;
this patch changes RegisterContextUnwind to strip those
bits off of those values as we try to walk the stack.
Differential Revision: https://reviews.llvm.org/D152861
rdar://
109185291
Jason Molenda [Wed, 14 Jun 2023 20:40:54 +0000 (13:40 -0700)]
Add Fix*Address methods to Process, call into ABI
We need to clear non-addressable bits from addresses across
the lldb sources. Currently these need to use an ABI method
to clear those bits from addresses, which you do by taking a
Process, getting the current ABI, then calling the method.
Simplify this by providing methods in Process which call into
the ABI methods themselves.
Differential Revision: https://reviews.llvm.org/D152863
Zequan Wu [Thu, 8 Jun 2023 21:38:57 +0000 (17:38 -0400)]
[Clang][MS] Remove assertion on BaseOffset can't be smaller than Size.
This assertion triggered when we have two base classes sharing the same offset
and the first base is empty and the second class is non-empty.
Remove it for correctness.
I can't add a test case for this because -foverride-record-layout doesn't read
base class info at all. I can add that support later for testing if needed.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D152472
Leonard Chan [Wed, 14 Jun 2023 20:36:27 +0000 (20:36 +0000)]
Revert "[LLD] Allow usage of LLD as a library"
This reverts commit
2700da5fe28d8b17c66e5c960d2188276a6ced39.
Reverting since this causes some test failures on our builders: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/
b8778372807208184913/overview
Yaxun (Sam) Liu [Wed, 14 Jun 2023 20:03:29 +0000 (16:03 -0400)]
Revert "[HIP] Allow std::malloc in device function"
This reverts commit
f5033c37025db46df95a7859d7189d09b5e3433e.
revert this patch since it causes regressions for Tensile. A
reduced test case is:
int main()
{
std::shared_ptr<float> a;
a = std::shared_ptr<float>(
(float*)std::malloc(sizeof(float) * 100),
std::free
);
return 0;
}
Will fix the issue then re-commit.
Fixes: SWDEV-405317
Peiming Liu [Wed, 14 Jun 2023 01:29:20 +0000 (01:29 +0000)]
[mlir][sparse] fix crashes when the tensor that defines the loop bound can not be found
Reviewed By: aartbik, K-Wu
Differential Revision: https://reviews.llvm.org/D152877
Fangrui Song [Wed, 14 Jun 2023 20:16:49 +0000 (13:16 -0700)]
[asan] Fix shadow load alignment for unaligned 128-bit load/store
When a 128-bit load/store is aligned by 8, we incorrectly emit `load i16, ptr ..., align 2`
while the shadow memory address may not be aligned by 2.
This manifests as possibly-misaligned shadow memory load with `-mstrict-align`,
e.g. `clang --target=aarch64-linux -O2 -mstrict-align -fsanitize=address`
```
__attribute__((noinline)) void foo(unsigned long *ptr) {
ptr[0] = 3;
ptr[1] = 3;
}
// ldrh w8, [x9, x8] // the shadow memory load may not be aligned by 2
```
Infer the shadow memory alignment from the load/store alignment to set the
correct alignment. The generated code now uses two ldrb and one orr.
Fix https://github.com/llvm/llvm-project/issues/63258
Differential Revision: https://reviews.llvm.org/D152663
William S. Moses [Wed, 14 Jun 2023 16:23:44 +0000 (12:23 -0400)]
[LoopIdiom] Preserve alias information for memset_pattern
TBAA/NoAlias/AliasScope and other information is currently preserved
when upgrading to a memcpy/memset. However, this is missing when upgrading to
the macOS memset_pattern function. This adds the same alias information preservation
to memset_pattern
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D152934
Jonas Devlieghere [Wed, 14 Jun 2023 20:00:38 +0000 (13:00 -0700)]
[DebugInfo] Always emit `.debug_names` with DWARF 5 for Apple platforms
On Apple platforms, we generate .apple_names, .apple_types,
.apple_namespaces and .apple_objc Apple accelerator tables for DWARF 4
and earlier. For DWARF 5 we should generate .debug_names, but instead we
get no accelerator tables at all.
In the backend we are correctly determining that we should be emitting
.debug_names instead of .apple_names. However, when we get to the point
of emitting the section, if the CU debug name table kind is not
"default", the accelerator table emission is skipped.
This patch sets the DebugNameTableKind to Apple in the frontend when
target an Apple target. That way we know that the CU was compiled with
the intent of emitting accelerator tables. For DWARF 4 and earlier, that
means Apple accelerator tables. For DWARF 5 and later, that means .debug
names.
Differential revision: https://reviews.llvm.org/D118754
Peiming Liu [Tue, 6 Jun 2023 22:51:32 +0000 (22:51 +0000)]
[mlir][sparse] unifying enterLoopOverTensorAtLvl and enterCoIterationOverTensorsAtLvls
The tensor levels are now explicitly categorized into different `LoopCondKind` to instruct LoopEmitter generate different code for different kinds of condition (e.g., `SparseCond`, `SparseSliceCond`, `SparseAffineIdxCond`, etc)
The process of generating a while loop is now dissembled into three steps and they are dispatched to different LoopCondKind handler.
1. Generate LoopCondition (e.g., `pos <= posHi` for `SparseCond`, `slice.isNonEmpty` for `SparseAffineIdxCond`)
2. Generate LoopBody (e.g., compute the coordinates)
3. Generate ExtraChecks (e.g., `if (onSlice(crd))` for `SparseSliceCond`)
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D152464
Philip Reames [Wed, 14 Jun 2023 19:57:49 +0000 (12:57 -0700)]
[RISCV] Remove dead code from doPeepholeMaskedRVV [nfc]
This is after lowering of undef to IMPLICIT_DEF, so the condition is always false. Rather than fixing the intent (which was to match implicit_def per the comment), just delete it. We're in the process of migrating away from the TA pseudos, so using _TA more often is fine.
Simon Pilgrim [Wed, 14 Jun 2023 19:48:35 +0000 (20:48 +0100)]
[GlobalIsel][X86] Fix copy+pasta typo in the G_EXTRACT/G_INSERT legal type pairs
Benoit Jacob [Fri, 9 Jun 2023 02:33:51 +0000 (02:33 +0000)]
bazel build --incompatible_no_implicit_file_export
The Bazel build was relying, for the two files enumerated in this diff, on the legacy implicit-export semantics described here:
https://bazel.build/reference/be/functions#exports_files
This documentation page encourages migrating away from this legacy behavior, and indeed we have a user who reported a Bazel build error and it appears that they were already using the new, stricter behavior:
https://github.com/openxla/iree/pull/13982
and while examining fixes on our side and trying to get a clean Bazel build, I ran into this similar issue in the LLVM overlay.
It would arguably be cleaner (in the sense of more structured) to rely on `filegroup` to export this, but I am insufficiently familiar with the Clang build (the dependent targets seem to be below Clang) to do this myself. The present `exports_files` solution has the merit of being localized in these few lines here.
Differential Revision: https://reviews.llvm.org/D152491
AMS21 [Wed, 14 Jun 2023 18:47:32 +0000 (18:47 +0000)]
[clang-tidy] Fix wrong code generation for `modernize-loop-convert` with structured bindings.
Fixes llvm#62951
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D152852
Eli Friedman [Wed, 14 Jun 2023 18:44:02 +0000 (11:44 -0700)]
[clang docs] Rescue some deleted bits of the command-line reference.
Back when the command-line reference rst was in-tree, a lot of people missed
the "DO NOT EDIT" comment at the top, and then changes were
effectively reverted when the file was regenerated. I went through the
changes, and rescued the interesting bits of documentation that were
destroyed.
Additional notes:
- I'm intentionally leaving out D73459 because I'm not sure how to port
the changes to -march.
- Some options have help text in Options.td, but that text doesn't make
it into the reference. Incomplete list of such options:
-fc++-static-destructors, -frtti-data, -fplt, -fstrict-return,
-funique-section-names, -fuse-init-array. Not sure what's happening.
Differential Revision: https://reviews.llvm.org/D152396
Saleem Abdulrasool [Wed, 14 Jun 2023 18:14:17 +0000 (11:14 -0700)]
[lit] Avoid os.path.realpath in lit.py due to MAX_PATH limitations on Windows
lit.py uses os.path.realpath on file paths. Somewhere between Python 3.7
and 3.9, os.path.realpath was updated to resolve substitute drives on
Windows (subst S: C:\Long\Path\To\My\Code). This is a problem because it
prevents using substitute drives to work around MAX_PATH path length
limitations on Windows.
We run into this while building & testing, the Swift compiler on
Windows, which uses a substitute drive in CI to shorten the workspace
directory. cmake builds without resolving the substitute drive and can
apply its logic to avoid output files exceeding MAX_PATH. However, when
running tests, lit.py's use of os.path.realpath will resolve the
substitute drive (with newer Python versions), resulting in some paths
being longer than MAX_PATH, which cause all kinds of failures (for
example rd in tests fails, or link.exe fails, etc).
How tested: Ran check-all, and lit tests, saw no failures
```
> ninja -C build check-all
Testing Time: 262.63s
Skipped : 24
Unsupported : 2074
Passed : 51812
Expectedly Failed: 167
> python utils\lit\lit.py --path ..\build\bin utils\lit\tests
Testing Time: 12.17s
Unsupported: 6
Passed : 47
```
Patch by Tristan Labelle!
Differential Revision: https://reviews.llvm.org/D152709
Reviewed By: rnk, compnerd
Dimitry Andric [Tue, 13 Jun 2023 08:58:07 +0000 (10:58 +0200)]
[Clang] Show type in enum out of range diagnostic
When the diagnostic for an out of range enum value is printed, it
currently does not show the actual enum type in question, for example:
v8/src/base/bit-field.h:43:29: error: integer value 7 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
static constexpr T kMax = static_cast<T>(kNumValues - 1);
^
This can make it cumbersome to find the cause for the problem. Add the
enum type to the diagnostic message, to make it easier.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D152788
Joseph Huber [Wed, 14 Jun 2023 18:33:00 +0000 (13:33 -0500)]
[libc][obvious] Fix the FMA implementation on the GPU
Summary:
This doesn't include the type_traits to perform the indirection, nor
does it return the value.
Simon Pilgrim [Wed, 14 Jun 2023 18:32:17 +0000 (19:32 +0100)]
Fix MSVC "'std::max': no matching overloaded function found" error. NFCI.
Amaury Séchet [Wed, 14 Jun 2023 17:59:15 +0000 (17:59 +0000)]
[NFC] Autogenerate several AArch64 tests.
Joseph Huber [Wed, 14 Jun 2023 14:35:59 +0000 (09:35 -0500)]
[libc] Add support for FMA in the GPU utilities
This adds the generic FMA utilities for the GPU. We implement these
through the builtins which map to the FMA instructions in the ISA. These
may not have strict compliance with other assumptions in the the `libc`
such as rounding modes. I've included the relevant information on how
the GPU vendors map the behaviour. This should help make it easier to
implement some future generic versions.
Depends on D152486
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D152923
Joseph Huber [Thu, 8 Jun 2023 22:51:43 +0000 (17:51 -0500)]
[libc] Begin implementing a 'libmgpu.a' for math on the GPU
This patch adds an outline to begin adding a `libmgpu.a` file for
provindg math on the GPU. Currently, this is most likely going to be
wrapping around existing vendor libraries and placing them in a more
usable format. Long term, we would like to provide our own
implementations of math functions that can be used instead.
This patch works by simply forwarding the calls to the standard C math
library calls like `sin` to the appropriate vendor call like `__nv_sin`.
Currently, we will use the vendor libraries directly and link them in
via `-mlink-builtin-bitcode`. This is necessary because of bizarre
interactions with the generic bitcode, `-mlink-builtin-bitcode`
internalizes and only links in the used symbols, furthermore is
propagates the target's default attributes and its the only "truly"
correct way to pull in these vendor bitcode libraries without error.
If the vendor libraries are not availible at build time, we will still
create the `libmgpu.a`, but we will expect that the vendor library
definitions will be provided by the user's compilation as is made
possible by https://reviews.llvm.org/D152442.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D152486
Kazu Hirata [Wed, 14 Jun 2023 17:56:22 +0000 (10:56 -0700)]
[lldb] Fix a warning
This patch fixes:
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4843:13:
error: 225 enumeration values not handled in switch: 'RvvInt8mf8x2',
'RvvInt8mf8x3', 'RvvInt8mf8x4'... [-Werror,-Wswitch]
Kazu Hirata [Wed, 14 Jun 2023 17:53:11 +0000 (10:53 -0700)]
[CodeGen] Fix a warning
This patch fixes:
llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:1790:3: error:
default label in switch which covers all enumeration values
[-Werror,-Wcovered-switch-default]
Nathan Ridge [Fri, 9 Jun 2023 06:39:28 +0000 (02:39 -0400)]
[clangd] Unwrap type sugar in HeuristicResolver::resolveTypeToRecordDecl()
Fixes https://github.com/clangd/clangd/issues/1663
Differential Revision: https://reviews.llvm.org/D152500
Amaury Séchet [Wed, 14 Jun 2023 17:46:34 +0000 (17:46 +0000)]
[NFC] Autogenerate several AArch64 tests.
Neumann Hon [Wed, 14 Jun 2023 17:37:46 +0000 (13:37 -0400)]
[SystemZ][z/OS] Correct value of length/4 of params field in PPA1.
The Length/4 of Params field in the PPA1 ought to be the length of the parameters for the current function. Currently we are storing the length of the parameter area in the current function's stack frame, which represents the length of the params of the longest callee in the current function.
Differential Revision: https://reviews.llvm.org/D152920
Reviewed By: uweigand
Christopher Ferris [Wed, 14 Jun 2023 01:56:12 +0000 (18:56 -0700)]
[scudo] Fix MallocIterateBoundary test on 32 bit Android.
On Android, the min alignment is 16 bytes. This test needs
the BlockDelta to match the min alignment, so set this value
differently for Android.
Update the comment in to explain these details.
Reviewed By: Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D152884
Neumann Hon [Wed, 14 Jun 2023 17:34:16 +0000 (13:34 -0400)]
Revert "[SystemZ][z/OS] Correct value of length/4 of params field in PPA1."
This reverts commit
e0f7b0e0f704dc3759925602e474b9e669270fcb.
Igor Kirillov [Fri, 2 Jun 2023 19:14:07 +0000 (19:14 +0000)]
[CodeGen] Add support for reductions in ComplexDeinterleaving pass
This commit enhances the ComplexDeinterleaving pass to handle unordered
reductions in simple one-block vectorized loops, supporting both
SVE and Neon architectures.
Differential Revision: https://reviews.llvm.org/D152022
Neumann Hon [Wed, 14 Jun 2023 17:20:45 +0000 (13:20 -0400)]
[SystemZ][z/OS] Correct value of length/4 of params field in PPA1.
The Length/4 of Params field in the PPA1 ought to be the length of the parameters for the current function. Currently we are storing the length of the parameter area in the current function's stack frame, which represents the length of the params of the longest callee in the current function.
Differential revision: https://reviews.llvm.org/D119049
Reviewed By: uweigand
Simon Pilgrim [Wed, 14 Jun 2023 17:09:59 +0000 (18:09 +0100)]
[GlobalIsel][X86] G_EXTRACT/G_INSERT subvector ops
Replace the legacy legalizer versions
Amaury Séchet [Wed, 14 Jun 2023 17:09:55 +0000 (17:09 +0000)]
[NFC] Autogenerate CodeGen/AArch64/sve-vl-arith.ll
Artem Belevich [Wed, 14 Jun 2023 16:21:21 +0000 (09:21 -0700)]
Revert "[NVPTX] Allow using v4i32 for memcpy lowering."
The patch may trigger a hang:
https://github.com/llvm/llvm-project/issues/63294
This reverts commit
c16b7e54ac5b4da05c1d19e350ee8e75bf5f8980.
Amaury Séchet [Wed, 14 Jun 2023 16:58:18 +0000 (16:58 +0000)]
[NFC] Autogenerate a couple of AArch64 tests.
Alex Langford [Wed, 7 Jun 2023 01:48:31 +0000 (18:48 -0700)]
[lldb][NFCI] Platforms should own their SDKBuild and SDKRootDirectory strings
These don't need to be ConstStrings. They don't really benefit much from
deduplication and comparing them isn't on a hot path, so they don't
really benefit much from quick comparisons.
Differential Revision: https://reviews.llvm.org/D152331
Philip Reames [Wed, 14 Jun 2023 16:49:58 +0000 (09:49 -0700)]
[RISCV] Enable SLP by default (when vectors are available)
I propose that we go ahead and enabled SLP by default. Over the last few weeks, @luke and I have been working through codegen issues seen at small VLs from a couple of SPEC workloads. We still have a ways to go to get optimal codegen, but we're at the point where having a single configuration we're all tuning against is probably the right default.
As a bit of history, I introduced this TTI hook back in
a310637132 back in August of last year to unblock enabling LoopVectorizer. At the time, we had a couple known issues: constant materialization, address generation, and a general lack of maturity of small fixed vector codegen. By now, each of these has had significant investment. I can't say any of them are completely fixed, but we're no longer seeing instances of them every place we look.
What we're mostly seeing at this point is a long tail of code gen opportunities, many involving build vectors, shuffles, and extract patterns. I have a couple patches up to continue iterating on those issues, but I don't think they need to be blockers for enabling SLP.
Differential Revision: https://reviews.llvm.org/D152750
Philip Reames [Wed, 14 Jun 2023 16:47:24 +0000 (09:47 -0700)]
[RISCV][InsertVSETVLI] Rework code structure to make reasoning about undefined lanes explicit [NFC]
We already have several places in this code which reason about whether the inactive lanes are defined, and are about to add one more in D151653. Let's go ahead and common the code so that we don't have the same concept repeating in multiply places.
Differential Revision: https://reviews.llvm.org/D152844
Amaury Séchet [Wed, 14 Jun 2023 16:35:38 +0000 (16:35 +0000)]
[NFC] Regenerate CodeGen/AArch64/sve-streaming-mode-fixed-length-*.ll
Philip Reames [Wed, 14 Jun 2023 16:21:31 +0000 (09:21 -0700)]
[RISCV] Canonicalize towards vid w/passthrough representation
This patch teaches performCombineVMergeAndVOps how to handle a True instruction (the one being merged into) which is a _TU psuedo, but with an implicit_def passthrough operand. These are semantically equivalent to the unsuffixed "TA" psuedos, and we can hnndle them as such.
This is a companion to D152380, and demonstrates the unsuffixed to _TA pseudo transition for a non-VMERGE case. Between the two of them, these should cover all the changes required to the post-ISEL combines, and other arithmetic-like instructions should be just TD changes.
See https://discourse.llvm.org/t/riscv-transition-in-vector-pseudo-structure-policy-variants/71295 for context on the patch series.
Differential Revision: https://reviews.llvm.org/D152740
Amaury Séchet [Wed, 14 Jun 2023 16:27:58 +0000 (16:27 +0000)]
[NFC] Automatically generate arm64-dagcombiner-dead-indexed-load.ll
Shilei Tian [Wed, 14 Jun 2023 16:23:24 +0000 (12:23 -0400)]
[OpenMP] Fix the issue in openmp/runtime/test/parallel/bug63197.c
If the system has 32 threads, then the test will fail because of partial match.
Aart Bik [Wed, 14 Jun 2023 00:51:13 +0000 (17:51 -0700)]
[mlir][sparse] refine single condition set up for semi-ring ops
Reviewed By: Peiming, K-Wu
Differential Revision: https://reviews.llvm.org/D152874
Amaury Séchet [Wed, 14 Jun 2023 16:19:49 +0000 (16:19 +0000)]
[NFC] Regenerate several VE codegen tests.
Krzysztof Parzyszek [Tue, 6 Jun 2023 19:34:40 +0000 (12:34 -0700)]
[RDF] Minor refactoring for clarity, NFC