500402 Commits

Author SHA1 Message Date
Petr Hosek
ed155f3f23
[runtimes] Correctly apply libdir subdir for multilib (#93354)
We weren't applying the libdir subdir to header directories but this is
necessary for correctness when building e.g. ASan variant. This change
also updates path construction logic accross all runtimes and ensures
they're consistent.
2024-05-31 11:48:45 -07:00
RoseZhang03
435e5c10b0
[libc] restored original no_stack_protector syntax (#94005)
forward fix for #93620

-GCC doesn't recognize [[clang:: ']] prefix, so restored the original
__attribute__ syntax
2024-05-31 11:36:46 -07:00
Daniel Thornburgh
e79c080655
[cmake] Allow multiple LibEdit_LIBRARIES (#93896)
If built statically, `libedit` may have a private static library
dependency on a provider of the `terminfo` API (e.g., `ncurses`). This
means that multiple libraries would need to be provided as the value for
`LibEdit_LIBRARIES`, but the current implementation of `FindLibEdit`
precludes this. This PR allows a list to be passed to
`LibEdit_LIBRARIES`.
2024-05-31 11:36:33 -07:00
Joseph Huber
e19565c5c4
[Offload][AMDGPU] Only allow memory pool access to valid agents (#93969)
Summary:
The logic since the next-gen plugins was added was that every single
agent would get access to a memory pool we allocated. This is necessary
for things like fine-grained memory and to faciliate d2d copied.
However, there are cases where an agent cannot legally access a memory
pool. We have a debug check for this, but it would always be triggered
in these situations because both uses of the function simply passed
every agent. This patch changes the behavior by only enabling memory
pool access for agents that can access the memory pool.
2024-05-31 13:34:40 -05:00
Valentin Clement
a9664407d7
[flang][openmp] Fix test after PR #93981 2024-05-31 11:21:30 -07:00
Dave Lee
5a02a9a2e6
[lldb] Improve identification of Dlang mangled names (#93881)
Reduce false positive identification of C names as Dlang mangled names. This happens 
when a C function uses the prefix `_D`.

The [Dlang ABI](https://dlang.org/spec/abi.html#name_mangling) shows that mangled names 
have a length immediately following the `_D` prefix. This change checks for a digit 
after the `_D` prefix, when identifying the mangling scheme of a symbol. This doesn't 
prevent false positives entirely, but does make it less likely.
2024-05-31 11:20:23 -07:00
Fangrui Song
b06e736982 [MC] Speed up AttemptToFoldSymbolOffsetDifference in the absence of MCAsmLayout
The `FA < FB` check added by https://reviews.llvm.org/D153096 is slow.
Compute an informal layout order to speed up computation when
`AttemptToFoldSymbolOffsetDifference` is repeatedly called for the same
section.

Commit 9500a5d02e23f9b43294e5f662ac099f8989c0e4 ("[MC] Make UseAssemblerInfoForParsing mostly true")
exposed this performance pitfall, which was mitigated by
`setUseAssemblerInfoForParsing(false)` workarounds (e.g. commit
245491a9f384e4c53421196533c2a2b693efaf8d). The workaround can be removed
now.
2024-05-31 11:09:31 -07:00
Paul T Robinson
3b81d9d91b
Reapply "[CUDA] Fix a couple of driver tests that really weren't bein… (#94000)
…g run" (#93988)"

This reverts commit 6416958067179c2987af0ef4568cd57f98b7e347. 
Fix bots by using different options.
2024-05-31 14:07:01 -04:00
Erick Velez
f46d1463b8
[clang] require template arg list after template kw (#80801)
Require a template argument list after an identifier prefixed by the
template keyword. Introduced by [CWG
96](https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#96),
but the current wording of
[[temp.names]p5](https://eel.is/c++draft/temp.names#6) was introduced in
[P1787R6](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1787r6.html),
and became [temp.names]p6 somewhere else.

Fixes #53095

---------

Co-authored-by: Shafik Yaghmour <shafik.yaghmour@intel.com>
2024-05-31 11:02:21 -07:00
Luke Lau
458a31562a [RISCV] Add more tests for strided gathers with scalar offsets. NFC 2024-05-31 18:58:34 +01:00
Aaron Ballman
68a64812d7 [C11] Claim conformance to N1464
That's on the CMPLX macros which Clang supports via __builtin_complex.
2024-05-31 13:52:13 -04:00
Valentin Clement (バレンタイン クレメン)
c232137d93
[flang][HLFIR] compute elemental function result length parameters (#93983)
Prepare the argument and map them to their corresponding dummy symbol in
order to lower the specification expression of the function result.

Extract the preparation of arguments according to the interface to its
own function to be reused.

It seems there is no need to conditionally compute the length on the
input since all the information comes from the CharBoxValue or the
descriptor for cases where the number of element could be 0.
2024-05-31 10:49:58 -07:00
Valentin Clement (バレンタイン クレメン)
9482af3dde
[flang] Carry over BIND(C) information to fir.call (#93981)
The BIND(C) attribute attached to a function can be lost when we do
indirect call. This information might be useful for codegen that have
specific ABI. This patch carry over the BIND(C) information to the
fir.call operation.
2024-05-31 10:49:30 -07:00
Keith Smiley
34599266b2
[bazel] Port #90972 (#93996) 2024-05-31 10:43:15 -07:00
jimingham
1e81b67925
[lldb] FormatManager::GetPossibleMatches assumes all ValueObjects have targets. (#93880)
But one made in a situation where that's impossible might only have an
error, and no symbol context, so that's not necessarily true. Check for
the target's validity before using it.

Fixes issue #93313
2024-05-31 10:43:05 -07:00
Keith Smiley
7caa812f27
[bazel] Port #92819 take 2 (#93995)
I missed this since it was still broken because of another patch
https://github.com/llvm/llvm-project/pull/93996
2024-05-31 10:42:53 -07:00
Keith Smiley
13b6284b93
[bazel] Port #92819 (#93992) 2024-05-31 10:36:05 -07:00
Kazu Hirata
37f3023487
[memprof] Use uint32_t for linear call stack IDs (#93924)
This patch switches to uint32_t for linear call stack IDs as uint32_t
is sufficient to index into the call stack array.
2024-05-31 10:29:14 -07:00
David Stone
41ddf128ea
Remove dangling conversion to optional<T> & (#93385) 2024-05-31 19:23:14 +02:00
Nico Weber
3b79c823f6 [gn] port a65771fce4a2 2024-05-31 13:22:57 -04:00
RoseZhang03
07bd439457
[libc] added quick_exit function (#93620)
- In /libc/src/__support/ OSUtil, changed quick_exit to just exit, and
put in namespace
LIBC_NAMESPACE::internal.
- In /libc/src/stdlib added quick_exit
- Added test files for quick_exit
2024-05-31 10:19:10 -07:00
Paul T Robinson
6416958067
Revert "[CUDA] Fix a couple of driver tests that really weren't being run" (#93988)
Reverts llvm/llvm-project#93960

The change to offloading-interoperability.c broke many bots.
2024-05-31 13:14:20 -04:00
Paul T Robinson
97c34eb8df
[CUDA] Fix a couple of driver tests that really weren't being run (#93960) 2024-05-31 12:47:37 -04:00
Konstantin Zhuravlyov
775f1cd34d
AMDGPU: Add gfx12-generic target (#93875) 2024-05-31 12:46:44 -04:00
Nikita Popov
57eb92ea6c
[llvm-objdump][test] Relax directory prefix check in source-interleave test (#93789)
This test currently has an explicit regex for characters that are
supposedly valid inside a directory name -- however, it does not
actually cover all necessary characters. For example, this test fails if
the path contains a tilde.

Instead, replace this with a wildcard.
2024-05-31 18:46:15 +02:00
Fangrui Song
7b6a89f346
[ELF] Detect convergence of output section addresses
Some linker scripts don't converge. https://reviews.llvm.org/D66279
("[ELF] Make LinkerScript::assignAddresses iterative") detected
convergence of symbol assignments.

This patch detects convergence of output section addresses. While input
sections might also have convergence issues, they are less common as
expressions that could cause convergence issues typically involve output
sections and symbol assignments.

GNU ld has an error `non constant or forward reference address expression for section` that
correctly rejects
```
SECTIONS {
  .text ADDR(.data)+0x1000 : { *(.text) }
  .data : { *(.data) }
}
```

but not the following variant:
```
SECTIONS {
  .text foo : { *(.text) }
  .data : { *(.data) }
  foo = ADDR(.data)+0x1000;
}
```

Our approach consistently rejects both cases.

Link: https://discourse.llvm.org/t/lld-and-layout-convergence/79232

Pull Request: https://github.com/llvm/llvm-project/pull/93888
2024-05-31 09:31:15 -07:00
Victor Perez
98d5d3448d
[MLIR][GPU-LLVM] Define -convert-gpu-to-llvm-spv pass (#90972)
Define pass for GPU to LLVM conversion for SPIR-V backend tool ingest.

Supported operations:

- `gpu.block_id`
- `gpu.global_id`
- `gpu.block_dim`
- `gpu.thread_id`
- `gpu.grid_dim`
- `gpu.barrier`
- `gpu.shuffle`

---------

Signed-off-by: Victor Perez <victor.perez@codeplay.com>
2024-05-31 17:47:53 +02:00
erichkeane
85ea1aaf15 [OpenACC] Fix device_type clause appertainment
Seemingly I forgot to implement the appertainment checks when doing the
original device_type implementation, so we fell through to the 'not
implemented' section of the diagnostics.

This patch corrects the appertainment, so that we disallow it correctly.
2024-05-31 08:43:48 -07:00
Ivan Kosarev
ca0dae0d6b
[AMDGPU][NFC] Eliminate GCNPredicateControl. (#93964)
Removes ~100K instances of SIAssemblerPredicate and VIAssemblerPredicate
fields from instruction records.
2024-05-31 16:28:43 +01:00
Vladislav Dzhidzhoev
5e423f1c51 [lldb][test] Add --sysroot argument to dotest.py
This argument allows to set specific sysroot pass which will be used for
building LLDB API test programs.
It might come in handy for setting up cross-platform remote runs of API
tests on Windows host.

It can be useful for cross-compiling LLDB API tests. The argument can be
set using `LLDB_TEST_USER_ARGS` argument:
```
cmake ...
-DLLDB_TEST_USER_ARGS="...;--sysroot;C:\path\to\sysroot;..."
...
```
2024-05-31 17:24:14 +02:00
Valentin Clement (バレンタイン クレメン)
e6bef08e22
[flang] Avoid double free in bufferize pass (#93922)
In some cases where we have an `hlfir.no_reassoc` operation, the
bufferization pass could not earse the hlfir.destroy op during the
`hlfir.associate` op conversion as show in the example below.

```
func.func @double_free(%arg0: !fir.boxchar<1>) {
  %c5 = arith.constant 5 : index
  %true = arith.constant true
  %0 = hlfir.as_expr %arg0 move %true : (!fir.boxchar<1>, i1) -> !hlfir.expr<!fir.char<1,?>>
  %1 = hlfir.no_reassoc %0 : !hlfir.expr<!fir.char<1,?>>
  %2:3 = hlfir.associate %1 typeparams %c5 {adapt.valuebyref} : (!hlfir.expr<!fir.char<1,?>>, index) -> (!fir.boxchar<1>, !fir.ref<!fir.char<1,?>>, i1)
  fir.call @noop(%2#0) : (!fir.boxchar<1>) -> ()
  hlfir.end_associate %2#1, %2#2 : !fir.ref<!fir.char<1,?>>, i1
  hlfir.destroy %0 : !hlfir.expr<!fir.char<1,?>>
  return
} 
func.func private @noop(!fir.boxchar<1>)
```

The bufferization pass is looking at uses of its source `%1` that is the
result of an `hlfir.no_reassoc` operation. In order to avoid double free
generation, also look at the indirection in presence of
`hlfir.no_reassoc`.
2024-05-31 08:23:27 -07:00
Vladislav Dzhidzhoev
c5e417a812 [lldb] Fix 'session save' command on Windows
1. Use dashes (-) instead of colons (:) as time separator in a session log
file name since Windows doesn't support saving files with names containing
colons.

2. Temporary file creation code is changed in the test:
On Windows, the temporary file should be closed before 'session save'
writes session log to it. NamedTemporaryFile() can preserve the file
after closing it with delete_on_close=False option.
However, this option is only available since Python 3.12. Thus
mkstemp() is used for temporary file creation as the more compatible
option.
2024-05-31 17:18:21 +02:00
Luke Lau
fb87e11e72 [RISCV] Add test case for strided scatter with scalar offset. NFC 2024-05-31 15:49:16 +01:00
Kirill Podoprigora
6163775077
[clang] `README.txt`: Replace the link to the old bug tracker with the new one. (#93878) 2024-05-31 10:43:42 -04:00
Craig Topper
edf4e02906
[RISCV] Support multiple levels of truncates in combineTruncToVnclip. (#93752)
We can use multiple vnclips to saturate an i32 value into an i8 value.
2024-05-31 09:09:12 -05:00
David Truby
5c7f7cc4de
[flang] Fix exec.f90 test on LIT integrated shell (#93961)
The exec.f90 test sets an environment variable for a specific command
directly
rather than using env, which doesn't work on shells that don't support
this
syntax, most notably the LIT integrated shell. This patch simply adds
env so
that this works on the integrated shell.
2024-05-31 15:03:44 +01:00
Simon Pilgrim
b52962d1b8 [X86] LowerVSELECT - split v16i16/v32i8 pre-AVX2 VSELECT ops if enough of the operands are free to split.
Often on AVX1 we're better off consistently using 128-bit instructions, so recognise when the operands are loads that can be freely/cheaply split - ideally this functionality needs to be moved to isFreeToSplitVector but we're using it in a few places where we don't want to split loads yet.

Based off a regression reported after #92794
2024-05-31 14:43:10 +01:00
Florian Hahn
654cd94629
[VPlan] Unconditionally run optimizeForVFAndUF.
Now that the VPlan for the main vector loop gets cloned in the epilogue
vectorization code path, there optimizeForVFAndUF can be applied
unconditionally.
2024-05-31 06:32:49 -07:00
Nikita Popov
6ee845d240 [IR] Remove handling for removed ConstantExprs (NFC) 2024-05-31 15:03:22 +02:00
Simon Pilgrim
f0e8d003e5 [X86] widen_load-3.ll - add missing nounwind attributes 2024-05-31 13:59:49 +01:00
Elvina Yakubova
765ce86991
[BOLT][DOC] Add script for automatic user guide generation (#93822) 2024-05-31 13:50:51 +01:00
Nikita Popov
37ecd43335 [ExecutionEngine] Remove handling for removed ConstantExprs (NFCI)
These constant expressions no longer exist, so don't handle them.
2024-05-31 14:49:40 +02:00
Elvina Yakubova
23427b808c
[BOLT][NFC] Fix typo in DWARFRewriter.cpp (#93955) 2024-05-31 13:43:20 +01:00
Daniil Kovalev
7acd2c0652
[lld][ELF][AArch64] Support R_AARCH64_GOT_LD_PREL19 relocation (#89592)
With tiny code model, the GOT slot contents can be loaded via `ldr x0,
:got:sym` which corresponds to `R_AARCH64_GOT_LD_PREL19` static
GOT-relative relocation.

See
https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst#static-aarch64-relocations
2024-05-31 14:57:58 +03:00
jeanPerier
f917c396c9
[flang] improve and rename Entity::hasNonDefaultLowerBounds (#93848)
Improve hasNonDefaultLowerBounds to follow box fir.convert. This helps
HLFIR helpers to generate less code when it can be easily deduced that
the fir.box lower bounds were set to ones.

It will help me for SELECT RANK lowering to avoid generating
hlfir.declare with lower bounds inside the RANK CASE (Current situation
would not be incorrect, the lower bounds would be SSA value ending-up
being one, I just want simpler IR).

Renamed to mayHaveNonDefaultLowerBounds since it may still answer yes when
the lower bounds are ones.
2024-05-31 13:41:11 +02:00
Adam Siemieniuk
8f4d5a32ac
[mlir][tensor] Fold unpadding collapse_shape into extract_slice (#93554) 2024-05-31 13:29:40 +02:00
Simon Pilgrim
189efb0fbb [X86] vselect-pcmp.ll - add tests showing poor codegen on AVX1 targets where we have to split/concat 128-bit subvectors
We'd be better off consistently using 128-bit instructions

Based off a regression reported after #92794
2024-05-31 12:29:01 +01:00
Sergey Kachkov
f34dedbf44
[LoopPeel] Support min/max intrinsics in loop peeling (#93162)
This patch adds processing of min/max intrinsics in LoopPeel in the
similar way as it was done for conditional statements: for
min/max(IterVal, BoundVal) we peel iterations where IterVal < BoundVal
for monotonically increasing IterVal; for monotonically decreasing
IterVal we peel iterations where IterVal > BoundVal (strict comparision
predicates are used to minimize number of peeled iterations).
2024-05-31 13:58:10 +03:00
Endre Fülöp
46b3145b7c
[clang][analyzer][NFC] Add test for a limitation of alpha.unix.BlockInCriticalSection checker (#93799)
Updated the documentation in `checkers.rst` to include an example of how
`trylock` function is handled.
Added a new test for a scenario where `pthread_mutex_trylock` is used,
demonstrating the current limitation.
2024-05-31 12:51:14 +02:00
Endre Fülöp
196dca7561
[clang][analyzer][NFC] Improve docs of alpha.unix.BlockInCriticalSection (#93812)
- Enhanced descriptions for blocking and critical section functions
- Added an additional code sample highlighting interleaved C and C++
style mutexes
2024-05-31 12:50:04 +02:00