[StackColoring] Change TotalStackSize from unsigned to int64_t (#208671)
StackColoring tracks the total size of the stack as `unsigned int`. This
will wrap around, even on 64-bit systems, if the stack is greater than
that resulting in a wrong size. This can happen on both PPC and RISCV64.
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (12)
Mechanically migrate the command-line target spelling on llc/opt RUN lines in
llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the folded
subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (13)
Mechanically migrate the command-line target spelling on llc/opt RUN lines in
llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the folded
subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (9)
Mechanically migrate the command-line target spelling on llc/opt RUN lines in
llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the folded
subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (10)
Mechanically migrate the command-line target spelling on llc/opt RUN lines in
llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the folded
subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (11)
Mechanically migrate the command-line target spelling on llc/opt RUN lines in
llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the folded
subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (8)
Mechanically migrate the command-line target spelling on llc/opt RUN lines in
llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the folded
subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (7) (#208836)
Mechanically migrate the command-line target spelling on llc/opt RUN
lines in llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the
folded subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (6) (#208835)
Mechanically migrate the command-line target spelling on llc/opt RUN
lines in llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the
folded subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (5) (#208834)
Mechanically migrate the command-line target spelling on llc/opt RUN
lines in llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the
folded subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
[clang-tidy] Support parentheses around subscript operators in readability-redundant-parentheses (#208759)
Subscript operators have the same operator procedure as function calls.
Treat overloaded `()` as built-in operators as a drive-by. I missed this
case when reviewing #192254.
Reject auto combined with type specifiers in C++ (#208552)
Follow-up of https://github.com/llvm/llvm-project/pull/166004
- Diagnose C++ declarations that combine `auto` with another type
specifier, such as `auto int` .
- Preserve C/C23 handling where `auto` can still be interpreted as a
storage-class specifier in valid combinations.
- Fix parser disambiguation so `auto Use = 0` treats `Use` as the
declarator name before type lookup, avoiding ambiguous lookup
regressions.
---------
Signed-off-by: Osama Abdelkader <osama.abdelkader at gmail.com>
[ARM] Use .reloc for weak symbols in PIC mode instead of GOT indirection (#208372)
In ARM ELF PIC mode, weak symbols referenced via the constant pool use a
PC-relative expression like `.long sym-(.LPC+8)`. The assembler eagerly
resolves this when both the symbol and reference are in the same
section, which prevents the linker from overriding a weak definition
with a strong one from another object file.
The previous approach (#198577) forced weak symbols to go through GOT
indirection to avoid this, but that adds an extra load. This patch
instead emits a `.reloc` directive alongside the local PC-relative
expression, forcing the assembler to emit a proper `R_ARM_REL32`
relocation. This lets the linker perform the override without the
runtime cost of a GOT load.
[LLDB] Detect Memory overlapping between AllocateMemory and MemoryInfo
IRMemoryMap estimates a free address range using memory information.
However, the memory returns by AllocateMemory can overlap with the
ranges reported by MemoryInfo (internally backed by PT_VM_ENTRY),
because the kernel is unaware of allocations made during the probing
process.
As a result, two allocatios may silently insert duplicate key for
different objects, leading to intermittent test failure. The issue is
nodeterministic because it depends on the underlying malloc
implementation and ASLR.
Fix this by detecting overlapping allocations after AllocateMemory. If
an overlap is found, fall back to the address-guessing path, which
perform the necessary overlap checks before committing the allocation.
Also, return and print message in IRInterpreter in unsecessful allocation.
[clang][test] Fix emulated-tls.cpp failure on LoongArch (#208886)
The LoongArch backend does not support emulated TLS, so
mark the test as unsupported to fix the LoongArch buildbot
failure.
Failure: https://lab.llvm.org/staging/#/builders/20/builds/28875
[AArch64][GlobalISel] Fold G_SHUFFLE to single-element TBL with zero elements. (#200938)
A TBL with out-of-range values will place zero into the respective
vector lane. Use this to generate a more efficient 1 operand TBL where
possible.
[OpenMP][Offload] Fix flang offload test (#208829)
This PR attempts to address the remaining flang offload test failure
after https://github.com/llvm/llvm-project/pull/208617. Bot:
https://lab.llvm.org/buildbot/#/builders/67/builds/8412
The problem with is test is that `foo__l8` kernel was not linked into
device image without explicitly use the amdgpu-amd-amdhsa triple in the
compilation. It only happened to this specific test.
Local test results after fix:
```
Testing Time: 146.44s
Total Discovered Tests: 3478
Skipped : 77 (2.21%)
Unsupported : 341 (9.80%)
Passed : 3055 (87.84%)
Expectedly Failed: 5 (0.14%)
```
[GlobalISel][AArch64] Improve legalization of shift amounts (#208676)
Fixes crashes when the shift amount type is already between s32 and s64,
but not s32 or s64.
The shift amount should have the same type with the shifted value for
the shift instructions, so add the same `widenScalarToNextPow2`
legalization that we apply to the shifted value, to the shift amount.
Fixes crashes in programs like:
define i8 @test(i48 %a) {
entry:
%b = lshr i48 %a, 15
%c = trunc i48 %b to i8
ret i8 %c
}
The new test crashes before this PR.
[orc-rt] Hold log level names as uppercase (#208880)
orc_rt_log_Level_getName is used primarily in text prefixes (e.g. the
upcoming printf backend's "[orc-rt:General:LEVEL]"), where uppercase is
the intended rendering. Storing the names as uppercase lets the backend
use them directly without case conversion. orc_rt_log_Level_parse
performs a case-insensitive parse, so ORC_RT_LOG=info and similar still
work.
[orc-rt] Hold log level names as uppercase.
orc_rt_log_Level_getName is expected to be primarily used in
text-prefixes (e.g. in the upcoming printf backend), where it should be
printed as uppercase. Storing as uppercase in the first place will save
us a toupper conversion on each log call.
[Clang] [Docs] Add release note for expansion statements (#208878)
This was supposed to be part of the original patch, but we lost it
because I didn't pay enough attention when I was merging the release
notes after the migration from RST -> MD (I deleted the RST file but
forgot to move the release note to the MD file...)
[LLDB] Detect Memory overlapping between AllocateMemory and MemoryInfo
IRMemoryMap estimates a free address range using memory information.
However, the memory returns by AllocateMemory can overlap with the
ranges reported by MemoryInfo (internally backed by PT_VM_ENTRY),
because the kernel is unaware of allocations made during the probing
process.
As a result, two allocatios may silently insert duplicate key for
different objects, leading to intermittent test failure. The issue is
nodeterministic because it depends on the underlying malloc
implementation and ASLR.
Fix this by detecting overlapping allocations after AllocateMemory. If
an overlap is found, fall back to the address-guessing path, which
perform the necessary overlap checks before committing the allocation.
Also, return and print message in IRInterpreter in unsecessful allocation.
[LLDB] Print stderr in HandleStop
There are some testcases silently fail in stopping hook without
returning anything on FreeBSD. We dump the error from the handler to
make it easier to debug.
[Utils] Improve documentation for `cloneLoopWithPreheader()` (#208817)
Fixed #191471.
The client needs to further update the CFG and DominatorTree after
calling `cloneLoopWithPreheader()` to ensure the IR remains valid,
the function itself does not automatically update the control flow fully.
Clarified and improved the comments for the function.
[libc++] Replace the of use custom sections for detecting overriden functions (#208330)
This is a follow up to #133876 and an alternative to #120805 which
doesn't rely on aliases and works across both ELF and Mach-O. This
mechanism is preferable in baremetal environments since it doesn't
require special handling of the custom sections.
Add build option CLANG_INCLUDE_EXAMPLES (#187317)
Adds a new build option for clang, CLANG_INCLUDE_EXAMPLES, which
controls if the examples directory is included in the build. It defaults
to the value for LLVM_INCLUDE_EXAMPLES (same as CLANG_INCLUDE_DOCS and
CLANG_INCLUDE_TESTS)
Signed-off-by: Jade Abraham <jademabraham17 at gmail.com>