[Driver][OpenBSD] Use -no-pie instead of -nopie (#220464)
Downstream in OpenBSD there is a patch to add support for -nopie in lld
(which it has used by default since 2018). In this repo lld does not
support `-nopie`, so when building clang and lld, you cannot link an
executable with `clang -fno-pic`. Clang now uses the more widely used
spelling here so that toolchains built from this repo can cross compile
to OpenBSD successfully.
This change is an issue on OpenBSD if users passed a different linker
with `-fuse-ld` / `--ld-path` to `ld.bfd` which is still installed by
default but doesn't support the `-no-pie` spelling with their patches.
[CIR] Implement lowering for lib-call atomic expr (atomic_exchange) (#220405)
Pretty straight forward implementation, but n ecessary for some of our
test suite.
[RISCV][GlobalISel] Legalize llvm.clmul for native XLEN types (#220178)
Translate llvm.clmul to G_CLMUL in IRTranslator.
Mark G_CLMUL legal for native XLEN scalar types on RISC-V targets with
Zbc or
Zbkc.
Tests cover RV32 and RV64 code generation with both Zbc and Zbkc.
Remove the global __do_color_init, this is now obsolete. It was used
to force the terminal to be updated with the default colours because
the older colour code could not distinguish between default colours and
no colours. Now this is fixed so the forcing is no longer required.
[SLP][modularisation][NFC] Move full-vector width helpers to SLPTypeUtils (2/2)
Move the following BoUpSLP-independent helpers out of SLPVectorizer.cpp
into SLPVectorizer/SLPTypeUtils.{h,cpp}:
getFullVectorNumberOfElements
getFloorFullVectorNumberOfElements
getMaskedDivRemType
hasFullVectorsOrPowerOf2
They build on the type helpers moved in (1/2). Behavior is unchanged.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
[orc-rt] Use move_only_function in OptionParser (#220474)
Replace std::function with move_only_function in OptionParser.
move_only_function is preferred where possible to std::function, and we
didn't need these values to be copyable.
[LongVec] Add Support for pure HLSL APIs (#218155)
resolves https://github.com/llvm/llvm-project/issues/217716
The last pr only added them to clang builtins with the
"__builtin_elementwise" prefix. This adds the long vector support to the
ones written entirely in hlsl.
[SLP][modularisation][NFC] Move full-vector width helpers to SLPTypeUtils (2/2)
Move the following BoUpSLP-independent helpers out of SLPVectorizer.cpp
into SLPVectorizer/SLPTypeUtils.{h,cpp}:
getFullVectorNumberOfElements
getFloorFullVectorNumberOfElements
getMaskedDivRemType
hasFullVectorsOrPowerOf2
They build on the type helpers moved in (1/2). Behavior is unchanged.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
[SLP][modularisation][NFC] Move type/width helpers to SLPTypeUtils (1/2) (#214672)
Move the following BoUpSLP-independent type/width helpers out of
SLPVectorizer.cpp into a new SLPVectorizer/SLPTypeUtils.{h,cpp}:
isValidElementType
getValueType
getWidenedType
SLPReVec is passed as an explicit bool parameter to the moved helpers;
behavior is unchanged.
Part of the SLPVectorizer.cpp modularization effort:
https://discourse.llvm.org/t/modularizing-slpvectorizer-cpp/90922
[test][LoongArch][MC] Fix lifetime of MCOptions in LoongArchMCDisassemblerTest (#220453)
The original testbench added in #217971 contains a lifetime violation of
the stack-allocated `MCTargetOptions` object. Construct it in the
testing context instead to get a static lifetime. Now, the pattern is
consistent with
[X86MCDisassemblerTest.cpp](https://github.com/llvm/llvm-project/blob/ed1626b9d0eaf7c406f44da5fb595ad94559f54b/llvm/unittests/MC/X86/X86MCDisassemblerTest.cpp#L29).
Fixes: #217971
CC: @fmayer, @heiher, @zhaoqi5, @SixWeining
DTLTO Cache optimization
Currently, DTLTO cache works this way: when native object file is
generated and sent back by the remote compilation, it's being saved on
the disk, then the content of this file is read and written into a
buffer and subsequently it's read from the buffer and written into the
cache file. This is obviously non-efficient.
With this optimization, after the native object file is saved on the
disk, it's being renamed into a cache file.
snd_uaudio: drop the default monitor level to 10%
As noted in the comment, some headsets with a hardware sidetone are
incredibly sensitive and emit immediate feedback upon attach with the
current system-wide default of 75%. Drop it down just for snd_uaudio(4)
to avoid incredibly unpleasant surprises.
MFC after: 3 days
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D59199
rc: add a backlight service to save/restore backlight levels
The default on my laptop is annoyingly bright, and this is a useful
feature to mitigate that. The backlight script is largely a copy of the
mixer service which provides the same value for mixers, but this one is
specifically dependant on kld to allow DRM drivers a chance to attach.
Note that it's off by default to avoid interference with DEs, and
document the capability in backlight(8). Set backlight_enable=YES in
rc.conf(5) to enable save/restore.
Relnotes: maybe
Reviewed by: bapt, ivy, manu, ziaee
Differential Revision: https://reviews.freebsd.org/D59296
[SPARC] Fix SelectForceADDRrr for global addresses and non-reg operands (#220013)
When lowering byte-swapped memory operations on SPARC V9, LLVM emits
ASI-tagged memory instructions (such as STHArr, STArr, LDArr, etc.) that
require register+register addressing modes matched via ForceADDRrr.
SelectForceADDRrr previously forwarded 2-operand address nodes directly
to SelectADDRrr. However, SelectADDRrr explicitly returns false when
encountering SPISD::Lo (used in %hi/%lo global address calculations) or
small constant offsets in order to allow standard ADDRri patterns to
match. Because SelectForceADDRrr returned the result of SelectADDRrr
directly instead of falling back to Base = Addr, Disp = %g0, any
endian-adjusted load or store targeting a global variable failed to
select and caused a backend compiler crash:
"Cannot select: SPISD::STORE_LITTLE ..."
Fix SelectForceADDRrr so that if SelectADDRrr fails to match, it falls
back to evaluating the full address into a base register and using %g0
as the offset register. Also add tests for global variable byte-swapped
[5 lines not shown]
[orc-rt] Add skeleton command-line options parsing to ogre (#220467)
Just adds --help and --verbose options for now. The set can be extended
by adding fields to the Options struct and corresponding rules to the
parser.
[mlir][VectorToXeGPU] Un-flatten gather/scatter in convert-vector-to-xegpu (#218292)
XeGPU layouts (sg_layout, inst_data, lane_layout, ...) are expressed in
terms of the N-D shape of the accessed data. Frontends, however, often
emit vector.gather / vector.scatter with 1-D operands obtained by
shape_cast-ing N-D indices and masks. That forces layout propagation to
reason backwards through the surrounding shape_casts, which adds
complexity and tends to yield layouts that lower to unoptimized code.
This PR restores the N-D form of a flattened gather/scatter as a step in
the convert-vector-to-xegpu pass. The N-D shape is taken from the index
operand's producer, so the rewrite only ever undoes a flattening that
already happened.
assisted-by-claude
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
[X86] Fix miscompilation in combinePMULH for types larger than 32 bits (#219996)
The combinePMULH DAG combine optimizes patterns like
trunc(lshr(mul(sext, sext), ShiftAmt) to i16) into X86 pmulhw
instructions followed by a right shift. Previously, this combine
unconditionally emitted a logical shift right to process the remainder
of the shift.
This is correct when the original multiplication type is 32 bits (as the
lshr naturally shifts in zeros from out-of-bounds bits). However, when
the multiplication type is larger than 32 bits, this results in a
miscompilation for negative products.
Fixes: https://github.com/llvm/llvm-project/issues/218844