Commit Graph

474356 Commits

Author SHA1 Message Date
Jason Molenda
2cab996192 Add "process metadata" Mach-O LC_NOTE for corefiles
Add a new LC_NOTE for Mach-O corefiles, "proces metadata", which is a
JSON string.  Currently there may be a `threads` key in the JSON,
and if `threads` is present, it is an array with the same number of
elements as there are LC_THREADs in the corefile.  This patch adds
support for a `thread_id` key-value for each `thread` entry, to
supply a thread ID for that LC_THREAD.

Differential Revision: https://reviews.llvm.org/D158785
rdar://113037252
2023-09-11 16:46:18 -07:00
Christopher Di Bella
dfd1d8d505 Revert "adds __reference_constructs_from_temporary"
I'm reverting this on principle, since it didn't get the Phabricator
approval I thought it had (only an informal LGTM). Will re-apply once
it has been properly approved.

This reverts commit e1bfeb6bcc.
2023-09-11 23:44:50 +00:00
Vitaly Buka
903008d56c [test][hwsasan] Invert enable_aliases check
For some reasons enable_aliases is not set when we
LLVM_ENABLE_RUNTIMES=compiler-rt instead of LLVM_ENABLE_PROJECTS.
2023-09-11 16:26:34 -07:00
Alexey Bader
a2e2f471c5 [Clang][Docs] Fix typo in clang-offload-packager documentation
Fixed formatting of the section violating 80-char line limit.
2023-09-11 16:24:37 -07:00
Konstantin Varlamov
881718857f [libc++][ranges] Fix a split_view test accidentally using lazy_split 2023-09-11 16:17:34 -07:00
Christopher Di Bella
e1bfeb6bcc adds __reference_constructs_from_temporary
This is information that the compiler already has, and should be exposed
so that the library doesn't need to reimplement the exact same
functionality.

Differential Revision: https://reviews.llvm.org/D135341
2023-09-11 23:14:08 +00:00
yinying-lisa-li
c3160f86e7
[mlir][sparse] Fix bug in new syntax parser (#66024)
Currently, dimlvlmap with identity affine map will be treated as empty
affine map. But the new syntax would treat it as an actual identity
affine map such as {d0} -> {d0}. This mismatch could raise an error when
we are comparing sparse encodings.
2023-09-11 19:13:15 -04:00
Amir Ayupov
7b750943d7 [BOLT][NFC] Speedup YAML profile processing
Reduce YAML profile processing times:
- preprocessProfile: speed up buildNameMaps by replacing ProfileNameToProfile
  mapping with ProfileFunctionNames set and ProfileBFs vector.
  Pre-look up YamlBF->BF correspondence, memoize in ProfileBFs.
- readProfile: replace iteration over all functions in the binary by iteration
  over profile functions (strict match and LTO name match).

On a large binary (1.9M functions) and large YAML profile (121MB, 30k functions)
reduces profile steps runtime:
pre-process profile data: 12.4953s -> 10.7123s
process profile data: 9.8195s -> 5.6639s

Compared to fdata profile reading:
pre-process profile data: 8.0268s
process profile data: 1.0265s
process profile data pre-CFG: 0.1644s

Reviewed By: #bolt, maksfb

Differential Revision: https://reviews.llvm.org/D159460
2023-09-11 16:07:57 -07:00
Amir Ayupov
ffef4fe0db [BOLT][NFC] Use formatv in DataAggregator/DataReader prints
Reviewed By: #bolt, maksfb

Differential Revision: https://reviews.llvm.org/D154120
2023-09-11 16:01:02 -07:00
erichkeane
bf06f149f6 Fix a few messed up links in the ReleaseNotes 2023-09-11 15:32:16 -07:00
Fangrui Song
ea8ab49166 [test] debug-info-correlate.ll requires an ELF target triple
The test only applies to ELF. On Linux, when a default target triple is, say,
Mach-O, the test should be excluded as well.
2023-09-11 15:18:32 -07:00
Fangrui Song
cfc1a87878 [test] Change llc -march= to -mtriple= & llvm-mc -arch= to -triple=
Similar to 806761a762
2023-09-11 15:11:01 -07:00
Fangrui Song
252c42354e [test] Change llvm-mc -arch= to -triple=
The issue is uncovered by #47698: for assembly files, -triple= specifies the
full target triple while -arch= merely sets the architecture part of the default
target triple, leaving a target triple which may not make sense, e.g.
riscv64-apple-darwin.

Therefore, -arch= is error-prone and not recommended for tests. The issue has
been benign as we recognize $unknown-apple-darwin as ELF instead of rejecting it
outrightly.

Due to the nature of the issue, we don't see the issue in tests using
architectures that any of Mach-O/COFF/XCOFF supports.
2023-09-11 14:51:50 -07:00
Fangrui Song
806761a762 [test] Change llc -march= to -mtriple=
The issue is uncovered by #47698: for IR files without a target triple,
-mtriple= specifies the full target triple while -march= merely sets the
architecture part of the default target triple, leaving a target triple which
may not make sense, e.g. riscv64-apple-darwin.

Therefore, -march= is error-prone and not recommended for tests without a target
triple. The issue has been benign as we recognize $unknown-apple-darwin as ELF instead
of rejecting it outrightly.
2023-09-11 14:42:37 -07:00
Vitaly Buka
f665700647 [test][hwasan] Relax test condition
The test is flaky after Kernel upgrade from 6.0 to 6.5.
2023-09-11 14:40:40 -07:00
Vitaly Buka
aaf87dd2ae [test][hwasan] Disable test failing on x86_64 with no -lstdc++ 2023-09-11 14:34:30 -07:00
Valentin Clement (バレンタイン クレメン)
973ca4e4a2
[flang] Call finalization on empty type (#66010)
According to 7.5.6.3 point 3, finalization occurs when

> A nonpointer, nonallocatable object that is not a dummy argument or
function result is finalized immediately before it would become
undefined due to execution of a RETURN or END statement (19.6.6, item
(3)).

We were not calling the finalization on empty derived-type. There is no
such restriction so this patch updates the code so the finalization is
called for empty type as well.
2023-09-11 14:34:21 -07:00
Nico Weber
e6e69f3bd4 [cfi-verify tests]: Skip two x86-only tests if x86 is not enabled
With this, check-llvm passes on an arm mac if x86 isn't in
LLVM_TARGETS_TO_BUILD.

This pattern to skip the tests if x86 isn't enabled is used
in every other test in this file.
2023-09-11 14:31:39 -07:00
Arthur Eubanks
238a1ef44f [test] Add x86-registered-target to amdgpu_throw_trap.cpp 2023-09-11 14:30:12 -07:00
Matthias Braun
b30c9c9378 LoopUnrollRuntime: Add weights to all branches
Make sure every conditional branch constructed by `LoopUnrollRuntime`
code sets branch weights.

- Add new 1:127 weights for the conditional jumps checking whether the
  whole (unrolled) loop should be skipped in the generated prolog or
  epilog code.
- Remove `updateLatchBranchWeightsForRemainderLoop` function and just
  add weights immediately when constructing the relevant branches. This
  leads to simpler code and makes the code more obvious as every call
  to `CreateCondBr` now has a `BranchWeights` parameter.
- Rework formula for epilogue latch weights, to assume equal
  distribution of remainders and remove `assert` (as I was able to
  reach this code when forcing small unroll factors on the commandline).

Differential Revision: https://reviews.llvm.org/D158642
2023-09-11 14:23:29 -07:00
Lang Hames
b8ede3ba33 [ORC] Fix implicit conversion warning due to 5293109774.
This should fix the warning seen in
https://lab.llvm.org/buildbot/#/builders/13/builds/39980/steps/6/logs/stdio
2023-09-11 14:12:51 -07:00
Stella Laurenzo
7055df7b4f
[mlir] Make it possible to build a DenseResourceElementsAttr from untyped memory. (#66009)
Exposes the existing `get(ShapedType, StringRef, AsmResourceBlob)`
builder publicly (was protected) and adds a CAPI
`mlirUnmanagedDenseBlobResourceElementsAttrGet`.

While such a generic construction interface is a big help when it comes
to interop, it is also necessary for creating resources that don't have
a standard C type (i.e. f16, the f8s, etc).

Previously reviewed/approved as part of https://reviews.llvm.org/D157064
2023-09-11 14:10:03 -07:00
Nico Weber
cc2013061e Revert "[Driver] Properly report error for unsupported powerpc darwin/macos triples"
This reverts commit 9f77facfce.

The change unintentionally changed lots of codegen, see
https://github.com/llvm/llvm-project/issues/47698#issuecomment-1714548640

Also revert a follow-up:
This reverts commit b40a5bead2.
2023-09-11 14:08:59 -07:00
Yaxun (Sam) Liu
f2a1331a01
[CUDA][HIP] Do not mark extern shared var (#65990)
Fixes: https://github.com/llvm/llvm-project/issues/65806

Currently clang put extern shared var ODR-used by host device functions
in global var __clang_gpu_used_external. This behavior was due to
https://reviews.llvm.org/D123441. However, clang should not do that for
extern shared vars since their addresses are per warp, therefore cannot
be accessed by host code.
2023-09-11 17:04:55 -04:00
Walter Erquinigo
a2a9918a85
[lldb-vscode] Make descriptive summaries and raw child for synthetics configurable (#65687)
"descriptive summaries" should only be used for small to medium binaries
because of the performance penalty the cause when completing types. I'm
defaulting it to false.
Besides that, the "raw child" for synthetics should be optional as well.
I'm defaulting it to false.

Both options can be set via a launch or attach config, following the
pattern of most settings. javascript extension wrappers can set these
settings on their own as well.
2023-09-11 17:00:01 -04:00
Razvan Lupusoru
e070ea47a9
[flang][openacc] Enable lowering support for OpenACC atomic operations (#65776)
Since the OpenACC atomics specification is a subset of OpenMP atomics,
the same lowering implementation can be used. This change extracts out
the necessary pieces from the OpenMP lowering and puts them in a shared
spot. The shared spot is a header file so that each implementation can
template specialize directly.

After putting the OpenMP implementation in a common spot, the following
changes were needed to make it work for OpenACC:
* Ensure parsing works correctly by avoiding hardcoded offsets.
* Templatize based on atomic type.
* The checking whether it is OpenMP or OpenACC is done by checking for
OmpAtomicClauseList (OpenACC does not implement this so we just
templatize with void). It was preferable to check this instead of atomic
type because in some cases, like atomic capture, the read/write/update
implementations are called - and we want compile time evaluation of
these conditional parts.
* The memory order and hint are used only for OpenMP.
* Generate acc dialect operations instead of omp dialect operations.
2023-09-11 13:58:10 -07:00
Fangrui Song
d1b418f552 [ELF] Reset two member variables in Ctx::reset
Otherwise they are dangling if lldMain is called more than once.
2023-09-11 13:51:01 -07:00
MaheshRavishankar
fd8349cdb3
[mlir][Linalg] Move linalg.fill -> linalg.pack pattern into fill canonicalization patterns. (#66002)
This pattern fits better with the other canonicalization patterns that
exist for `linalg.fill`.
2023-09-11 13:41:38 -07:00
Valentin Clement (バレンタイン クレメン)
8bc676c2ec
[flang][openacc] Lower acc cache directive (#65673)
The cache directive is attached directly to the acc.loop operation when
the directive appears in the loop. When it appears before a loop, the
OpenACCCacheConstruct is saved and attached when the acc.loop is
created.

Directive that cannot be attached to a loop are silently discarded. 

Depends on #65521
2023-09-11 13:38:21 -07:00
Valentin Clement (バレンタイン クレメン)
996171a412
[mlir][openacc] Model acc cache directive as data entry operands on acc.loop (#65521)
The `cache` directive may appear at the top of (inside of) a loop. It
specifies array elements or subarrays that should be fetched into the
highest level of the cache for the body of the loop.

The `cache` directive is modeled as a data entry operands attached to
the acc.loop operation.
2023-09-11 13:38:03 -07:00
Fabian Mora
1828deb752
[mlir][gpu] Deprecate gpu::Serialization* passes. (#65857)
Deprecate the `gpu-to-cubin` & `gpu-to-hsaco` passes in favor of the
`TargetAttr` workflow. This patch removes remaining upstream uses of the
aforementioned passes, including the option to use them in `mlir-opt`. A
future patch will remove these passes entirely.

The passes can be re-enabled in `mlir-opt` by adding the CMake flag: `-DMLIR_ENABLE_DEPRECATED_GPU_SERIALIZATION=1`.
2023-09-11 16:32:15 -04:00
Vitaly Buka
4ee7cf72a3
[sanitizer] Change return type of __sanitizer_symbolize_demangle to bool (#65991)
To match other internal symbolizer functions.

This makes harder to distighush small buffer from a different failure,
but we has the same problem for the rest of the lib.

Still we use 16k buffer so it should be enough most of the time.
We can fix all function togerher if future, if needed.
2023-09-11 13:27:01 -07:00
Mehdi Amini
8c2bff1ab9
Lazy initialize diagnostic when handling MLIR properties (#65868)
Instead of eagerly creating a diagnostic that will be discarded in the
normal case, switch to lazy initialization on error.
2023-09-11 13:22:35 -07:00
Vitaly Buka
16a2aa3267 [test][tsan] Disable flaky test on PPC
COMPILER_RT_DEBUG was just added to sanitizer-ppc64le-linux, and this
test is already broken there.
2023-09-11 13:19:35 -07:00
Philip Reames
5352c79398
[RISCV] Add a combine to form masked.load from unit strided load (#65674)
Add a DAG combine to form a masked.load from a masked_strided_load
intrinsic with stride equal to element size. This covers a couple of
extra test cases, and allows us to simplify and common some existing
code on the concat_vector(load, ...) to strided load transform.

This is the first in a mini-patch series to try and generalize our
strided load and gather matching to handle more cases, and common up
different approaches to the same problems in different places.
2023-09-11 13:01:14 -07:00
walter erquinigo
c154ba8abe [LLDB][NFC] Add the mojo language to Language::GetPrimaryLanguage
This doesn't change the current behavior of the function, but the explicit declaration looks cleaner.
2023-09-11 15:25:05 -04:00
Jeremy Morse
e54277fa10 [NFC][RemoveDIs] Use iterators over inst-pointers when using IRBuilder
This patch adds a two-argument SetInsertPoint method to IRBuilder that
takes a block/iterator instead of an instruction, and updates many call
sites to use it. The motivating reason for doing this is given here [0],
we'd like to pass around more information about the position of debug-info
in the iterator object. That necessitates passing iterators around most of
the time.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939

Differential Revision: https://reviews.llvm.org/D152468
2023-09-11 20:01:19 +01:00
Nick Desaulniers
d7acc6e23f [InlineAsm] fix msvc warning
Link: https://github.com/llvm/llvm-project/pull/65649#issuecomment-1714309236
2023-09-11 11:25:05 -07:00
Kazu Hirata
232ab04812 [AsmPrinter] Fix an unused variable warning
This patch fixes:

  llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp:109:10: error: unused
  variable 'Ret' [-Werror,-Wunused-variable]
2023-09-11 11:24:50 -07:00
Siva Chandra
eb06125604
[libc][NFC] Eliminate the internal header library target. (#65837)
The internal header library target with name suffix `.__header_library`
has been removed as it serves no purpose now. It was added to make older
versions of CMake happy.
2023-09-11 11:22:33 -07:00
Louis Dionne
f3c2a3de84
[libc++] Mark static variables of locale::id as constinit (#65783)
The dylib contains multiple global variables of type locale::id. Those
can be marked as constinit to make it clear that static initialization
is performed.
2023-09-11 14:22:12 -04:00
Vy Nguyen
595cd45a66 [lld-macho][nfc]Add bounds on sections and subsections check before attempting to dereferencing iterators.
Runnign some tests with asan built of LLD would throw errors similar to the following:

AddressSanitizer:DEADLYSIGNAL
    #0 0x55d8e6da5df7 in operator() /mnt/ssd/repo/lld/llvm-project/lld/MachO/Arch/ARM64.cpp:612
    #1 0x55d8e6daa514 in operator() /mnt/ssd/repo/lld/llvm-project/lld/MachO/Arch/ARM64.cpp:650

Differential Revision: https://reviews.llvm.org/D157027
2023-09-11 14:19:25 -04:00
Louis Dionne
3e24a77a86 [libc++] Use the default initializer for char_type in std::num_get::do_get
This is to fix an error that occurs when the char type is a class type.
Thanks to Yichen Yan for the patch.

Differential Revision: https://reviews.llvm.org/D100005
2023-09-11 14:16:47 -04:00
Alexey Bataev
9a90457a76 [SLP][NFC]Use ArrayReffor operands directly instead of entry/operand number, NFC. 2023-09-11 11:16:13 -07:00
Shoaib Meenai
42d5567683 [libc++abi] Overhaul test_exception_storage.pass.cpp
I'm making a change in this area (https://reviews.llvm.org/D138461), so update the test:
* Add proper synchronization instead of a sleep.
* Avoid some unnecessary size_t casts.
* Spawn the number of hardware threads instead of 10.
* Check that `__cxa_get_globals` and `__cxa_get_globals_fast` return
  the same values.
* Split the test in with-threads and without-threads tests to simplify
  the code.

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

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2023-09-11 14:14:41 -04:00
Louis Dionne
ee2a7bcebf [libc++] Add regression tests for issue #46841 2023-09-11 14:13:30 -04:00
Vitaly Buka
f106b3f135 Revert "[PHIElimination] Handle subranges in LiveInterval updates"
Leaks memory.

This reverts commit 3bff611068.
2023-09-11 11:09:26 -07:00
Fangrui Song
eb81493e95
[llvm-readelf] Add --extra-sym-info (#65580)
GNU readelf introduced --extra-sym-info/-X to display the section name
for --syms (https://sourceware.org/PR30684). Port the feature, which is
currently llvm-readelf only.

For STO_AARCH64_VARIANT_PCS/STO_RISCV_VARIANT_PCS, the Ndx and Name
columns may not be aligned.
2023-09-11 11:08:58 -07:00
Joseph Huber
76af6e77c0
[libc] Manually set the AMDGPU code object version (#65986)
Summary:
There is currently effort to change over the default AMDGPU code object
version https://github.com/llvm/llvm-project/pull/65410. However, this
unfortunately causes problems in the LLVM LibC test suite that leads to
a hang while executing. This is most likely a bug to do with indirect
call optimization, as it can be avoided without optimizations or with
manually preventing inlining in the AMDGPU startup code.

This patch sets the AMDGPU code object version to be four explicitly on
the LibC test suite. This should unblock the efforts to move the default
to 5 without breaking the test suite. This isn't a great solution, but
there is currently some time pressure to get COV5 landed and this seems
to be the easiest solution.
2023-09-11 13:07:56 -05:00
Vitaly Buka
2344a72dd6 [test][sanitizer] Check LINKER_IS_LLD to detect LLD
This enables some tests requiring LLD when we test
compiler-rt activated with LLVM_ENABLE_RUNTIMES.
2023-09-11 11:02:01 -07:00