[libc][NFC] update configure page with wchar flag (#177050)
Whenever the cmake runs it updates configure.rst based on the contents
of config.json. This PR just applies the change generated after #176110
[libc] Cast in startup to silence warning (#177048)
In #174772 gcc warns on an implicit cast from `ElfW(Xword)` (unsigned
long
int) to `ElfW(word)` (unsigned int). This PR adds an explicit cast.
[flang][cuda] Add cuf.device_address conversion into separate pass (#177035)
Some conversion are better done later in the pipeline. Add
cuf.device_address conversion in its own pass so it can be scheduled
late.
The pattern will be removed from CUFOpConversion once this pass has
landed.
[NFC][LTO] Move isPreservedName out of IRSymtab into LTO's Symbol
This resolves the FIXME in IRSymtab and cleans up the semantics of the
IRSymtab. The list of preserved symbols really shouldn't be seen as a
property of the IR symbol table, since it's an LTO-specific concern, and
it's very tenuous to claim that this information is actually present in
the bitcode file to be exposed through its symbol table.
Instead, this PR moves this logic into LTO's view of the symbol, which
allows consumers to determine preserved-ness themselves. This was broken
out of #164916; this prevents that PR from introducing a circular
dependency, but it still seems like an independently good idea by virtue
of the above.
[SPARC] Prevent RESTORE from sourcing from %o7 in call delay slots (#172593)
Combining instructions that reads from %o7 with a RESTORE in call delay
slots will result in a RESTORE instruction that reads from %o7, which
has been overwritten by the call instruction, resulting in junk values
being produced.
This should fix the issue with `test-suite::lencod.test`.
[libc][linux] add support to parse PT_GNU_PROPERTY (#174772)
In order to add Control-flow Enforcement Technology (CET) Shadow Stack
(SHSTK) support, we need to parse the `PT_GNU_PROPERTY` program header
and the corresponding section to evaluate if the binary being started
was compiled with the necessary support.
PS: This is my first PR to llvm-libc, I might have made obvious styling
mistakes so I'd appreciate any feedback or suggestions to improve it.
I have a prototype branch using this change to enable SHSTK support:
https://github.com/jakos-sec/llvm-project/tree/add-shstk-support
[AArch64] Consider MOVaddr* as cheap if fuse-adrp-add
These pseudo-instructions usually translate into a pair of adrp+add and
have a single cycle latency on some micro-architectures.
[libc] Reland %lc support in printf (#176110)
Add support for %lc in printf by calling internal wcrtomb function and
relevant end-to-end sprintf test.
Additionally, made the following changes:
- Modified printf parser for recognizing length modifier
- Added two internal error codes.
- Added a flag to disable wchar support on windows platform.
- To keep printf interface header only, converted wcrtomb and
CharacterConverter to header only implementation and removed the cpp
source.
Resolves GPU libc issues in #169983 and original issue: #166598
---------
Co-authored-by: shubhe25p <shubhp at mbm3a24.local>
Co-authored-by: Joseph Huber <huberjn at outlook.com>
[LLDB] Close previously opened handles in `PseudoConsole` (#176775)
In
https://github.com/llvm/llvm-project/pull/175837#issuecomment-3749408432
I mentioned that any handles that were previously opened and haven't
been closed since, won't be closed in the destructor nor in
`OpenPseudoConsole`.
In this PR, I added `Close` calls to these methods. Calling `Close()` is
a no-op if the handles are invalid.
AArch64/GlobalISel: Use LibcallLoweringInfo in utils (#176946)
Wire up the boilerplate to get the query for bzero from
LibcallLoweringInfo instead of TargetLowering.
[Offload] Cast to `void *` in the debug message (#177019)
There are a few places where data types based on character array or
string are printed in the debug message while they do not represent
strings. Such expressions should be casted to `void *` unless they
represent actual strings. Change also includes casting from integral
type to pointer type when appropriate.
[LV] Check if VPlan contains FindLast reduction directly (NFC).
Directly check the VPlan to see if there are any FindLast reductions.
Currently this is NFC, but checking in the VPlan is more future proof,
e.g. if reductions are simplified, removed or transformed. Then checking
in legacy LoopVectorizationLegality is inaccruate.
[MLIR][XeGPU]: Reject `tensor_desc` types with unknown bitwidth (#173922)
Fixes https://github.com/llvm/llvm-project/issues/173851
1. Only allow XeGPU_ScalarType element types in `xegpu::TensorDescType`
(via verifier, keeping mlir::Type params in api)
2. Fix `VectorToXeGPU` to prevent vectors with invalid TensorDescType
element types from lowering
[LoopUnroll][NFC] Simplify recent block frequency tests
Refactor a number of recent tests in
`llvm/test/Transforms/LoopUnroll/branch-weights-freq` to make it
easier to understand and extend them.
The changes mostly resemble the refactoring I recently did in
PR#165635 in response to reviewer comments:
- For each case (e.g., each `-unroll-count` value in
`unroll-epilog.ll`), group all FileCheck directives together. That
way, while digesting a single case, the reader does not need to sift
through all other cases and a complex FileCheck prefix scheme.
- Reduce CFG testing. Drop many FileCheck directives that check for
all basic block labels and branches, and drop the cryptic
`-implicit-check-not` that excludes others. Instead, just use
positive checks for every loop body (represented by `call void @f`),
for relevant metadata, and for the branch instructions to which the
metadata is attached, and use simple negative checks (e.g.,
`-implicit-check-not='!prof'`) to be sure we have not missed any.
[4 lines not shown]
[IR] Update dereferencable wording after opaque pointers (#176991)
The documentation for the dereferenceable argument attribute mentioned
pointee types. Making a distinction around a pointee type no longer
makes sense after the move to opaque pointers.
[AMDGPU] Allow predicates for alias in VFLAT_Real_AllAddr_gfx1250 (#176987)
Expose alias definition earlier, and add a new argument to specify the predicates for alias definition.
This is for downstream development and NFC for now.
[PowerPC] cost modeling for length type VP intrinsic load/store (#168938)
Override and fill in the target hooks for PPC that allow opt to cost
using length style VP intrinsics for load/store.