[flang] Fuse chained character concatenations into one buffer (#239331)
Lowering creates one binary hlfir.concat per // operator, so `a // b //
c` was evaluated into an intermediate buffer that was then copied into
the result buffer. Add a canonicalization that folds a single-use
hlfir.concat into its user when no operation in between may modify or
release its operands, and bufferize hlfir.concat with any number of
operands. The buffer is now sized with the hlfir.concat length operand,
which can be computed outside of elemental loops, instead of the sum of
the operand lengths computed in the loop body.
I noticed this low hanging chained concat optimization when working on
the character expr refactor.
Note that we can still further optimize concat for the `a = b // c ...`
cases by using the lhs storage when there is no overlap (both for scalar
and arrays), I just did the easy change.
devel/sdl3-imgui-filedialogs: New port
This project is based on ImFileDialog by dfranx, with many bugs/crashes
fixed and overall improvements. The 'Quick Access' sidebar actually
remembers what favorites were previously saved to it from previous runs
of your application now, by saving the settings to a text file in a
hidden configuration subfolder of your home folder. It allows for full
localization among many other useful things and customizable via
environment variables.
Approved by: arrowd (co-mentor)
snd_uaudio: Fix the MIDI TX round-robin
Nothing advances curr_cable, so umidi_bulk_write_callback() only
services cable 0, which is a problem on MIDI devices with more than one
jack.
Fixes: 039477d3e7e7 ("snd_uaudio: Simplify chan->curr_cable calculation in uaudio_bulk_write_callback()")
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
[mlir][llvm] Add DIEnumeratorAttr (#241969)
Add DIEnumeratorAttr to the LLVM dialect, modeling llvm::DIEnumerator.
This is the first step of supporting enumerations in the LLVM dialect
debug info, as discussed at
https://discourse.llvm.org/t/interest-in-adding-dienumerator-and-template-parameter-debug-info-to-the-llvm-dialect/92776.
Import and export follow in a separate patch.
The attribute has an optional name, the value as an IntegerAttr, and an
unsigned flag. LLVM stores the value as an APInt of any width and its
verifier does not restrict the width (there are existing tests with 128
bit enumerators), so an IntegerAttr keeps the exact width. The unsigned
flag is stored separately, as in LLVM. The assembly format is the
declarative struct format with no custom parsing or printing. Signless
integers print in their signed form, as usual in MLIR, so an unsigned
value such as 255 : i8 is accepted but printed as -1 : i8, and the flag
keeps the information:
```
[20 lines not shown]
[analyzer] Add an option to support unity-builds in CSA
Unity-build, a.k.a jumbo-build or unified-build is a practice to build
multiple C or C++ source files in a single compilation command by
including them into a synthetic TU main file using preprocessor
`#include` directives.
By default CSA would skip all functions in the files that are compiled
in this manner because the said functions would not be defined in the
"main TU" file, but in "headers", that are really #include'd sources.
Add unitybuild-file-extensions option (empty by default) that enables
CSA to start analysis of functions defined in #include'd files as long
as their extension matches one of the extensions configured.
Assisted by GPT-Sol LLM.
--
CPP-9564
usbdevs: Add HumanWare BrailleNote Apex IDs
Add the HumanWare vendor ID and the BrailleNote Apex
product ID to support the Apex 32 BT when configured
as a screen reader terminal in USB Client mode.
This device will also serve as the starting point for
developing the FreeBSD braille(4) subsystem.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61624
twsi: Wait for the bus to go idle before starting a transfer
The status register does not read as idle (0xf8) right after the
previous transfer ended and the module was disabled. On fast
(optimised) kernels the next transfer starts too early, sees a
different status and fails with EIO ("Bad status at start of
transfer").
On the Pine H64 this made the AXP805 write that disables the PHY
supply fail from awg_shutdown(), leaving the PHY powered and the
board hanging on warm reboot. Poll the status register for up to 1ms
before declaring the bus not idle.
Tested on: Pine H64 (5 warm reboots with a NODEBUG kernel)
Fixes: cb167e1ae954 ("twsi: do not attempt transfer if bus is not idle")
[RISCV] Add fmv.h/w/d.x to foldMemoryOperandImpl for reloads. (#243192)
May help with #242978.
I found an old PR #78408 that also tried to do this, but it was more
complex and may have a bug for using an FSW to write a GPR stack
slot on RV64.
Assisted-by: Claude
[RISCV][P-ext] Fix assertion when legalizing i64 shift amounts on RV32 (#243366)
Previously, right shifts could incorrectly take the WSLL/WSLA path,
which also truncated the shift amount to i32. So the assertion failure
was never found.
After https://github.com/llvm/llvm-project/pull/242773, generic type
legalization can produce an i32 shift with an i64 shift amount on
RV32+P. Legalizing the shift amount then reaches an assertion that only
permits i32 shift amounts on RV64.
This commit allows the RV32+P case so generic legalization can expand
the shift amount.
Closes #243365