464436 Commits

Author SHA1 Message Date
Kazu Hirata
56c7fba4a7 [mlir] Use DenseMapBase::lookup (NFC) 2023-06-14 22:04:37 -07:00
Martin Braenne
dfbcee286b 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
2023-06-15 04:29:00 +00:00
Younan Zhang
0e08374abb [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):

25bf8cb3c0

0e8384a0fe

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D152880
2023-06-15 11:55:06 +08:00
Yaxun (Sam) Liu
c42e7b8126 Fix test target_cpu_features.f90
Change-Id: Iae75abc3e4d1508f08080f687aba0ee1af74da2b
2023-06-14 23:39:35 -04:00
Yaxun (Sam) Liu
c0f0d50653 [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 (d0448aa4c4/docs/reference/kernel_language.md (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
2023-06-14 22:53:41 -04:00
Jim Lin
dc895d023e [RISCV] Remove redundant line NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py from riscv64-zknd-zkne.c 2023-06-15 10:22:06 +08:00
Craig Topper
d60c64d723 [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
2023-06-14 18:03:57 -07:00
Jonas Devlieghere
7371ec7629
[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
2023-06-14 17:15:28 -07:00
Jonas Devlieghere
048204d610
[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.
2023-06-14 17:15:20 -07:00
Cyndy Ishida
e63e536044 [TextAPI] add osx to possible string to platform input 2023-06-14 16:31:26 -07:00
Pranav Kant
c731bdd6ca [Bazel] Another fix for 7a2fdc685f609730af29e5e969843e9eb71a184c 2023-06-14 23:29:06 +00:00
Nico Weber
9c560350dd 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
2023-06-14 16:19:48 -07:00
Nico Weber
dbdd6372b7 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.
2023-06-14 16:17:42 -07:00
Pranav Kant
4cfc33b8b5 [Bazel] Fix for 7a2fdc685f609730af29e5e969843e9eb71a184c 2023-06-14 23:12:06 +00:00
Christopher Ferris
f95a4a2833 [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
2023-06-14 16:07:50 -07:00
Alex Langford
623ad8a8dd [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
2023-06-14 15:46:00 -07:00
Krzysztof Parzyszek
39ab9da920 [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.
2023-06-14 15:34:24 -07:00
Vitaly Buka
ad1dd78793 [hwasan] Fixup mmap tagging regions
Reviewed By: thurston

Differential Revision: https://reviews.llvm.org/D152893
2023-06-14 15:32:12 -07:00
Jonas Devlieghere
fc60bf2de1
[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
2023-06-14 15:28:33 -07:00
Amaury Séchet
e879fded2a [NFC] Autogenerate several Mips test. 2023-06-14 22:27:15 +00:00
Andreu Carminati
e4118a7ac0 [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
2023-06-14 15:26:31 -07:00
Andreu Carminati
58789ed62a [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
2023-06-14 15:23:14 -07:00
Vitaly Buka
aeb13a4459 [test][hwasan] Use perror and abort in test 2023-06-14 15:22:12 -07:00
Valentin Clement
208fdcb07f
[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
2023-06-14 15:21:23 -07:00
Nico Weber
d76b37e695 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.
2023-06-14 15:08:03 -07:00
Hristo Hristov
e7e36d56d6 [libc++][ranges][NFC] Status page: Adds views::enumerate 2023-06-15 00:53:15 +03:00
Chia-hung Duan
163f8e1b01 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
2023-06-14 21:48:59 +00:00
Amaury Séchet
0a76f7d9d8 [NFC] Autogenerate numerous SystemZ tests 2023-06-14 21:47:31 +00:00
Alex Langford
f6ca15cfb2 [lldb][NFCI] Remove unused method ProcessStructReader::GetOffsetOf
Completely unused here, AFAICT. It's also not used in the swift
downstream forks.
2023-06-14 14:45:21 -07:00
Alex Langford
a9ddf45b8a [lldb][NFCI] Remove ProcessStructReader header where unused 2023-06-14 14:38:18 -07:00
Hristo Hristov
9838dd7f76 [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
2023-06-15 00:28:10 +03:00
Kazu Hirata
a39adc00db [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]
2023-06-14 14:22:17 -07:00
Piotr Zegar
cf1c6dae84 [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.
2023-06-14 21:20:37 +00:00
Muhammad Asif Manzoor
5bb9bf52cb [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
2023-06-14 17:19:30 -04:00
Amaury Séchet
7a50e78621 [NFC] Autogenerate various Thumb2 tests. 2023-06-14 21:18:39 +00:00
Jonas Devlieghere
04c0161c02
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.
2023-06-14 14:16:16 -07:00
Frank (Fang) Gao
7a2fdc685f [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
2023-06-14 17:11:49 -04:00
Alan Zhao
3d5cf0df4f Revert "[InstSimplify] Fold all global variables with initializers"
This reverts commit 17b7df3daee85c1a4d1d955e558d42b34ce17549.

Reason: causes chrome builds to crash: https://crbug.com/1454861
2023-06-14 14:10:31 -07:00
Jason Molenda
0ce7037b5e 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
2023-06-14 13:49:26 -07:00
Jason Molenda
90d9f88f19 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
2023-06-14 13:49:26 -07:00
Zequan Wu
5d54213ee5 [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
2023-06-14 16:48:26 -04:00
Leonard Chan
aa495214b3 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
2023-06-14 20:36:27 +00:00
Yaxun (Sam) Liu
8193b291ce 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
2023-06-14 16:33:30 -04:00
Peiming Liu
83b7f018fd [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
2023-06-14 20:27:50 +00:00
Fangrui Song
e3cc8f3440 [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
2023-06-14 13:16:49 -07:00
William S. Moses
3eb6fefb97 [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
2023-06-14 16:14:53 -04:00
Jonas Devlieghere
e0d57295bf
[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
2023-06-14 13:03:31 -07:00
Peiming Liu
fd68d36109 [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
2023-06-14 20:03:10 +00:00
Philip Reames
c4a3bd7f8b [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.
2023-06-14 12:59:41 -07:00
Simon Pilgrim
43593a0a14 [GlobalIsel][X86] Fix copy+pasta typo in the G_EXTRACT/G_INSERT legal type pairs 2023-06-14 20:48:53 +01:00