[WebAssembly] Port WebAssemblyPostLegalizerCombiner
Standard NewPM pass porting. Again, we do need to move the rule parsing
into the per-MF implementation since it's hard to get the type
definition into the NewPM pass definition, but this should be low
overhead.
Reviewers: sbc100, aheejin, dschuff, QuantumSegfault
Pull Request: https://github.com/llvm/llvm-project/pull/218101
[WebAssembly] Port PreLegalizerCombiner
Standard NewPM pass porting. We have to stick the RuleConfig option
parsing into the per-function implementation to avoid needing to put the
type definition in WebAssembly.h which probably isn't desirable with the
include file logic and given the parsing should be pretty cheap.
Reviewers: aheejin, sbc100, QuantumSegfault, dschuff
Pull Request: https://github.com/llvm/llvm-project/pull/218098
[BasicAA] Refactor offset-based heuristics in `aliasGEP`, unify style (NFC) (#218687)
Part of the offset-based reasoning in `aliasGEP`, including GCD and
minimum absolute heuristics, has been abstracted out into
`BasicAAResult` private methods, in an attempt to improve code
readability.
Minor opportunity to modernize code style where possible.
[CIR] Accept a union with an ABI-empty member (#218718)
isSupportedType rejected any union containing an ABI-empty member
outright. Dropping the reject alone is not enough. A union mixing a
data-free member that spans the record with a bit-field access unit can
still mis-lower. The new accept rule requires that a data-supplying
member span the record whenever a bit-field access unit is present.
mapCIRType's union loop now only maps members that hold data for the
ABI, so an unnamed bit-field's storage is not mapped as a field either.
Assisted-by: Cursor / claude-opus-5
---------
Co-authored-by: Andy Kaylor <akaylor at nvidia.com>
[flang][OpenMP] Check metadirective replacement nesting
A selected metadirective replacement is not represented on the ordinary
OpenMP directive stack. As a result, nesting checks can miss both the
replacement itself and constructs nested in its associated region.
Track clause-bearing effective directive paths and use them for existing
worksharing, master, barrier, SIMD, scan, ordered, and cancellation
restrictions. Apply the checks only to reachable replacements and add
focused semantic coverage.
[clang][ssaf][clang-reforge] Tool for merging per-TU source-edit files (#216183)
Add a new tool that merges per-TU
clang::tooling::TranslationUnitReplacements YAML files for one link unit
into a single merged YAML, deduplicating identical edits and dropping
conflicting overlapping edits rather than silently picking a winner. The
tool does not apply edits to source files; that remains the caller's
responsibility via clang-apply-replacements.
rdar://179151250
[InstrProf] Fix tests broken on some platforms (#219257)
https://github.com/llvm/llvm-project/pull/217083 broke some tests on
some platforms. Require `x86_64-linux` for these tests to fix the bots.
* `memprof.ll`: MemProf's stack id hash algorithm apparently gives
different hashes depending on the platform
* `merge-traces-seed.proftext`: Apparently
`std::uniform_int_distribution` is different on some platforms, causing
our random sampling algorithm to give a different set on some platforms
[Flang][OpenMP] Privatize descriptors for assumed shape array maps for performance increase (#212336)
This PR aims to decrease the performance overhead of descriptor mapping
by privatizing the descriptors, thus having them part of the initial
kernel payload as opposed to a separate more costly H2D transfer. We do
so by modifying the map types for the descriptor, hooking into the
runtimes existing privatization of attach pointers. Some minor tweaks in
the lowering to LLVM-IR are also required to specialize around this
attach map privatization case. The intent is to expand this
privatization to more comprehensively be the default case for
descriptors, so hopefully we'll be able to assimilate the edge case
better with the member mapping in the future.
This currently only applies to assumed shape array arguments while we
test the cost effectiveness and possible downsides.
Co-author: Akash Banerjee <Akash.Banerjee at amd.com>
[clang-format] Respect definition separators when MaxEmptyLinesToKeep: 0 (#206406)
Fixes #206340.
The formatter should remove empty lines before Allman opening braces,
but should preserve the required empty line between function
definitions.
I have added a test case "AlwaysMaxEmptyLinesZeroAllman", and have
ensured other test cases run fine along with this one.
[GlobalISel] Fix inverted libcall status check in createFCMPLibcall (#219242)
BuildLibcall tested `if (!Status)` on the LegalizeResult returned by
createLibcall. Since LegalizeResult is an enum with AlreadyLegal == 0,
that condition is false for both Legalized and UnableToLegalize, so a
failed libcall was never detected. The helper then built an ICMP against
the undefined result register and reported success, so the legalizer
never fell back.
Check `Status != Legalized` instead, so failures propagate and the
caller can bail out.
On arm64ec, GlobalISel call lowering is unimplemented, so this silently
dropped `fp128` compare libcalls at `-O0`. Add a test that checks the
expected `__eqtf2`, `__lttf2` and `__unordtf2` calls are emitted at both
`-O0` and `-O2`.
[NFC][HLSL] Generalize and consolidate texture tests (#218519)
Many of the texture tests were parameterized specifically for Texture2D
and Texture2DArray, therefore retaining several 2D-specific literals,
including: the `hlsl::dimension` spelling, the width of the offset / ddx
/ ddy / LOD-location vectors, the operator[] index type and the
`spirv.Image` Dim operand.
Furthermore, the macro names used for parameterization was inconsistent
among test files.
This PR re-parameterizes the texture tests to generalize to more than
only 2D textures, and keeps the macro names consistent across test
files. Also consolidates the remaining texture-type-specific tests into
the general texture tests.
Each test file now also has a comment describing each macro used in the
test.
[9 lines not shown]
[ScalarizeMaskedMemIntrin] Preserve metadata during scalarization (#218753)
I based `copyMetadataForScalarizedLoad` on the `copyMetadataForLoad`
helper in Local.cpp. These both preserve:
- `!tbaa`
- `!fpmath`
- `!invariant.load`
- `!alias.scope`
- `!noalias`
- `!nontemporal`
- `!mem.cache_hint`
- `!llvm.mem.parallel_loop_access`
- `!llvm.access.group`
- `!noalias.addrspace`
- `!range` - range metadata applies elementwise, so the range guarantee
works for each scalarized load/store.
`copyMetadataForLoad` additionally preserves:
- `!nonnull`, `!align`, `!dereferenceable`, `!dereferenceable_or_null`,
[31 lines not shown]
[lldb-dap][NFC] Create a type alias for sourceReference. (#219018)
The spec requires sourceReference to be of type int32 and a minimum
value of 0. src_ref_t is an alias to int32_t.
Replace narrowed values in function helpers and struct declarations.
[mlir][LLVM] Use a disjoint scope domain when inlining noalias
This matches recent changes to the LLVM inliner.
AI disclosure: Claude wrote the code, I wrote the commit message and
have done initial review.
[mlir][LLVM] Add disjointScopes to AliasScopeDomainAttr
This also updates the MLIR-side inliner to clone disjoint domains
while cloning alias scopes, matching changes to LLVM.
AI disclosure: Claude wrote the code, I wrote the commit message and
looked at the code.