[OpenMP][ompd] Fix compare wraparound and improve test
The test checks for an "incomplete" return value, which can only happen
for a thread list, not a single value. This used to work because of the
unsigned int wraparound in the corresponding code check, which
incorrectly yielded the "incomplete" return value.
[LTO] Keep the remarks of every partition with parallel codegen
With ParallelCodeGenParallelismLevel > 1, splitCodeGen compiles each
partition in a fresh LTOLLVMContext. Those contexts have no remark
streamer, so code generation remarks (asm-printer, prolog-epilog,
regalloc, ...) never reach the -pass-remarks-output file.
Add LLVMRemarkBuffer, which streams the remarks of one context into an
in-memory bitstream buffer and later emits them through the serializer
of another context's remark file. splitCodeGen gives each partition a
buffer with the remark settings from lto::Config and, once all
partitions are done, emits them in partition order, so the file does
not depend on thread scheduling. Remarks are copied as they are;
RemarkLinker would sort and deduplicate them and drop the ones without
a debug location.
LTOCodeGenerator now stores its -lto-pass-remarks-* options in its
Config, so llvm-lto -j gets the partition remarks too.
[4 lines not shown]
[analyzer] Remove the SimpleStream demo checker from the CSA checkers (#238415)
The `SimpleStreamChecker` is a demo checker that was implemented for the
2012 LLVM Developers' Meeting talk. The checker served as an educational
checker for newcomers, students, etc. to the Clang Static Analyzer.
Since then there has been a lots of improvements within CSA and the
`SimpleStreamChecker` lost its purpose because there are other more
modern checkers that are great source for newcomers to learn the
fundamentals. By removing the checker users do not lose anything since
the `StreamChecker` already covers what `SimpleStreamChecker` has
covered.
Discussion about the removal of this checker started in
https://github.com/llvm/llvm-project/pull/230288
[InstCombine] Canonicalise Vector Shuffle that clears upper bits
Currently, shuffle vectors that are equivalent to preserving lane 0 and clearing the uppers lanes of a vector result in different shuffle vectors and masks
Recognise and canonicalise the shuffleVectors to the same form allowing for easier recognition in the backend
[LTO] Keep the remarks of every partition with parallel codegen
With ParallelCodeGenParallelismLevel > 1, splitCodeGen compiles each
partition in a fresh LTOLLVMContext. Those contexts have no remark
streamer, so code generation remarks (asm-printer, prolog-epilog,
regalloc, ...) never reach the -pass-remarks-output file.
Add LLVMRemarkBuffer, which streams the remarks of one context into an
in-memory bitstream buffer and later emits them through the serializer
of another context's remark file. splitCodeGen gives each partition a
buffer and, once all partitions are done, emits them in partition order,
so the file does not depend on thread scheduling. Remarks are copied as
they are; RemarkLinker would sort and deduplicate them and drop the ones
without a debug location.
Add -lto-partitions to llvm-lto2, the counterpart of lld's
--lto-partitions, so the parallel path can be tested.
Assisted-by: Claude Code (Claude Opus 5.5)
[CIR][CUDA] Emit device variables referenced only by host code (#236392)
CIR can omit static CUDA/HIP device and constant variables when they are
referenced only by host code. For example, a host function may pass a
device variable’s address to a device-symbol lookup API even though no
device function uses it. CIR skips host function bodies during device
compilation, so those references do not cause the variables to be
emitted.
Add these variables to the list that CIR emits at the end of
compilation, matching classic Clang code generation. Preserve the
recorded host references so the compiler can make the variables
accessible to host code and prevent them from being removed as unused.
Add a test checking that the device variables are emitted, the host-only
function remains absent, and a variable referenced only through `sizeof`
remains absent.
---------
Co-authored-by: Steffen Larsen <sholstla at amd.com>
[Offload][test] Fix flaky kernel_crash_async.c
The three nowait target regions can launch in any order. Since only the
last one fails, we can only be sure to see its log record. The other
kernels might never run due to the crash.
Claude assisted with this patch.
[orc-rt] Add JITDylibLookupFlags argument to lookupInJITDylib (#240336)
sps::lookupInJITDylib had no way to say whether the lookup should match
all of a JITDylib's symbols, or only its exported symbols.
This commit adds a JITDylibLookupFlags enum (mirroring LLVM ORC's enum
of the same name) and a JITDylibLookupFlags parameter to
lookupInJITDylib. The flags are sent to the controller as a new argument
between the JITDylib key and the lookup set, using a new
SPSJITDylibLookupFlags tag that serializes as a bool: MatchAllSymbols as
true, MatchExportedSymbolsOnly as false.
[lld][ELF] Fix .note.gnu.property values in ld -b binary invocations (#238541)
fixes: #237529
ld.lld -b binary generated bogus .note.gnu.property values because in
such invocations there are no ELF object files to AND the `-1` initial
value with. Use `0` as a starting value in that case.
[mlir][vector] Add comments and unify tests post #234448 (#240320)
Minor tweaks post https://github.com/llvm/llvm-project/pull/234448:
* Simplifies the comment in the implementation file.
* Adds comments in the test file.
* Unifies the tests to use <16x16> and <2x8x8>, as oppoed to <16x16> and
<1x8x8x>.
[mlir][VectorToSCF] Decline transfer ops masked by vector.mask (#221307)
The transfer op patterns in `convert-vector-to-scf` unpack a
`vector.transfer_read`/`vector.transfer_write` into a loop, a buffer and
lower-rank transfer ops, but never check whether the op sits inside a
`vector.mask`. In that case all of it lands in the mask region and the
pass fails:
```mlir
func.func @w(%v: vector<4x8xf32>, %m: vector<4x8xi1>, %mem: memref<?x?xf32>) {
%c0 = arith.constant 0 : index
vector.mask %m { vector.transfer_write %v, %mem[%c0, %c0] : vector<4x8xf32>, memref<?x?xf32> } : vector<4x8xi1>
return
}
```
```
error: 'vector.mask' op expects only one operation to mask
```
[20 lines not shown]
[libc] Use a syscall wrapper for setsid
This PR move setsid behind the centralized syscall wrappers, following libc/docs/dev/syscall_wrapper_refactor.md.
[libc] Use a syscall wrapper for pwrite
This PR move pwrite behind the centralized syscall wrappers, following libc/docs/dev/syscall_wrapper_refactor.md.
[libc] Use a syscall wrapper for pread
This PR move pread behind the centralized syscall wrappers, following libc/docs/dev/syscall_wrapper_refactor.md.
[libsycl][lit] Fix PATH setup on Windows (#238826)
On Windows, `LLVMOffload.dll` is in `libsycl_libs_dir`, so append that
to the path in test setup.
Also, fix the `libsycl_libs_dir` logic to not be hardcoded for linux.
This fixes two issues when building on Windows, and the tests run and
all pass after this change.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>