LLVM/project 157413dflang/lib/Semantics resolve-names.cpp

Add taskgraph

"taskgraph" is explicitly mentioned in the data-sharing rules in the spec.
DeltaFile
+1-0flang/lib/Semantics/resolve-names.cpp
+1-01 files

LLVM/project 5ad9cecllvm/lib/Target/RISCV RISCVInstrInfoC.td

[RISCV] NFC: Use the new "let append" TableGen feature to reduce duplication (#198761)

llvm#182382 introduced a language extension to accumulate field values:
“append” concatenates the new value after the current value, whilst
"prepend" concatenates before the existing value. This change uses that
feature to eliminate repetition in the definition of some of the
compressed instructions.

For example, line 267 of RISCVIntrInfoC.td establishes a scope for “`let
Predicates = [HasStdExtZca] in {`”; this scope ends on line 515.
Meanwhile, line 454 wants to add the `IsRV64` predicate for a single
instruction but was forced to duplicate the previous condition as well:
“`let Predicates = [HasStdExtZca, IsRV64] in`”. That’s no longer
necessary since the addition can now be explicit: “`let append
Predicates = [IsRV64] in `”

I‘ve verified that this change has no effect on the TableGen output.

It seems quite likely that this same change could be made in some of the
other RISC-V TableGen source files…
DeltaFile
+22-36llvm/lib/Target/RISCV/RISCVInstrInfoC.td
+22-361 files

LLVM/project f755811libc/include/llvm-libc-types EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.h CMakeLists.txt

[libc][nfc] Include header for EFIAPI macro (#198876)

This file uses `EFIAPI`, but it's not included. It looks like
compilation currently succeeds because `EFI_SYSTEM_TABLE.h` is the only
header that includes `EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.h`, and it happens
to include `EFIAPI-macros.h` indirectly.

We will be adding Bazel rules for this file, and Bazel typically
requires all headers to be compilable on their own. This build error is
theoretically reproducable by running cmake build with
`-DCMAKE_VERIFY_INTERFACE_HEADER_SETS` if we had the appropriate
FILE_SETs defined.
DeltaFile
+1-0libc/include/llvm-libc-types/EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.h
+1-0libc/include/llvm-libc-types/CMakeLists.txt
+2-02 files

LLVM/project 8b1dbe5clang/test/CIR/CodeGen new-array-in-ternary.cpp, lldb/tools/lldb-dap/extension package-lock.json

Merge branch 'main' into users/ilovepi/instrumentor-nondet
DeltaFile
+2,504-1,285lldb/tools/lldb-dap/extension/package-lock.json
+272-176mlir/lib/Dialect/Vector/Transforms/VectorDropLeadUnitDim.cpp
+281-149mlir/test/Dialect/Vector/vector-dropleadunitdim-transforms.mlir
+136-153mlir/utils/vscode/package-lock.json
+180-0clang/test/CIR/CodeGen/new-array-in-ternary.cpp
+56-38llvm/lib/Transforms/Vectorize/VPlan.h
+3,429-1,80196 files not shown
+4,522-2,182102 files

LLVM/project 4e17b5bclang-tools-extra/clangd ClangdLSPServer.cpp, clang-tools-extra/clangd/unittests ClangdLSPServerTests.cpp

[clangd] Fix crash when server shuts down with in-flight rename or tweak (#198019)

Fixes #196225.

Root cause: When clangd shuts down, `ClangdLSPServer`'s destructor calls
`Server.reset()` to destroy the `ClangdServer` object. `ClangdServer`
then destroys the work scheduler, which blocks and waits for in-flight
tasks to finish. If a rename task is in flight, the callback will try to
access the now-reset `ClangdLSPServer::Server` in
https://github.com/llvm/llvm-project/blob/4f9a7d09f4760ac9c5745e8bb829366d29ff9687/clang-tools-extra/clangd/ClangdLSPServer.cpp#L916-L917

The same issue occurs with `onCommandApplyTweak`, as its callback also
accesses `ClangdLSPServer::Server`:
https://github.com/llvm/llvm-project/blob/4f9a7d09f4760ac9c5745e8bb829366d29ff9687/clang-tools-extra/clangd/ClangdLSPServer.cpp#L828-L829

A reproducer has been added to #196225.

This PR fixes these issues by capturing a reference to `ClangdServer`
and using it in the callbacks instead of the `ClangdLSPServer::Server`

    [8 lines not shown]
DeltaFile
+16-0clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
+5-5clang-tools-extra/clangd/ClangdLSPServer.cpp
+21-52 files

LLVM/project 7801c10clang/unittests/ScalableStaticAnalysisFramework/WholeProgramAnalysis UnsafeBufferReachableAnalysisTest.cpp

clang format
DeltaFile
+2-2clang/unittests/ScalableStaticAnalysisFramework/WholeProgramAnalysis/UnsafeBufferReachableAnalysisTest.cpp
+2-21 files

LLVM/project 570b6e5flang/lib/Semantics resolve-names.cpp

Update directive list

Add dispatch - it accepts privatizing clause: is_device_ptr.
Remove workshare, workdistribute - they execute in implicit tasks.
DeltaFile
+1-2flang/lib/Semantics/resolve-names.cpp
+1-21 files

LLVM/project 0489434llvm/lib/Target/AMDGPU AMDGPURegBankCombiner.cpp, llvm/test/CodeGen/AMDGPU global-saddr-load.ll

PR feedback, fix tests
DeltaFile
+24-90llvm/test/CodeGen/AMDGPU/global-saddr-load.ll
+12-14llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
+36-1042 files

LLVM/project 1b4a578lldb/source/Plugins/Process/scripted ScriptedThread.cpp, lldb/source/Plugins/ScriptInterpreter/Python/Interfaces ScriptedThreadPythonInterface.cpp ScriptedProcessPythonInterface.cpp

[lldb/Interpreter] Plumb ScriptedMetadata through scripted plugin CreatePluginObject (NFC) (#198425)

Replace the (class_name, args_sp) parameter pair on CreatePluginObject
across the scripted plugin interfaces (ScriptedThread, OperatingSystem,
ScriptedBreakpoint, ScriptedFrameProvider, ScriptedProcess, and the
underlying ScriptedPythonInterface template) with a single `const
ScriptedMetadata &`. Callers (OperatingSystemPython, ScriptedThread,
ScriptedProcess, BreakpointResolverScripted, ScriptedFrameProvider) pass
their existing ScriptedMetadata directly, removing the need to re-bundle
class_name and args at every call site.

ScriptedBreakpoint, ScriptedFrameProvider and ScriptedProcess no longer
carry a redundant `args_sp` parameter; their callers fold those args
into the metadata, and the Python overrides reconstruct a
StructuredDataImpl from the metadata's args dict for the dispatched
call.

ScriptedInterface gains an `m_scripted_metadata` member and a
`GetScriptedMetadata()` accessor; ScriptedPythonInterface populates it

    [6 lines not shown]
DeltaFile
+10-2lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
+5-5lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.cpp
+5-5lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.cpp
+9-1lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
+4-5lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedFrameProviderPythonInterface.cpp
+4-4lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedStopHookPythonInterface.cpp
+37-2229 files not shown
+110-8035 files

LLVM/project a09d2bblldb/tools/lldb-dap/extension package-lock.json .npmrc, mlir/utils/vscode package-lock.json .npmrc

[MLIR][lldb-dap] Update brace-expansion dependencies in VSCode plugins, resolving security alerts (#198549)
DeltaFile
+2,504-1,285lldb/tools/lldb-dap/extension/package-lock.json
+136-153mlir/utils/vscode/package-lock.json
+2-0lldb/tools/lldb-dap/extension/.npmrc
+2-0mlir/utils/vscode/.npmrc
+2,644-1,4384 files

LLVM/project d020217clang/include/clang/ScalableStaticAnalysisFramework/Analyses/PointerFlow PointerFlowAnalysis.h PointerFlow.h, clang/lib/ScalableStaticAnalysisFramework/Analyses/UnsafeBufferUsage UnsafeBufferUsageAnalysis.cpp

[SSAF][WPA] Bounds propagation graph is a supergraph of the pointer-flow graph

Background: The whole-program UnsafeBufferReachableAnalysis propagates bounds
between pointers. It uses the pointer-flow graph extracted and linked
from translation units.

This commit patches the gap between the semantics of bounds
propagation and pointer-flow: the bounds propagation graph is a
supergraph of the pointer-flow graph in that a pointer-flow graph edge
(src, i) -> (dst, j) is the projection of a finite set of bounds
propagation graph edges {(src, i+d) -> (dst, j+d) | 0 <= d < UB} for a
small constant upper bound UB.  See the following example for the idea:

```
void f(int ***p, int **q) {
   *p = q;
   (**p)[5] = 0;
}
```

    [7 lines not shown]
DeltaFile
+377-174clang/unittests/ScalableStaticAnalysisFramework/WholeProgramAnalysis/UnsafeBufferReachableAnalysisTest.cpp
+66-15clang/lib/ScalableStaticAnalysisFramework/Analyses/UnsafeBufferUsage/UnsafeBufferUsageAnalysis.cpp
+9-13clang/include/clang/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlowAnalysis.h
+5-4clang/include/clang/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlow.h
+457-2064 files

LLVM/project 88367b2clang/lib/CIR/CodeGen CIRGenAtomic.cpp, clang/test/CIR/CodeGen atomic.c

[CIR] Handle atomic-fetch lowering of pointer types. (#198871)

We previously didn't properly handle the pointer type conversions, which
resulted in a verifier error. This patch does what classic codegen does
for these: casts them to an integer type. The rest of the logic around
this in classic codegen isn't necessary as the llvm intrinsics now
handle those types properly.
DeltaFile
+36-30clang/lib/CIR/CodeGen/CIRGenAtomic.cpp
+47-0clang/test/CIR/CodeGen/atomic.c
+83-302 files

LLVM/project 4de983flibc/src/unistd alarm.h CMakeLists.txt, libc/src/unistd/linux alarm.cpp CMakeLists.txt

[libc] implement alarm entrypoint (#198620)

Implemented the alarm entrypoint for unistd.h.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+64-0libc/test/src/unistd/alarm_test.cpp
+48-0libc/src/unistd/linux/alarm.cpp
+25-0libc/src/unistd/alarm.h
+15-0libc/test/src/unistd/CMakeLists.txt
+14-0libc/src/unistd/linux/CMakeLists.txt
+7-0libc/src/unistd/CMakeLists.txt
+173-04 files not shown
+182-010 files

LLVM/project d8fa68fclang/lib/CIR/CodeGen CIRGenExpr.cpp CIRGenExprScalar.cpp, clang/test/CIR/CodeGen new-array-in-ternary.cpp

[CIR] Fix bugs with array new in a ternary expression (#198869)

While attempting to compile Clang with CIR enabled, we ran into a
problem with the cleanup handling for array new inside of a ternary
operation. The reduced test case ended up showing different failure
modes with and without exceptions enabled, but it failed in both cases.
With exceptions enabled, we were failing to spill the value to be
returned and reload it outside of the cleanup scope. With exceptions
disabled, we were pushing an effectively empty entry on the EH stack and
later asserting when trying to pop it.

This change fixes the spill and reload problem by inserting a
RunCleanupsScope RAII object around the ternary branch generation code
with a call to forceCleanups to generate the spill and reload.

The assertion failure is fixed by replacing the assert call with code to
safely handle the condition of having an empty cleanup on the EH stack.
We should probably modify the code that pushes EH-only cleanups to avoid
doing so when exceptions are disabled, but that's a more extensive

    [7 lines not shown]
DeltaFile
+180-0clang/test/CIR/CodeGen/new-array-in-ternary.cpp
+12-5clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+11-4clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+9-1clang/lib/CIR/CodeGen/CIRGenCleanup.cpp
+212-104 files

LLVM/project 567d27bllvm/lib/Transforms/Vectorize VPlan.h VPlanVerifier.cpp, llvm/unittests/Transforms/Vectorize VPlanTest.cpp

[VPlan] Add type in VPRecipeValue, migrate first set of recipes. (NFC) (#195485)

This patch adds a new Type field to hold the scalar type for the
VPRecipeValue. It starts the migration of an initial set of recipes to
set the scalar type and use it directly in VPTypeAnalysis, removing
special handling for those types.

Eventually, VPTypeAnalysis can be retired when the migration is
complete, hopefully eliminating the need for type related caching, which
can lead to subtle invalidation errors.

To help the transition, a temporary getScalarTypeOrInfer has been added,
which returns the scalar type set in the VPValue for already migrated
recipes or falls back o type inferrence otherwise.

VPlanVerifier has been extended verify the set scalar type where
possible.

Tracking the type directly means a few places that change the type will

    [5 lines not shown]
DeltaFile
+56-38llvm/lib/Transforms/Vectorize/VPlan.h
+56-0llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+12-36llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
+24-10llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+19-4llvm/lib/Transforms/Vectorize/VPlan.cpp
+8-9llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
+175-973 files not shown
+195-1109 files

LLVM/project f5007fcoffload/liboffload/API Event.td, offload/liboffload/src OffloadImpl.cpp

[Offload] Make profiling support opt-in on events (#198810)

Summary:
Profiling requires getting time stamp information, which required
actually materializing barriers on the event. This caused performance
regressions in some OpenMP applications. Instead, we want to make this
opt in. This just adds a new argument to `olCreateEvent` which takes
some flags. Right now this is just none and profiling. Pretty mechanical
beyond that. Should revert this to the old behavior for OpenMP.

Co-authored-by: Kevin Sala Penades <kevinsala.ks at gmail.com>
DeltaFile
+52-10offload/plugins-nextgen/amdgpu/src/rtl.cpp
+34-8offload/unittests/OffloadAPI/event/olGetEventElapsedTime.cpp
+23-11offload/liboffload/src/OffloadImpl.cpp
+17-7offload/plugins-nextgen/cuda/src/rtl.cpp
+14-3offload/liboffload/API/Event.td
+8-7offload/plugins-nextgen/common/src/PluginInterface.cpp
+148-469 files not shown
+190-7315 files

LLVM/project 859c550libcxx/include/__cxx03/__memory uninitialized_algorithms.h, libcxx/include/__memory uninitialized_algorithms.h

[libc++] Require the exact assignment expression to be trivial in __uninitialized_allocator_copy_impl (#196648)

Fixes https://github.com/llvm/llvm-project/issues/196645

`__uninitialized_allocator_copy_impl` has an optimization that replaces
`allocator_traits::construct` with `std::copy` for raw pointer ranges
when the element type is trivially copy constructible and trivially copy
assignable.

The copy-assignment trait only checks whether assignment from `const T&`
is trivial. That is weaker than the expression used by `std::copy`,
which evaluates `*out = *in`. If overload resolution selects a different
non-trivial assignment operator for that expression, `std::copy` can
call that operator on uninitialized storage.

Check `is_trivially_assignable<_Out&, _In&>` instead. This matches the
assignment expression used by `std::copy`, preserves the optimized path
when that assignment is actually trivial, and avoids making non-const
raw pointer callers select the generic `allocator_traits::construct`

    [4 lines not shown]
DeltaFile
+76-1libcxx/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
+1-1libcxx/include/__memory/uninitialized_algorithms.h
+1-1libcxx/include/__cxx03/__memory/uninitialized_algorithms.h
+78-33 files

LLVM/project b387674flang/lib/Evaluate formatting.cpp, flang/lib/Semantics expression.cpp

[flang][PPC] Improve vector type names in expression diagnostics (NFC) (#197821)

Improve Flang semantic diagnostics for vector types by printing vector
type spellings in Fortran syntax instead of internal builtin-derived
type names.

Use `DerivedTypeSpec::VectorTypeAsFortran()` when producing vector
operand type names in `ArgumentAnalyzer::TypeAsFortran()`, instead of
relying on the generic type formatting path.

This updates diagnostics to print vector types as Fortran source-like
spellings, such as:
- `vector(integer(4))`
- `vector(real(4))`

while preserving the existing formatting for non-vector derived types.
DeltaFile
+15-0flang/test/Semantics/PowerPC/ppc-vector-diagnostics.f90
+3-1flang/lib/Semantics/expression.cpp
+3-0flang/lib/Evaluate/formatting.cpp
+21-13 files

LLVM/project ae0913bclang/include/clang/Serialization ASTRecordReader.h, clang/lib/AST ASTContext.cpp Type.cpp

trivial changes
DeltaFile
+20-14clang/lib/Sema/SemaOpenMP.cpp
+18-14clang/lib/AST/ASTContext.cpp
+16-15clang/lib/Sema/SemaTemplate.cpp
+14-11clang/lib/AST/Type.cpp
+14-8clang/lib/AST/ASTDiagnostic.cpp
+11-6clang/include/clang/Serialization/ASTRecordReader.h
+93-6833 files not shown
+202-15239 files

LLVM/project 3dedd3eclang/include/clang/AST ASTContext.h, clang/lib/AST ASTContext.cpp ItaniumMangle.cpp

[clang] implement CWG2064: ignore value dependence for decltype

The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.

This patch also implements what's neceessary to allow overloading
on pure differences in instantiation dependence, making `std::void_t`
usable for SFINAE purposes.

This also readds a few test cases from da98651, which was a previous attempt
at resolving CWG2064.

Fixes #8740
Fixes #61818
Fixes #190388
DeltaFile
+888-161clang/lib/AST/ASTContext.cpp
+328-12clang/test/SemaTemplate/instantiation-dependence.cpp
+176-96clang/lib/AST/ItaniumMangle.cpp
+100-98clang/lib/Sema/SemaCXXScopeSpec.cpp
+62-57clang/lib/AST/Type.cpp
+88-11clang/include/clang/AST/ASTContext.h
+1,642-43571 files not shown
+2,401-79277 files

LLVM/project 26a5129clang/include/clang/Frontend FrontendActions.h CompilerInstance.h, clang/lib/Frontend CompilerInstance.cpp FrontendActions.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+11-9clang/lib/Frontend/CompilerInstance.cpp
+12-1clang/include/clang/Frontend/FrontendActions.h
+8-4clang/lib/Frontend/FrontendActions.cpp
+4-3clang/include/clang/Frontend/CompilerInstance.h
+35-174 files

LLVM/project 5e9f5c5flang/lib/Semantics resolve-directives.cpp

[flang][OpenMP] Clarify comment in resolve-directives.cpp, NFC (#198860)
DeltaFile
+10-8flang/lib/Semantics/resolve-directives.cpp
+10-81 files

LLVM/project 1681c2dflang/lib/Optimizer/OpenMP FunctionFiltering.cpp, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Reject target map iterators without captures

Reject target map iterators until the follow-up capture-binding
representation is added since currently map_iterated on omp.target
only represents the dynamic map list and does not consider the
target-region arguments required by IsolatedFromAbove.
DeltaFile
+0-23mlir/test/Dialect/OpenMP/ops.mlir
+0-19mlir/test/Target/LLVMIR/openmp-todo.mlir
+5-5mlir/test/Dialect/OpenMP/invalid.mlir
+5-0mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+0-1flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp
+10-485 files

LLVM/project 32b3230flang/lib/Optimizer/OpenMP LowerWorkdistribute.cpp, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

[mlir][OpenMP] Add iterator support to motion clauses

Extend omp.target_data, omp.target_enter_data, omp.target_exit_data,
and omp.target_update to support `!omp.iterated<Ty>`.

This is part of feature work for #188061

Assisted with copilot
DeltaFile
+128-21mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+100-1mlir/test/Dialect/OpenMP/ops.mlir
+83-0mlir/test/Target/LLVMIR/openmp-todo.mlir
+38-4mlir/test/Dialect/OpenMP/invalid.mlir
+19-18flang/lib/Optimizer/OpenMP/LowerWorkdistribute.cpp
+14-3mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+382-475 files not shown
+403-6111 files

LLVM/project 54a0eebmlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Remove unrelated empty line
DeltaFile
+0-1mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+0-11 files

LLVM/project 79846cemlir/include/mlir/Dialect/OpenMP OpenMPOps.td, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Require explicit yield in iterator op

Remove the implicit terminator trait from omp.iterator so iterator
modifiers must explicitly yield the value used to form the iterated list.

Add and update verfier and test accordingly.
DeltaFile
+15-0mlir/test/Dialect/OpenMP/ops.mlir
+5-8mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+9-0mlir/test/Dialect/OpenMP/invalid.mlir
+1-3mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+30-114 files

LLVM/project 5330214mlir/include/mlir/Dialect/OpenMP OpenMPOps.td, mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp

Simplify map iterator clause assembly

- Split MLIR map syntax into separate map_entries(...) and map_iterated(...),
  removing the custom MapEntryList parser/printer.
- Moved omp.target map_iterated out of TargetOpRegion
  - it now prints before the target region instead of as map_iterated_entries(...) after the region.
- Renamed LLVMIR TODO helper to clause-style checkMap.
- Added DeclareMapperInfoOp builder from DeclareMapperInfoOperands
  and updated Flang call sites so they do not need to spell out newly
  added operands..
DeltaFile
+12-89mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+14-14mlir/test/Dialect/OpenMP/ops.mlir
+12-12mlir/test/Dialect/OpenMP/invalid.mlir
+6-8mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+7-7mlir/test/Target/LLVMIR/openmp-todo.mlir
+5-2mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+56-1323 files not shown
+62-1409 files

LLVM/project 14b5a67mlir/lib/Dialect/OpenMP/IR OpenMPDialect.cpp, mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp

Add verifier check for iterated map info and tests for declare mapper
DeltaFile
+92-75mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+112-4mlir/test/Dialect/OpenMP/invalid.mlir
+24-0mlir/test/Target/LLVMIR/openmp-todo.mlir
+18-0mlir/test/Dialect/OpenMP/ops.mlir
+6-0mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+252-795 files

LLVM/project 8311230clang/test/OpenMP thread_limit_gpu.c thread_limit_nvptx.c, llvm/lib/Frontend/OpenMP OMPIRBuilder.cpp

[llvm][OpenMP] Add option to disable default max threads adjustment (#198719)

This commit adds the option
`-openmp-ir-builder-use-default-max-thread=<boolean-value>` to
enable or disable the use of a default max threads in OpenMPIRBuilder
when no max threads constant is provided. The option is enabled by
default, thus maintaining the same behavior as it is currently.

This flag is useful to avoid limiting the number of threads that an
OpenMP target region can run with when no `thread_limit` or
`num_threads` (in a nested parallel region) are specified. This flag may
be used when recording a kernel to allow replaying it later with a
higher number of threads (e.g., reaching the maximum thread limit
supported by the device).
DeltaFile
+24-5clang/test/OpenMP/thread_limit_gpu.c
+17-9clang/test/OpenMP/thread_limit_nvptx.c
+7-3llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+48-173 files

LLVM/project fadbc3fllvm/lib/Frontend/OpenMP OMPIRBuilder.cpp, llvm/unittests/Frontend OpenMPIRBuilderTest.cpp

[OpenMP][OMPIRBuilder] Avoid querying SmallPtrSet during removal (#198690)

openmp-cli-fuse02.mlir can intermittently leave behind a dead block
after loop fusion, causing LLVM IR verification to fail.
(https://github.com/llvm/llvm-project/pull/197637#issuecomment-4497502486)

This happened because `removeUnusedBlocksFromParent` queried
`BBsToErase` while using `SmallPtrSet::remove_if` on the same set, which
made the result depend on the set's internal mutation order during
removal.

This patch tracks candidate blocks by index with `SmallBitVector`
instead of mutating and querying the same `SmallPtrSet`. This also
preserves the original `BBs` order when collecting the final dead
blocks.

---

The original PR was created with assistance from Copilot. The later

    [2 lines not shown]
DeltaFile
+54-0llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+33-17llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+87-172 files