[AMDGPU] Remove redundant S_AND handling from optimizeVccBranch (#228417)
PR #227729 moved this optimization to SIFoldOperands::tryFoldAndExec
where it is more effective.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
Sync pass name between newPM and legacy for irtranslator (#227425)
The legacy pass name was change to newPM one. This is done for
consistency and having only one spelling for stop-after/before
[clang][analyzer] Diagnose dead stores on parenthesized lvalues (#227176)
This commit fixes that `deadcode.DeadStores` previously failed to diagnose a
dead store when the assigned variable is wrapped in parentheses.
```c
int f(int input) {
int value;
(value) = input;
value = 2;
return value;
}
```
This change was made with assistance of an AI tool (OpenAI Codex), which
implemented the fix (IgnoreParens()) and the test.
I have found the false negative myself (on a real codebase that uses a
code generator) and ran the tests manually.
[compiler-rt] Remove dlsym interceptor and support `-shared-libsan` for CSan
Summary:
Follow the UBSan offload runtime. Offload now resolves HSA through the
global scope, so the `dlsym` interceptor is no longer needed. The real
HSA entry points are still taken from the loaded HSA library rather than
`RTLD_NEXT`, since every DSO with a static runtime exports the same
wrappers and they would otherwise chain back into each other.
Build `libclang_rt.csan.so` with the offload objects folded in. The
exported HSA wrappers report failure when HSA is absent and warn when HSA
was loaded ahead of the runtime. The preinit hook moves to a separate
`csan_offload-preinit` archive for executables.
[Clang] Support `-shared-libsan` for offload CSan
Summary:
Follow the UBSan handling. The shared runtime embeds the HSA
interceptors, so `csan_offload` is only linked with static runtimes and
executables pull in `csan_offload-preinit` to initialize early.
[compiler-rt] Add 'csan' library for the concurrency sanitizer
Summary:
Adds the runtime for the concurrency sanitizer, both CPU and GPU.
Fundamentally, this works using the following pseudocode:
```c
static u64 watchpoints[N]; // Hash-indexed, zero is empty.
// Emitted before the access, so we never trip on our own write.
void check_access(volatile void *addr, u32 size, u32 type) {
// Every access probes. A read conflicts only with a watched write, a
// write conflicts with either.
if (u64 *wp = find_watchpoint(addr, size, type))
consume(wp, this_pc()); // Hand our location to the owner.
if (!should_sample()) // Wave-uniform, 1-in-N chance.
return;
[17 lines not shown]
[Clang] Add support for the `-fsanitize=concurrency` runtime
Summary:
Add the frontend sanitizer kind, function attributes, pass pipeline
integration, predefined macro, driver handling, and documentation for
ConcurrencySanitizer.
[Offload][L0] Add support to print the driver build log (#228022)
The log is printed if the driver reported an error (only the first
lines) or in full if LIBOFFLOAD_LEVEL_ZERO_SHOW_BUILD_LOG env var is
set.
Assisted by Claude.
[CIR][AMDGPU] Use intrinsic type for dpp signature detection (#226921)
This commit modifies the CIR code generation for AMDGPU to use the
intrinsic type for dpp builtin signature detection. This change ensures
that the correct intrinsic type is used when generating code for dpp
operations, instead of relying on hard-coded types.
This should also help simplify the implementation of other future
builtins, such as NVPTX wmma/mma load/store/mma.
Note that this is not an NFC as it changes the signedness in parts of
the builtin signatures. However, that change fits the signature
definitions and the signedness does not carry much meaning for these
builtins either way.
This is a follow-up to #226469.
Assisted-by: Claude Opus 5.5
Signed-off-by: Steffen Holst Larsen <sholstla at amd.com>
[Offload][L0] Remove OMP_INFOTYPE from plugin (#227994)
Remove OpenMP specific debug types and unify everithing under ODBG with
OL debug types in the Level Zero plugin.
Assisted by Claude.
[CIR] Implement device-wide nounwind attribute (#227016)
This commit implements the missing application of nounwind on device
functions and device calls. This leaves out OpenMP, similar to how OGCG
currently does not support it for OpenMP device functions.
---------
Signed-off-by: Steffen Holst Larsen <sholstla at amd.com>
[CIR] Fix address space of string literals (#226996)
This commit fixes the address space of string literals in CIR. The
address space of string literals is determined by the AST type, which is
always the default address space for address space agnostic languages.
The global variable that holds the string literal may live in a
different address space, e.g. OpenCL constant address space or HIP
device address space. Therefore, we need to cast the global variable to
the pointer type of the AST type when emitting a reference to the string
literal.
Assisted-by: Claude Opus 5.5
---------
Signed-off-by: Steffen Holst Larsen <sholstla at amd.com>
[OpenMP] Initialize td_last_tied when an untied task starts (#214320)
An untied task inherits td_last_tied -- the innermost tied task the
thread is bound to -- from the task it suspends. That inheritance only
happened in __kmp_invoke_task(), so any path that made an untied task
the thread's current task without going through it left td_last_tied at
the NULL that __kmp_task_alloc() assigns. This causes a crash when
__kmp_task_is_allowed() dereferences NULL.
Move the inheritance into __kmp_task_start(), before it sets
th_current_task. Besides the if0 path, this also covers a cancelled
untied task, which is never invoked but still releases its dependences
while it is the current task, and the pattern task of an untied
taskloop, which the runtime starts and finishes directly.
Fixes #172938
[lld][LoongArch] Prevent relaxation oscillation for LA.PCRel and CALL (#226713)
Relaxation of pcalau12i+addi (relaxPCHi20Lo12, isInt<22>) and
call36/call30 (relaxMediumCall, isInt<28>) can oscillate: shrinking one
section moves a symbol, which flips isInt<N> for other sites and changes
bytesDropped again.
Follow the same approach as RISCV::relaxCall: after a few passes, do not
allow remove to increase beyond the previous pass's value (cur - delta).
Pass that cap as prevRemove into the two helpers; range checks may still
clear remove (0) when the target goes out of range.
Fixes #226712
net/tac_plus4: Update to F4.0.4.32
Changes since .28:
- Fix buffer length argument to ntop() - Muhammad Muquit
- Fix two missing free()s
- Fix segfault from incorrect pointer returned from value(). Reported
here:
http://www.shrubbery.net/pipermail/tac_plus/2014-January/001384.html
- update autoconf bits for autoconf 2.69
- put tac_plus daemon in sbin, where it ought to be
- fix hdr->datalength handling in dump_nas_pak()
- add -m option to specify the client listen queue max and increase
the default to 64 if the O/S does not define SOMAXCONN
- fix config.h include syntax - David M. Syzdek
- added -U and -Q flags to allow runtime setuid/setgid change - from
from Robert Drake with some alteration
- Make implicit time_t conversions explicit in expire.c - from David M.
Syzdek
[25 lines not shown]