Reland "[flang][openacc] Prevent SimplifyArrayCoorOp from folding rebox used by ACC data entry ops (#187616)" (#187626)
The SimplifyArrayCoorOp canonicalization pattern folds fir.rebox into
fir.array_coor by replacing the rebox result with its source. When the
rebox result is the variable of an acc.copyin (or other data entry op),
this folding breaks the chain that LegalizeDataValuesInRegion relies on
to replace host values with device pointers inside compute regions. With
default(none), ACCImplicitData cannot recover the mapping, leaving the
rebox source as an illegal live-in in the offload region.
This is causing illegal live-ins at higher optimization levels.
Guard the folding so it bails out when any user of the rebox is an
ACC_DATA_ENTRY_OPS.
The buildbots failure were cuased by a missing dependency
[mlir-python] Fix duplicate EnumAttr builder registration across dialects. (#187191)
When multiple dialects share td `#includes` (e.g. `affine` includes
`arith`), each dialect's `*_enum_gen.py` file registers attribute
builders under the same keys, causing "already registered" errors on the
second import; the first commit checks in such a case which currently
fails on main:
```
# | RuntimeError: Attribute builder for 'Arith_CmpFPredicateAttr' is already registered with func: <function _arith_cmpfpredicateattr at 0x78d13cbe9a80>
```
This PR implements a two-pronged fix:
1. Add `allow_existing=True` to `register_attribute_builder` (and the
underlying C++ `registerAttributeBuilder`). When set, silently skips
registration if the key already exists (first-wins semantics). This
handles `EnumInfo`-based builders which have no dialect prefix (e.g.
`AtomicRMWKindAttr`, `Arith_CmpFPredicateAttr`), which may be emitted by
[13 lines not shown]
[flang][NFC] Converted five tests from old lowering to new lowering (part 35) (#187407)
Tests converted from test/Lower/Intrinsics: len.f90,
lge_lgt_lle_llt.f90, log.f90, matmul.f90, max.f90
[clang][headers][endian.h] add some common extensions (#187565)
This PR adds two common extensions to `endian.h` found in some
implementations which we've encountered usages of in existing code (which
are allowable under POSIX), namely:
- double underscore versions of the byte order macros
- PDP endianness macros
(note: we don't attempt to implement the actual conversion helpers for
PDP endianness, as LLVM doesn't support these targeting platforms with
this endianness, we just provide the macro so code checking against them
on other targets will compile)
[orc-rt] Redesign Session to provide a clearer lifecycle. (#187496)
A Session begins in the Start state. In this state no calls will be
received from the controller (since none is attached yet). This provides
clients with an opportunity to configure the Session before attaching a
ControllerAccess object with the `attach` method.
The first call to the `attach` method will register a ControllerAccess
object with the Session, and the ControllerAccess's connect method will
be called to establish a connection with the controller.
If ControllerAccess::connect fails it must call
ControllerAccess::notifyDisconnected, at which point the Session will
proceed to the Detached state.
If ControllerAccess::connect succeeds (i.e. returns without calling
notifyDisconnected) then the Session moves to the Attached state, and
calls can be made in both directions between the executor and
controller.
[18 lines not shown]
[LoongArch] Ensure .dwo sections do not contain relocations (#187429)
When linker relaxation is enabled, LoongArchAsmBackend may emit
relocations for same-section symbol differences, even when the fixup
is in a .dwo section. This leads to errors such as:
error: A dwo section may not contain relocations
Split DWARF (.dwo) sections must not contain relocations. Fix this by
resolving such fixups immediately when they are emitted into .dwo
sections, even if the referenced symbols are in relaxable sections.
This avoids generating invalid relocations in .debug_*.dwo sections
when compiling with -gsplit-dwarf and -mrelax.
Fixes #187428
[M68k] Fix pipeline.ll test after CodeGenPrepare analysis change (#187617)
211279d11c36 added Post-Dominator Tree Construction, Branch Probability
Analysis, and Block Frequency Analysis before CodeGen Prepare but missed
updating the M68k pipeline test.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply at anthropic.com>
[flang][openacc] Prevent SimplifyArrayCoorOp from folding rebox used by ACC data entry ops (#187616)
The SimplifyArrayCoorOp canonicalization pattern folds fir.rebox into
fir.array_coor by replacing the rebox result with its source. When the
rebox result is the variable of an acc.copyin (or other data entry op),
this folding breaks the chain that LegalizeDataValuesInRegion relies on
to replace host values with device pointers inside compute regions.
With default(none), ACCImplicitData cannot recover the mapping, leaving
the rebox source as an illegal live-in in the offload region.
This is causing illegal live-ins at higher optimization levels.
Guard the folding so it bails out when any user of the rebox is an
ACC_DATA_ENTRY_OPS.
[Bazel] Port 81e8a1e59ee28e5403d8a78874c37f853d18d4fb
This patch introduces a dependency from driver to dependency_scanning.
We need to tease out dependency_scanning's current dependency on driver
(just some headers that can be removed) and then add a depenency in
driver on dependency_scanning to make the patch work.
[AtomicExpandPass] Remove AtomicExpandUtils.h (NFC) (#187609)
The purpose of AtomicExpandUtils.h was to allow code reuse with [PNaCl
](https://en.wikipedia.org/wiki/Google_Native_Client)which has since
been deprecated. This PR removes the file, and migrates the declarations
to be visible only in the necessary scopes.
[libclc] Restore previous generic fmod implementation (#187470)
Restore from before 3c7f70bb9cee for targets that do not yet implement
frem. Keep the __builtin_elementwise_fmod-based implementation for
AMDGPU.
[libc][docs][NFC] Add Build Concepts and consolidate patterns (#187490)
[libc][docs][NFC] Add Build Concepts page with five build scenarios
Added build_concepts.rst defining the five ways to build LLVM-libc:
overlay, full build, bootstrap, cross-compiler, and bootstrap
cross-compiler. Updated full_host_build.rst to cross-reference the new
concepts page for both the runtimes and bootstrap build sections, and
removed a duplicate GWP_ASAN flag from the sysroot CMake recipe. Added
the new page to index.rst.
[libclang/python] Deprecate _CXUnsavedFile, introduce UnsavedFile instead (#187412)
To maintain consistency with other classes mirrored from libclang, the
`_CX` prefix should be removed.
The old name is introduced as a subclass of the renamed class, and
deprecation warnings are added on every attribute access.