LLVM/project 96a31b5clang/lib/StaticAnalyzer/Core HTMLDiagnostics.cpp, clang/test/Analysis/html_diagnostics highlight-range-mapping.cpp

[analyzer] Fix -analyzer-output=html assert on reversed and macro ranges

HTMLDiagnostics::HighlightRange guarded against a reversed range by
comparing line numbers, so a same-line reversal - which is what the piece for
an implicit copy constructor carries - reached html::HighlightRange.
Its scan walks from begin to end, ran off the end of the buffer, and asserted:
https://godbolt.org/z/sTb5qfjjd

  Invalid position to insert! (RewriteRope.h)

It also added the end token's length itself and then passed a token range to
html::HighlightRange, which measured the token again, this time from the
interior. For most tokens the two cancel, but where the tail re-lexes longer
the highlight reached past the end of the range, e.g. over a trailing ';'.

Use getExpansionRangeInFile(), which rejects reversed and cross-file ranges,
then convert once and tell html::HighlightRange the range is already
char-granular.


    [4 lines not shown]
DeltaFile
+43-0clang/test/Analysis/html_diagnostics/highlight-range-mapping.cpp
+8-27clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+51-272 files

LLVM/project 847dba5clang/lib/StaticAnalyzer/Core SarifDiagnostics.cpp, clang/test/Analysis/diagnostics sarif-macro-expansion.c

[analyzer] Fix -analyzer-output=sarif crash on macro-expanded ranges

A path piece whose range ends inside a macro expansion aborted the whole
document: https://godbolt.org/z/61vWYcsWj

  Cannot create a physicalLocation from invalid SourceRange!

convertTokenRangeToCharRange() built the end with
Lexer::getLocForEndOfToken(), which returns an invalid location for a macro
ID that is not at the end of its expansion, and used it unchecked. The
analyzer's own test corpus hits this in nine files; text and plist output
were unaffected because both already map such ranges to the expansion.

- Use getExpansionRangeInFile(), so the region covers the macro use like the
  other two outputs.
- Fall back to a caret when the range is unusable. A thread flow needs a
  location per piece, so dropping one would truncate the reported path. This
  also stops reversed ranges producing regions with endColumn < startColumn.


    [4 lines not shown]
DeltaFile
+22-21clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
+35-0clang/test/Analysis/diagnostics/sarif-macro-expansion.c
+57-212 files

LLVM/project 98bd12dclang/include/clang/Frontend DiagnosticRenderer.h, clang/lib/Frontend DiagnosticRenderer.cpp

[clang] Reject ranges getExpansionRangeInFile cannot represent

getExpansionRangeInFile passed reversed ranges through, inherited from the
loop it was extracted from.
The analyzer's SARIF and HTML consumers, added on top, walk begin->end, so
reject such ranges in the shared helper rather than in each output.

The mapped endpoints are compared as-is, which is stricter than
Lexer::makeFileCharRange(): that extends a token range to the end of its last
token before comparing offsets.

The new postcondition, plus the invalid- and cross-file-range guards, are
covered by a GetExpansionRangeInFile unit test in
clang/unittests/Frontend/TextDiagnosticTest.cpp.

Assisted-By: claude
DeltaFile
+94-0clang/unittests/Frontend/TextDiagnosticTest.cpp
+6-0clang/lib/Frontend/DiagnosticRenderer.cpp
+2-1clang/include/clang/Frontend/DiagnosticRenderer.h
+102-13 files

LLVM/project 85ce0f6lldb/test/API/lua_api TestLuaAPI.py

[lldb][test][LUA] Remove Python2 workaround (#215279)
DeltaFile
+4-7lldb/test/API/lua_api/TestLuaAPI.py
+4-71 files

LLVM/project a502d2fclang-tools-extra/clangd FindSymbols.h FindSymbols.cpp, clang-tools-extra/clangd/unittests SymbolCollectorTests.cpp CallHierarchyTests.cpp

[clangd] Add symbol tags in SymbolInformation, WorkspaceSymbol, CallHierarchyItem and TypeHierarchyItem (#170103)

Introduce support for symbol tags in `SymbolInformation`, `WorkspaceSymbol`, `CallHierarchyItem`, and `TypeHierarchyItem`.

As part of this change:
- Calculation of the symbol tags Overrides and Implements
- Calculation of symbol tags during the AST creation and embedding them in `Symbol`.
- Minor change on struct Symbol to minimize paddings and thus reducing memory consumption.

Continuation of PR #167536
Fixes #180843
DeltaFile
+143-16clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp
+129-4clang-tools-extra/clangd/FindSymbols.cpp
+110-0clang-tools-extra/clangd/unittests/SerializationTests.cpp
+56-0clang-tools-extra/clangd/unittests/CallHierarchyTests.cpp
+42-0clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
+17-10clang-tools-extra/clangd/FindSymbols.h
+497-3018 files not shown
+595-5724 files

FreeBSD/src 0048dfdsys/dev/ixl ixl_pf.h ixl_pf_iflib.c

ixl: Quiesce VF DMA before a PF reset

A PF reset has a warning interval before the hardware reset begins.
Cooperative VF drivers respond to the reset event by stopping and
releasing their receive buffers, but notifying VFs did not stop the
hardware queues.  An active VF could therefore DMA through its old
rings into freed mbuf clusters during the warning interval.

Put every enabled VF in reset, drain its PCIe transactions, disable its
queues, wait for receive queue shutdown, and drain transactions again
before tearing down the PF HMC and AdminQ.

Hold VFs in reset again while rebuilding the firmware topology.  Release
VF reset before programming the replacement VSI and queue mappings,
since VF reset clears those registers, and publish VFACTIVE only after
reconstruction succeeds.  Leave a VF held in reset if rebuilding it
fails.

Fixes:          983e628a0c47 ("ixl: Rebuild VF resources after a PF reset")
MFC after:      2 weeks
DeltaFile
+122-0sys/dev/ixl/ixl_pf_iov.c
+13-3sys/dev/ixl/ixl_pf_iflib.c
+1-0sys/dev/ixl/ixl_pf.h
+136-33 files

FreeBSD/src 02fbb1csys/dev/iavf if_iavf_iflib.c

iavf: Resume AdminQ processing after PF reset

A PF reset indication leaves IAVF_STATE_RESET_PENDING set while the
VF recreates its AdminQ and negotiates new resources.  The ordinary
AdminQ task refuses to consume messages while that state is set.
Consequently, the first DISABLE_QUEUES reply after successful mailbox
rediscovery remains in the receive queue and initialization times out.
Later retries and manual interface restarts repeat the same cycle.

Clear the stale reset indication once VERSION and GET_VF_RESOURCES have
succeeded, before enabling interrupts and resuming normal virtchnl
requests.

MFC after:      2 weeks
DeltaFile
+8-0sys/dev/iavf/if_iavf_iflib.c
+8-01 files

FreeBSD/src 5132646src/ap ieee802_11.c, src/common proximity_ranging.c qca-vendor.h

wpa: Update to 2.12

Fixes and new features include:

hostapd:
* support RSN overriding (e.g., WPA3-Personal Compatibility Mode)
* EHT/IEEE 802.11be/Wi-Fi 7
  - more complete support
  - fix message validation issues that could enable DoS attacks
  - fix group key rekeying
* enable SAE group 20 by default if SAE-EXT-KEY is enabled
* reject unexpected SAE password identifier to avoid DoS attack against
  a specific STA
* mandate use of SAE H2E when using password identifiers
* assign VLAN when using SAE with PMKSA caching
* support SPP A-MSDU negotiation
* support IEEE 802.11bi functionality
  - changing SAE password identifiers
  - EPPKE

    [46 lines not shown]
DeltaFile
+6,124-33src/common/qca-vendor.h
+5,003-0wpa_supplicant/nan_supplicant.c
+3,381-671src/drivers/driver_nl80211.c
+3,106-664src/ap/ieee802_11.c
+3,677-0src/nan/nan.c
+2,707-0src/common/proximity_ranging.c
+23,998-1,368336 files not shown
+89,809-24,648342 files

LLVM/project 3e9127bllvm/lib/Transforms/Scalar GVN.cpp

[GVN] Use SmallDenseSet for visited node tracking (#215258)

Commit 0a321f38147f ("[GVN] Track visited nodes in equality propagation
to avoid OOM (#212265)", 2026-08-05) caused some compilation time
regressions. Use a SmallDenseSet to mitigate the impact of that change.
DeltaFile
+1-1llvm/lib/Transforms/Scalar/GVN.cpp
+1-11 files

LLVM/project 635b416llvm/test/CodeGen/NVPTX tcgen05-mma-disable-output-lane-collector-b.ll tcgen05-mma-sp-disable-output-lane-collector-b.ll, mlir/test/Target/LLVMIR/nvvm tcgen05-mma-tensor.mlir tcgen05-mma-sp-tensor.mlir

[MLIR][NVVM][NVPTX] Add collector_b operand to tcgen05.mma intrinsics (#214280)

Extend `tcgen05.mma`, `disable_output_lane`, and `block_scale` NVVM
intrinsics with a `collector_b` immediate operand.

Update the NVPTX patterns to select `collector::b` forms when the
subtarget supports them, and enable the relevant sm_107f PTX 9.4
predicate.

Auto-upgrade older IR by appending `collector_usage_b=discard` so
existing bitcode keeps the previous behavior.

Extend tcgen05.mma MLIR Ops with `collectorOpB` argument.
DeltaFile
+1,054-0llvm/test/CodeGen/NVPTX/tcgen05-mma-collector-b.ll
+699-0llvm/test/CodeGen/NVPTX/tcgen05-mma-sp-collector-b.ll
+458-0llvm/test/CodeGen/NVPTX/tcgen05-mma-sp-disable-output-lane-collector-b.ll
+457-0llvm/test/CodeGen/NVPTX/tcgen05-mma-disable-output-lane-collector-b.ll
+210-144mlir/test/Target/LLVMIR/nvvm/tcgen05-mma-tensor.mlir
+210-144mlir/test/Target/LLVMIR/nvvm/tcgen05-mma-sp-tensor.mlir
+3,088-28820 files not shown
+4,301-92326 files

LLVM/project 4f3343fclang/lib/StaticAnalyzer/Core HTMLDiagnostics.cpp, clang/test/Analysis/html_diagnostics highlight-range-mapping.cpp

[analyzer] Fix -analyzer-output=html assert on reversed and macro ranges

HTMLDiagnostics::HighlightRange guarded against a reversed range by
comparing line numbers, so a same-line reversal - which is what the piece for
an implicit copy constructor carries - reached html::HighlightRange.
Its scan walks from begin to end, ran off the end of the buffer, and asserted:
https://godbolt.org/z/sTb5qfjjd

  Invalid position to insert! (RewriteRope.h)

It also added the end token's length itself and then passed a token range to
html::HighlightRange, which measured the token again, this time from the
interior. For most tokens the two cancel, but where the tail re-lexes longer
the highlight reached past the end of the range, e.g. over a trailing ';'.

Use getExpansionRangeInFile(), which rejects reversed and cross-file ranges,
then convert once and tell html::HighlightRange the range is already
char-granular.


    [4 lines not shown]
DeltaFile
+43-0clang/test/Analysis/html_diagnostics/highlight-range-mapping.cpp
+8-27clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+51-272 files

LLVM/project 8b5ac88clang/include/clang/Frontend DiagnosticRenderer.h, clang/lib/StaticAnalyzer/Core SarifDiagnostics.cpp

[analyzer] Fix -analyzer-output=sarif crash on macro-expanded ranges

A path piece whose range ends inside a macro expansion aborted the whole
document: https://godbolt.org/z/61vWYcsWj

  Cannot create a physicalLocation from invalid SourceRange!

convertTokenRangeToCharRange() built the end with
Lexer::getLocForEndOfToken(), which returns an invalid location for a macro
ID that is not at the end of its expansion, and used it unchecked. The
analyzer's own test corpus hits this in nine files; text and plist output
were unaffected because both already map such ranges to the expansion.

- Use getExpansionRangeInFile(), so the region covers the macro use like the
  other two outputs.
- Fall back to a caret when the range is unusable. A thread flow needs a
  location per piece, so dropping one would truncate the reported path. This
  also stops reversed ranges producing regions with endColumn < startColumn.


    [4 lines not shown]
DeltaFile
+22-21clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
+35-0clang/test/Analysis/diagnostics/sarif-macro-expansion.c
+8-1clang/include/clang/Frontend/DiagnosticRenderer.h
+65-223 files

LLVM/project 8d425c1clang/include/clang/Frontend DiagnosticRenderer.h, clang/lib/Frontend DiagnosticRenderer.cpp

[clang] Reject ranges getExpansionRangeInFile cannot represent

getExpansionRangeInFile passed reversed ranges through, inherited from the
loop it was extracted from.
The analyzer's SARIF and HTML consumers, added on top, walk begin->end, so
reject such ranges in the shared helper rather than in each output.

The mapped endpoints are compared as-is, which is stricter than
Lexer::makeFileCharRange(): that extends a token range to the end of its last
token before comparing offsets.

The new postcondition, plus the invalid- and cross-file-range guards, are
covered by a GetExpansionRangeInFile unit test in
clang/unittests/Frontend/TextDiagnosticTest.cpp.

Assisted-By: claude
DeltaFile
+94-0clang/unittests/Frontend/TextDiagnosticTest.cpp
+6-0clang/lib/Frontend/DiagnosticRenderer.cpp
+4-1clang/include/clang/Frontend/DiagnosticRenderer.h
+104-13 files

LLVM/project a33dc5allvm/lib/Target/X86 X86ScheduleZnver4.td, llvm/test/tools/llvm-mca/X86/Znver4 resources-avx512bw.s resources-avx512.s

[X86][SchedModel] Use ZMM zero-idiom class for 512-bit VPSUB/VPCMPGT on Znver4 (#215109)

Fix copy + paste typo:
```
Zn4WriteVZeroIdiomLogicX  ->  InstRW<[Zn4WriteVZeroIdiomLogicX], ...>   ok
Zn4WriteVZeroIdiomLogicY  ->  InstRW<[Zn4WriteVZeroIdiomLogicY], ...>   ok
Zn4WriteVZeroIdiomLogicZ  ->  InstRW<[Zn4WriteVZeroIdiomLogicZ], ...>   ok
Zn4WriteVZeroIdiomALUX    ->  InstRW<[Zn4WriteVZeroIdiomALUX],   ...>   ok
Zn4WriteVZeroIdiomALUY    ->  InstRW<[Zn4WriteVZeroIdiomALUY],   ...>   ok
Zn4WriteVZeroIdiomALUZ    ->  InstRW<[Zn4WriteVZeroIdiomALUY],   ...>   <-- Y, not Z
```
DeltaFile
+13-13llvm/test/tools/llvm-mca/X86/Znver4/resources-avx512.s
+9-9llvm/test/tools/llvm-mca/X86/Znver4/resources-avx512bw.s
+1-1llvm/lib/Target/X86/X86ScheduleZnver4.td
+23-233 files

LLVM/project 93b658dllvm/include/llvm/Transforms/Vectorize LoopVectorizationLegality.h, llvm/lib/Transforms/Vectorize VPlanTransforms.cpp VPRecipeBuilder.h

Fixups
DeltaFile
+112-118llvm/test/Transforms/LoopVectorize/compress-idioms.ll
+47-32llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+18-8llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+13-3llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
+5-0llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h
+4-0llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+199-1616 files

LLVM/project 9b02a80llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 avx512bf16-vl-intrinsics.ll avx512bf16-intrinsics.ll

[X86] concatvectors(cvtneps2bf16(x),cvtneps2bf16(y)) -> cvtne2ps2bf16(y,x) (#215215)

Handle cvtne2ps2bf16 operands swap

Fixes #214676
DeltaFile
+10-0llvm/lib/Target/X86/X86ISelLowering.cpp
+1-3llvm/test/CodeGen/X86/avx512bf16-vl-intrinsics.ll
+1-3llvm/test/CodeGen/X86/avx512bf16-intrinsics.ll
+12-63 files

LLVM/project dd29759clang/lib/AST AttrImpl.cpp, clang/lib/Sema SemaTemplateInstantiateDecl.cpp SemaOpenMP.cpp

[Clang][OpenMP] Validate prefer_type fr()/attr() arguments in append_args clause (#212307)

The OpenMP 6.0 spec states that append_args(interop(...)) accepts the
same modifier-specification-list as the init clause, which includes
prefer_type. However, the parser rejected prefer_type in append_args,
and the semantic validation for fr()/attr() arguments was only performed
for the init clause. This patch allows prefer_type in the parser for
append_args and adds the corresponding semantic validation of
fr()/attr() arguments to ActOnOpenMPDeclareVariantDirective.
DeltaFile
+98-0clang/test/OpenMP/declare_variant_append_args_prefer_type_messages.cpp
+55-38clang/lib/Sema/SemaOpenMP.cpp
+79-0clang/test/OpenMP/declare_variant_append_args_prefer_type_ast_print.cpp
+50-2clang/utils/TableGen/ClangAttrEmitter.cpp
+36-1clang/lib/AST/AttrImpl.cpp
+19-2clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+337-432 files not shown
+347-468 files

LLVM/project efafbedlldb/test/API/tools/lldb-dap/attach TestDAP_attach.py, lldb/test/API/tools/lldb-dap/console TestDAP_console.py

[lldb-dap] Convert test to use the require decorator (#213462)

This is a follow up to https://github.com/llvm/llvm-project/pull/212753
to convert the `lldb-dap` tests to use the `@require` decorators.
DeltaFile
+9-6lldb/test/API/tools/lldb-dap/console/TestDAP_console.py
+3-3lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py
+3-3lldb/test/API/tools/lldb-dap/module/TestDAP_module.py
+3-3lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py
+3-3lldb/test/API/tools/lldb-dap/exception/objc/TestDAP_exception_objc.py
+2-2lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
+23-206 files not shown
+33-3012 files

LLVM/project 4ae0a5doffload/libomptarget device.cpp

[OpenMP] Fix race in setupIndirectCallTable (#215274)

The IndirectCallTable variable where the table is constructed is a local
variable. The copy to the device is right now not synchronized, so the
frame where the table resides can be overwritten before the GPU copy has
accessed the host data which corrupts the device side table.

Fix it by make it a synchronous operation.
DeltaFile
+7-0offload/libomptarget/device.cpp
+7-01 files

LLVM/project 067aa36offload/libomptarget device.cpp, offload/plugins-nextgen/amdgpu/src rtl.cpp

[OFFLOAD][OMP] Move OpenMP kernel argument processing from plugins (#213867)

This PR moves part of the OpenMP specific code that is inside the common
code of the plugins that converts the kernel arguments from the OpenMP
ABI to the expected format by the plugins. Also it handles the
additional argument for the KernelLaunch environment.

It also decouples the plugin interface structs from the OpenMP specific
ABI (KernelArgsTy) so changes to this interface do not require changes
to the OpenMP ABI anymore. This also allows to merge what was
KernelArgsTy and LaunchParamsTy into a single struct with all the
information. Because of this there's a number of small changes scattered
through the plugin infrastructure.

There is still some more OpenMP specific code that should be moved out
eventually (and because of this we had to retain some of that
informationt in the new KernelLaunchArgsTy for now) but I didn't want to
complicate this PR further.

Assisted by Claude-Sonnet-5.
DeltaFile
+47-101offload/plugins-nextgen/common/src/PluginInterface.cpp
+61-28offload/plugins-nextgen/common/include/PluginInterface.h
+79-3offload/libomptarget/device.cpp
+18-20offload/plugins-nextgen/amdgpu/src/rtl.cpp
+16-19offload/plugins-nextgen/common/src/RecordReplay.cpp
+12-15offload/plugins-nextgen/common/include/RecordReplay.h
+233-1869 files not shown
+265-23115 files

LLVM/project e4f8403llvm/lib/Support CommandLine.cpp

[Support] Use block-scope statics for cl::opt registration globals (#215216)

Every static cl::opt constructor references GlobalParser and the
TopLevelSubCommand/AllSubCommands ManagedStatics, namespace-scope
globals in another translation unit. Although these are constant-
initialized in practice, Coverity's GLOBAL_INIT_ORDER checker cannot
prove it and reports one 'Initialization or destruction ordering is
unspecified' finding per option -- 15,356 of the 34,356 outstanding
defects (44.7%) in the LLVM Coverity project.

Move the three registries into block-scope statics behind accessor
functions. Block-scope statics are initialized on first use, so the
cross-TU initialization-order hazard pattern disappears while the
ManagedStatic semantics (lazy construction, destruction via
llvm_shutdown) are preserved unchanged.
DeltaFile
+50-40llvm/lib/Support/CommandLine.cpp
+50-401 files

LLVM/project 95cb244llvm/include/llvm/MC MCGOFFStreamer.h, llvm/lib/MC MCGOFFStreamer.cpp

[SystemZ][z/OS] Support emittinh common symbols in HLASM

This is a follow-up to #210179. It reuses the logic to emit common
symbols in HLASM, too.
DeltaFile
+17-12llvm/lib/MC/MCGOFFStreamer.cpp
+6-0llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.cpp
+5-0llvm/test/CodeGen/SystemZ/zos-common-global.ll
+3-0llvm/include/llvm/MC/MCGOFFStreamer.h
+1-1llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.h
+32-135 files

NetBSD/src Rz5PKmAusr.bin/config main.c

   Make is possible to de-select depended options (which are processed in
   a separate pass).  Example:

   <files.foo>
   defflag SOME_OPTION: SOME_OTHER_OPTION

   <MYFOO>
   options SOME_OPTION
   no options SOME_OTHER_OPTION

   Prior to this change, a warning that SOME_OTHER_OPTION was not selected
   would be issued and SOME_OTHER_OPTION would remain selected in the output.
   After this change, no warning is issued and SOME_OTHER_OPTION is not
   selected in the output as expected.

   This does not have broad utility, but can quite useful in certain situations.
VersionDeltaFile
1.103+42-5usr.bin/config/main.c
+42-51 files

OPNSense/plugins 6ba7d56www/caddy pkg-descr, www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms dialogLayer4.xml dialogHandle.xml

www/caddy: Adjust load balancing and health check labels and add subheaders
DeltaFile
+27-15www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml
+10-4www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogLayer4.xml
+1-0www/caddy/pkg-descr
+38-193 files

LLVM/project f890a30llvm/lib/CodeGen TargetLoweringBase.cpp, llvm/lib/Target/AArch64 AArch64ISelLowering.cpp

Set Expand as default action for ISD::VECTOR_BROADCAST
DeltaFile
+5-3llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+4-0llvm/lib/CodeGen/TargetLoweringBase.cpp
+9-32 files

LLVM/project 9a0ca57llvm/lib/Target/AArch64 AArch64ISelLowering.h AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 sve-vector-broadcast.ll

Fix AArch64 ISel for unpacked types

Using DUP instructions only really works for packed types, as it will
not introduce the spacing between elements that is required for unpacked
types like nxv2f16.

For those, we'll first broadcast to their corresponding packed type, and
then extract the lo lanes into an unpacked type, effectively introducing
the required spacing.
DeltaFile
+51-0llvm/test/CodeGen/AArch64/sve-vector-broadcast.ll
+11-31llvm/lib/Target/AArch64/SVEInstrFormats.td
+22-0llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+1-0llvm/lib/Target/AArch64/AArch64ISelLowering.h
+85-314 files

LLVM/project fba1e10flang/test/Lower/OpenMP declare-target-implicit-func-and-subr-cap-enter.f90 declare-target-data.f90, mlir/lib/Dialect/OpenMP/Transforms MarkDeclareTarget.cpp

[MLIR][OpenMP] Support calls added between MarkDeclareTarget runs

Currently, if there are multiple executions of the `MarkDeclareTarget`
pass in a compiler pipeline and somewhere between both runs function
calls get added to a non-declare_target function that was marked as such
implicitly, potential changes to the `device_type` won't get propagated.

This is because we can't distinguish between a user-specified
`declare_target` function attribute and one added by that pass. This
patch addresses this by adding a new parameter to `DeclareTargetAttr`
that is used by that pass to know whether new `declare_target`
information could be propagated to it.

The `automap` and `implicit` parameters are given default values to
simplify the representation of these attributes.
DeltaFile
+62-40mlir/test/Dialect/OpenMP/mark-declare-target.mlir
+25-47mlir/lib/Dialect/OpenMP/Transforms/MarkDeclareTarget.cpp
+23-23flang/test/Lower/OpenMP/declare-target-func-and-subr.f90
+21-21flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap.f90
+19-19flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
+19-19flang/test/Lower/OpenMP/declare-target-data.f90
+169-16912 files not shown
+221-20618 files

LLVM/project 791c540flang/test/Integration/OpenMP function-filtering-2.f90, flang/test/Lower/OpenMP declare-target-implicit-tarop-cap.f90 declare-target-implicit-func-and-subr-cap-enter.f90

[Flang][OpenMP] Improve implicit declare_target propagation

After starting to run the `MarkDeclareTarget` pass later in the
pipeline, some limitations of its original implementation started to be
hit; specifically, some calls being missed could result in an overly
restrictive marking that would cause the `HostOpFiltering` pass to
remove reachable device code.

This patch aims to address these problems by making the following
changes:
- It makes sure to mark functions in every `RecipeInterface` op pointed
to by OpenMP operations.
- It recursively propagates and combines declare_target information from
target regions and explicitly set declare_target functions to unmarked
functions, but it never modifies explicitly marked functions.
- External and public functions can now only be marked with
`device_type(any)`. Before, marking them as `nohost` or `host` was
possible, but without the ability to see all users we can't give such
guarantees.

    [7 lines not shown]
DeltaFile
+267-124mlir/lib/Dialect/OpenMP/Transforms/MarkDeclareTarget.cpp
+200-187flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap.f90
+363-0mlir/test/Dialect/OpenMP/mark-declare-target.mlir
+174-161flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
+86-73flang/test/Lower/OpenMP/declare-target-implicit-tarop-cap.f90
+46-44flang/test/Integration/OpenMP/function-filtering-2.f90
+1,136-5897 files not shown
+1,208-60613 files

LLVM/project aa8e493flang/test/Integration/OpenMP target-dead-code.f90, flang/test/Lower/OpenMP target-dead-code.f90

Address review comments
DeltaFile
+271-0flang/test/Integration/OpenMP/target-dead-code.f90
+0-263flang/test/Lower/OpenMP/target-dead-code.f90
+271-2632 files

LLVM/project c008226flang/include/flang/Optimizer/OpenMP Passes.td, flang/lib/Optimizer/OpenMP CMakeLists.txt DeleteUnreachableTargets.cpp

[Flang][OpenMP] Remove the DeleteUnreachableTargets pass

The `DeleteUnreachableTargets` pass was initially added to work around
a problem caused by the interaction between the function filtering and
host op filtering passes and generic MLIR optimizations.

Specifically, by running function and host op filtering before these
optimizations, we would lose the ability to detect unreachable
`omp.target` operations when compiling for the device. This would cause
GPU kernels being created for them, for which no host counterpart
existed.

By now having moved both passes towards the end of the compilation
pipeline, after FIR to LLVM lowering, removal of unreachable host and
device code is no longer impacted by them. This makes the
`DeleteUnreachableTargets` pass redundant.
DeltaFile
+0-322flang/test/Transforms/OpenMP/delete-unreachable-targets.mlir
+202-27flang/test/Lower/OpenMP/target-dead-code.f90
+0-76flang/lib/Optimizer/OpenMP/DeleteUnreachableTargets.cpp
+0-12flang/include/flang/Optimizer/OpenMP/Passes.td
+0-3flang/lib/Optimizer/Passes/Pipelines.cpp
+0-1flang/lib/Optimizer/OpenMP/CMakeLists.txt
+202-4416 files