[CIR][NFC] Say "access unit" where the code says "unit"
`makeMemberKind` took a bool called `isUnit`, which does not say what the
member is a unit of, and the `isBitFieldUnit` predicate feeding it had the same
gap. Both become `isBitFieldAccessUnit`, matching the term classic uses, and
the helper picks up a short comment adapted from `CGRecordLayoutBuilder.cpp` so
a reader meets the definition where the parameter is read.
Assisted-by: Cursor / claude-opus-5
[GISel] Remove unused DoNotRunPass Hook
This was not used anywhere by callers of LoadStoreOpt and not even wired
up in the implementation, so remove it.
Reviewers: arsenm, aemerson
Pull Request: https://github.com/llvm/llvm-project/pull/217050
[Flang][OpenMP] Remove forced close mapping for descriptor in USM (#215350)
This was added originally to solve an issue with pointer checking on USM
devices (usm_map_close.f90 in the fortran offload tests) but no longer
appears to be required.
None the less, this isn't a fix we can keep around, we cannot force
close mapping on things, we should only carry it over if a user
specifies it (done so above). As if we force it onto the descriptor,
then on USM architectures in USM mode we're actually inflicting the user
with unwanted and unrequested host to device transfers. As we're saying
we want the descriptor to be placed in memory as close to the device as
possible (so device memory). We shouldn't make the assumption this is
what a user wishes, especially when they can now refine there mappings
to specify what they want done with the descriptor.
So, removing this as a performance and correctness optimization now that
it no longer appears to be required for the usm_map_close.f90 test on at
least a fully USM enabled system like gfx942.
[2 lines not shown]
[clang][SYCL] Embed finalized device binary for -foffload-include-binary (#216419)
During SYCL host compilation, honor -foffload-include-binary by reading
the finalized SYCL device binary it names and embedding it into the host
module, along with the registration constructors and destructors the
SYCL runtime expects. This reuses the shared offloading wrapper
(llvm::offloading::wrapSYCLBinaries).
wrapSYCLBinaries gains an IsFinalizedImage parameter.
clang-linker-wrapper scans sections whose name starts with
".llvm.offloading" for device code that still needs a device link, so an
already finalized image is placed in ".sycl_fatbin" instead.
wrapSYCLBinaries() now hands the register/unregister functions back to
the caller, and CodeGenModule::Release() adds them with
AddGlobalCtor/AddGlobalDtor.
The embedding (and adding of Ctor/Dctor to the constructors/destructors
lists) runs before registerGlobalDtorsWithAtExit in
CodeGenModule::Release(): with -fregister-global-dtors-with-atexit
[4 lines not shown]
[M68k] Fix build after IRTranslator rename to IRTranslatorLegacy (#217129)
Regression introduced by f442901707f9 ("[NewPM] Port ir-translator"),
which renamed the legacy pass but missed the M68k target.
Revert "[AArch64][BOLT] Fold local-exec TLS relocations into loads and stores" (#217095)
Reverts llvm/llvm-project#215531 due to regressions on systems with
older binutils.
[libc] Implement system function (#211672)
This Pr implements the system function, as well as adding syscall
wrappers for several syscalls that system needs.
[lldb] Don't merge a frame provider's frames into the unwinder frame list (#216847)
`Thread::ClearStackFrames` keeps the previous public frame list as the
predecessor of the next unwinder list. When a scripted frame provider is
registered, that public list is a `SyntheticStackFrameList` holding
`BorrowedStackFrames`, and the unwinder list's merge step reuses a
predecessor frame whenever the stack IDs match, so it adopted frames
belonging to the provider's list.
`UpdatePreviousFrameFromCurrentFrame` refreshes
`StackFrame::m_frame_index`, but `BorrowedStackFrame::GetFrameIndex()`
returns its own `m_new_frame_index`, which supersedes it. The adopted
frame keeps reporting its index from the previous stop, so once the
stack grows the backtrace stops counting up:
```
frame #1: middle
frame #1: main
frame #2: start
[12 lines not shown]
[lldb] Fix use-after-free of a scripted frame's register info (#216840)
`ScriptedFrame::CreateRegisterContext` built the frame's
`DynamicRegisterInfo` in a local `shared_ptr` and passed it to
`RegisterContextMemory`, which kept a `DynamicRegisterInfo` reference
and did not own it. That function was the sole owner, so the register
info died as soon as it returned, leaving the register context it had
just produced with a dangling reference.
The frame survives creation because `SetAllRegisterData` runs while the
register info is still alive. It crashes later, on the first register
lookup driven by a DWARF location expression, for instance when a
backtrace formats the frame's arguments.
This patch makes `RegisterContextMemory` own its register info: it takes
a `shared_ptr` and keeps it for its own lifetime, so a register context
is self-contained and nothing else has to stay alive on its behalf.
`ScriptedThread` and `OperatingSystemPython` both kept the register info
in a member to back the reference they handed out, so both members are
[12 lines not shown]
[docs][clang] Finish MyST migration for analyzer docs (#216245)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is a stacked PR based on #216244 , which will be a standalone
commit that
renames *.rst -> *.md before this PR lands for history preservation
purposes.
This PR has two commits:
- One that is the raw output of rst2myst
- A cleanup commit using LLMs and prompting
I validated the output by rendering the web page and looking at pixel
diffs, and all the diffs appear to be bug fixes. I don't yet have a way
to publish that artifact, but I'm working on it.
[docs][clang] Rename analyzer docs to Markdown (#216244)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is the initial straight rename commit. It will probably break the
docs build, but it has to be a separate PR for blame preservation
purposes.
newport: ensure a valid ri_stride is provided to rasops_init()
The x resolution is calculated by timings programmed into VC2, rather
than some kind of hard coded width/height from the framebuffer.
Newport always supports up to 1280x1024 regardless of what your monitor
resolution is.
However for some monitor detection timings, the resulting geometry
is not ENTIRELY correct for rasops to work with. So just round it up
to a multiple of four so a newport console will always show up regardless
of said monitor timing.
Submitted by Imre Kaloz <kaloz at dune.hu> .
Fixes PR port-sgimips/60585 .
[AMDGPU] Canonicalize num_records to its actual width in InstCombine
llvm.amdgcn.make.buffer.rsrc is overloaded on the type of its
num_records argument, but the hardware field it ends up in has a fixed
width (32 bits, or 45 bits on gfx1250 and up). Rewrite the intrinsic to
use that width, zero-extending or truncating num_records as needed, so
that IR-level optimizations can see that the extra bits of, for example,
the i64 that Clang emits are not demanded.
Targets that aren't concrete enough for the buffer resource layout to be
known are left alone.
AI disclosure: This was my idea but Claude wrote the code (and I've
tried to tighten up the comments)
[mlir][AMDGPU] Emit num_records at the buffer resource's actual width
makeBufferRsrc() zero-extended num_records to i64 on targets whose
buffer resource has a 45-bit num_records field, leaving 19 bits that the
hardware will never look at. Emit an i45 instead, which is what
rocdl.make.buffer.rsrc will end up putting in the descriptor anyway, so
that downstream consumers can see that those bits aren't demanded.
While here, factor the i32 and i64 conversion helpers into a shared
convertUnsignedToInt() that takes the target width.
AI disclosure: Claude made this, I looked at and poked the design into
shape.
[AMDGPU] Pre-commit tests for num_records canonicalization
Add tests for having InstCombine canonicalize the num_records argument
of llvm.amdgcn.make.buffer.rsrc to the width it will ultimately have,
which lets later passes see that, for example, the high bits of the i64
that Clang emits aren't used.
AI disclosure: Claude generated these and I've looked at them
[AMDGPU] Use real num_records width in LowerBufferFatPointers
Fix the following edge cases in reasoning about whether a value can be
The out-of-bounds analysis in LowerBufferFatPointers took the
num_records operand of llvm.amdgcn.make.buffer.rsrc at face value, which
went wrong in three ways.
1. The pass would crash if num_records was narrower than the
underlying hardware width.
2. A 45-bit num_records with its high bit set made all offsets look
negative, which, among other things, broke the `(1 << 45) - 1` "no
bounds checking" value.
3. The test for all-1 num_records wasn't accounting for hardware
width, leading to false positives if the num_records field was
narrower tan the underlying field.
4. Don't try to do reasoning about num_records when its width isn't
known.
AI disclosure: Claude found and took a try at fixing these, I've
reviewed
[AMDGPU] Pre-commit num_records of arbitrary width tests for LowerBufferFatPointers
Add tests to ensure that the reasoning for whether an access can be
partially out of bounds and needs to be scalarized work correctly when
num_records has a width different from the hardware width.
AI disclosure: Claude generated these and I've looked at them