[FIRToMemRef] Doc collectSliceInfoFrom, getMemrefIndices, canonicalizeIndex (#207699)
Also drops the unused `converted` parameter from getMemrefIndices. The
internal workings of these functions were not easy to understand for me
so I worked with Claude to document with examples. Hopefully, that makes
the code easier to read. I reviewed the docs and corrected some obvious
hallucinations produced by the agent.
Co-Authored-By: Claude Sonnet 4.6 noreply at anthropic.com
[ELF,test] Fix FileCheck RUN line in gc-sections-keep-shared-start.s (#207678)
Fix a malformed multiline RUN line.
---------
Co-authored-by: Fangrui Song <i at maskray.me>
[RISCV][MC] Improve diagnostics for Zclsd RV32 GPR pair operands (#207639)
Add dedicated assembler diagnostics for the RV32 GPR pair operands used
by
Zclsd compressed load/store pair instructions.
After the RISC-V asm parser started reporting multiple near-miss
reasons, these
operands still fell back to the generic "invalid operand for
instruction" note.
Give them explicit diagnostic types and messages so invalid register
pairs report
the expected pair constraints.
[LLDB][FreeBSD] Fix build from FileSpec change (#207819)
FileSpec now returns llvm::StringRef instead of ConstString. As a
result, we don't need to use GetCString to get the raw string. Remove it
to fix build failure.
Fixes: f9b5264523b1 (#206802)
[LFI][X86] Add X86 LFI target and system instruction rewrites (#189569)
This PR introduces an x86-64 backend for Lightweight Fault Isolation
(LFI), similar to the one being developed for AArch64. LFI is a
compiler-based mechanism that enables efficient in-process sandboxing.
See the RFC from last fall for details.
This PR adds the `x86_64_lfi` target (similar to `aarch64_lfi`), sets up
reserved registers, and implements some initial rewrites for system
instructions (system calls and TLS accesses). The rewrites are done at
the MC level, using the `MCLFIRewriter` infrastructure. I have updated
the documentation to describe the x86-64 sandboxing scheme and to list
rewrites that will be implemented in future PRs (to keep each individual
PR small).
For performance and compatibility reasons, the plan is currently to use
bundling for maintaining control-flow integrity in the sandbox, which
is not yet supported. For now we are setting up the rewrites without using
bundling, but we can also use a CFI mechanism based on shadow
stack+endbr in order to have something usable while bundling is
in progress.
[AMDGPU] Fix whole-wave function prologue to set EXEC to -1 (#207781)
A whole-wave function body must run with all lanes on. With no WWM
spills the prologue emitted `S_XOR_SAVEEXEC`, giving `EXEC` =
`~entryEXEC`
[SPIR-V] Fix ArrayStride truncation to 0 for sub-byte element types (#207140)
addArrayStrideDecorations computed the stride as `getTypeSizeInBits/8`
which truncates to 0 for sub-byte element types such as i1
0 strides are disallowed in spec
---------
Co-authored-by: Juan Manuel Martinez Caamaño <jmartinezcaamao at gmail.com>
[flang] Add ability to implicitly use a module (#207824)
Add parser and semantics plumbing for configured implicit USE modules,
reusing
the normal USE-association path so public symbols and common blocks are
imported
consistently.
[Tooling] Preserve backslashes in POSIX source paths (#207499)
On POSIX, backslashes are valid filename characters. Avoid converting
them to slashes when computing absolute source paths in LibTooling,
since doing so changes paths such as `a\b.cc` into `a/b.cc`.
Closes #207396
Fix APInt::concat for zero-width operands (#207475)
APInt::concat triggered undefined behavior (invalid shift exponent) when
concatenating a zero-width operand with a 64-bit operand on the fast
path (combined width <= 64). For example, `I0.concat(I64)` resulted in
`U.VAL << 64`, which is UB.
Fix by checking for zero-width operands early and returning the other
operand. Added regression tests to `APIntTest.cpp`.
CI: move libclang python bindings tests to main CI (#201677)
This removes the separate python bindings CI, which run on the GitHub
free runners and take more than one hour to build libclang.
The tests are executed instead in the monolithic pipelines, whenever
clang would be tested.
That only tests whatever python version we set up for that pipeline.
This is fine in terms of resources because all the dependencies are
built anyway, and the tests themselves take less than one second to run
on the free runners.
[CodeGen] Rename prologpeilog to prolog-epilog (#207870)
This is primarily to ensure consistenct with the new pass manager where
the name of the pass is already prolog-epilog, which is more consistent
with our existing naming scheme. This is necessary to be able to run
existing llc invocations that explicitly specify prolog-epilog under the
NewPM automatically.
Assisted by Gemini.
[ORC] Fix reinterpret_cast warning. (#207874)
https://github.com/llvm/llvm-project/pull/206725#issuecomment-4896222897
reported warnings on windows builds due to reinterpret_cast:
warning C4312: 'reinterpret_cast': conversion from 'unsigned int' to
'void *' of greater size
This commit fixes the issue by using ExecutorAddr::toPtr for conversion
instead of reinterpret_cast.
CI: move libclang python byindings tests to main CI
This removes the separate python bindings CI, which run on the GitHub free
runners and take more than one hour to build libclang.
The tests are executed instead in the monolithic pipelines,
whenever clang would be tested.
This is fine in terms of resources because all the dependencies are
built anyway, and the tests themselves take less than one second to
run on the free runners.
[clang-doc] Move Markdown into its own subdirectory (#207856)
Removes the need for PARTIAL_SOURCES_INTENDED by giving clangDocMarkdown
its own directory. Addresses post-merge feedback on #205609.
[libc][RISC-V] Temporarily disable dirent (#207867)
The RISC-V 32 QEMU buildbot is failing due to missing SYS_fcntl, which
is needed for fdopendir. Since that syscall is referenced in the shared
dir code it's easiest to just disable all the dirent functions for now.
[NFC][LLVM][NVPTX] Minor code cleanup in NVVMReflect (#207549)
Use explicit types instead of auto when the type is not obvious. Use
`StringRef` type in the range for loop over `ReflectList`, allowing
additional code cleanups.