525864 Commits

Author SHA1 Message Date
Alex Rønne Petersen
923a5c4f83 Revert "[ARM][ConstantIslands] Correct MinNoSplitDisp calculation (#114590)"
This reverts commit e48916f615e0ad2b994b2b785d4fe1b8a98bc322.
llvmorg-20.1.3
2025-04-15 17:23:49 -07:00
Ikhlas Ajbar
86f5891c59 [llvm][Hexagon] Promote operand v2i1 to v2i32 (#135409)
Fixes #118879

(cherry picked from commit 32c39092eab3a401d9d028c21f4707102fd70e32)
2025-04-15 17:22:27 -07:00
Louis Dionne
d55c3c2052 [libc++] Fix misplaced _LIBCPP_POP_MACROS (#134874)
Fixes #134681

(cherry picked from commit 4ab86edb560a2e1152e22700b0cb386759286c37)
2025-04-15 17:20:58 -07:00
Younan Zhang
9420327ad7 [Clang] Fix a lambda pattern comparison mismatch after ecc7e6ce4 (#133863)
In ecc7e6ce4, we tried to inspect the `LambdaScopeInfo` on stack to
recover the instantiating lambda captures. However, there was a mismatch
in how we compared the pattern declarations of lambdas: the constraint
instantiation used a tailored `getPatternFunctionDecl()` which is
localized in SemaLambda that finds the very primal template declaration
of a lambda, while `FunctionDecl::getTemplateInstantiationPattern` finds
the latest template pattern of a lambda. This difference causes issues
when lambdas are nested, as we always want the primary template
declaration.

This corrects that by moving `Sema::addInstantiatedCapturesToScope` from
SemaConcept to SemaLambda, allowing it to use the localized version of
`getPatternFunctionDecl`.

It is also worth exploring to coalesce the implementation of
`getPatternFunctionDecl` with
`FunctionDecl::getTemplateInstantiationPattern`. But I’m leaving that
for the future, as I’d like to backport this fix (ecc7e6ce4 made the
issue more visible in clang 20, sorry!), and changing Sema’s ABI would
not be suitable in that regards. Hence, no release note.

Fixes https://github.com/llvm/llvm-project/issues/133719

(cherry picked from commit dcc2182bce3d2ef0e0a991664c51b4b3bfcf7197)
2025-04-15 15:53:53 -07:00
Aaron Ballman
4da7285e63 Silence -Wcast-function-type warnings on idiomatic Windows code (#135660)
On Windows, GetProcAddress() is the API used to dynamically load
function pointers (similar to dlsym on Linux). This API returns a
function pointer (a typedef named FARPROC), which means that casting
from the call to the eventual correct type is technically a function
type mismatch on the cast. However, because this is idiomatic code on
Windows, we should accept it unless -Wcast-function-type-strict is
passed.

This was brought up in post-commit review feedback on
https://github.com/llvm/llvm-project/pull/86131
2025-04-15 14:31:14 -07:00
Florian Hahn
c5109be53b [LV] Disable epilogue vectorization for FindLastIV if start is poison.
Back-porting properly freezing of the start value during epilogue
vectorization (2bdc1a1337) is non-trivial. For the 20.x release, just
disable epilogue vectorization for FindLastIV reductions where the start
value may be poison or undef.

Fixes #126836.
2025-04-15 14:14:15 -07:00
Florian Hahn
91a3f14d94 [LV] Add tests with FindLastIV and epilogue vectorization.
Tests for #126836.
2025-04-15 14:14:15 -07:00
Dominik Adamski
2131242240 [LLVM][MemCpyOpt] Unify alias tags if we optimize allocas (#129537)
Optimization of alloca instructions may lead to invalid alias tags.
Incorrect alias tags can result in incorrect optimization outcomes for
Fortran source code compiled by Flang with flags: `-O3 -mmlir
-local-alloc-tbaa -flto`.

This commit removes alias tags when memcpy optimization replaces two
arrays with one array, thus ensuring correct compilation of Fortran
source code using flags: `-O3 -mmlir -local-alloc-tbaa -flto`.

This commit is also a proposal to fix the reported issue:
https://github.com/llvm/llvm-project/issues/133984

---------

Co-authored-by: Shilei Tian <i@tianshilei.me>
(cherry picked from commit 716b02d8c575afde7af1af13df145019659abca2)
2025-04-15 13:17:35 -07:00
Louis Dionne
86c9853638 [libc++] Fix deployment targets that were incorrectly bumped (#134278)
When I introduced the various `_LIBCPP_INTRODUCED_IN_LLVM_XY_ATTRIBUTE`
macros in 182f5e9b2f03, I tried to correlate them to the right OS
versions, but it seems that I made a few mistakes. This wasn't caught in
the CI because we don't test back-deployment that far.

rdar://148405946
(cherry picked from commit a97f73405f8e074263a0ed2dd2b8c87c014f46d9)
2025-04-15 13:15:42 -07:00
Louis Dionne
dfd6f12336 [libc++] Guard additional headers with _LIBCPP_HAS_LOCALIZATION (#131921)
There were some remaining headers that were not guarded with
_LIBCPP_HAS_LOCALIZATION, leading to errors when trying to use modules
on platforms that don't support localization (since all the headers get
pulled in when building the 'std' module). This patch brings these
headers in line with what we do for every other header that depends on
localization.

This patch also requires including <picolibc.h> from
<__configuration/platform.h> in order to define _NEWLIB_VERSION. In the
long term, we should use a better approach for doing that, such as
defining a macro in the __config_site header.

(cherry picked from commit 4090910a695efcba4b484e9f8ad2b564e9a4e7ed)
2025-04-15 13:14:13 -07:00
Pavel Labath
dc9d4f9a70 [lldb] Respect LaunchInfo::SetExecutable in ProcessLauncherPosixFork (#133093)
Using argv[0] for this was incorrect. I'm ignoring LaunchInfo::SetArg0,
as that's what darwin and windows launchers do (they use the first
element of the args vector instead).

I picked up the funny unit test re-exec method from the llvm unit tests.

(cherry picked from commit 39e7efe1e4304544289d8d1b45f4d04d11b4a791)
2025-04-15 13:11:58 -07:00
ZhaoQi
9c7d728698 [LoongArch] Move fix-tle-le-sym-type test to test/MC. NFC (#133839)
(cherry picked from commit 46968310cb837e4b32859edef2107080b828b117)
2025-04-15 13:10:22 -07:00
Phoebe Wang
0c30835a63 [X86][AVX10] Remove VAES and VPCLMULQDQ feature from AVX10.1 (#135489)
According to SDM, they require both VAES/VPCLMULQDQ and AVX10.1 CPUID
bits.

Fixes: #135394
(cherry picked from commit ebba554a3211b0b98d3ae33ba70f9d6ceaab6ad4)
2025-04-14 12:45:29 -07:00
Wang, Phoebe
2e09664082 [X86] Backport saturate-convert intrinsics renaming & YMM rounding intrinsics removal in AVX10.2
AVX10.2 YMM rounding instructions are removed from latest AVX10 technical paper. Remove all intrinsics from compiler.

AVX10.2 saturate-convert intrinsics are modified to use "s_" in the name. It is a consensus made with GCC folks to avoid future ambiguity.
2025-04-14 12:43:46 -07:00
Yingwei Zheng
0dd4235473 [SCEV] Use ashr to adjust constant multipliers (#135534)
SCEV converts "-2 *nsw (i32 V)" into "2148473647 *nsw (i32 V)". But we
cannot preserve the nsw flag when the constant multiplier is negative.
This patch changes lshr to ashr so that we can preserve both nsw and nuw
flags.

Alive2 proof: https://alive2.llvm.org/ce/z/LZVSEa
Closes https://github.com/llvm/llvm-project/issues/135531.

(cherry picked from commit bb9580a02b393683ff0b6c360df684f33c715a1f)
2025-04-14 12:38:12 -07:00
Hua Tian
a141e58685 [llvm][CodeGen] avoid repeated interval calculation in window scheduler (#132352)
Some new registers are reused when replacing some old ones in
certain use case of ModuloScheduleExpander. It is necessary to
avoid repeated interval calculations for these registers.

(cherry picked from commit 7e65944292278cc245e36cc6ca971654d584012d)
2025-04-14 12:34:31 -07:00
Hua Tian
d88cd35023 [llvm][CodeGen] Fix the empty interval issue in Window Scheduler (#129204)
The interval of newly generated reg in ModuloScheduleExpander is empty.
This will cause crash at some corner case. This patch recalculate the
live intervals of these regs.

(cherry picked from commit b09b9ac1081d19c8021df8e55e96cd1325f0eed0)
2025-04-14 12:34:31 -07:00
Kazu Hirata
73d1e8598e [CodeGen] Avoid repeated hash lookups (NFC) (#130237)
(cherry picked from commit 616f277640129ff37d4005737a62acbd60d06ca1)
2025-04-14 12:34:31 -07:00
Mariya Podchishchaeva
7034995f10 [clang] Handle Binary StingLiteral kind in one more place (#132201)
The bots are upset by https://github.com/llvm/llvm-project/pull/127629 .
Fix that.
2025-04-14 12:26:02 -07:00
Mariya Podchishchaeva
2e7710eaff [clang] Introduce "binary" StringLiteral for #embed data (#127629)
StringLiteral is used as internal data of EmbedExpr and we directly use
it as an initializer if a single EmbedExpr appears in the initializer
list of a char array. It is fast and convenient, but it is causing
problems when string literal character values are checked because #embed
data values are within a range [0-2^(char width)] but ordinary
StringLiteral is of maybe signed char type.
This PR introduces new kind of StringLiteral to hold binary data coming
from an embedded resource to mitigate these problems. The new kind of
StringLiteral is not assumed to have signed char type. The new kind of
StringLiteral also helps to prevent crashes when trying to find
StringLiteral token locations since these simply do not exist for binary
data.

Fixes https://github.com/llvm/llvm-project/issues/119256
2025-04-14 12:26:02 -07:00
Marc Auberer
e0db588f3d [IR] Fix assertion error in User new/delete edge case (#129914)
Fixes #129900

If `operator delete` was called after an unsuccessful constructor call
after `operator new`, we ran into undefined behaviour.
This was discovered by our malfunction tests while preparing an upgrade
to LLVM 20, that explicitly check for such kind of bugs.

(cherry picked from commit 8d38906d08f0189a7a7f865b267f47cab0a3790f)
2025-04-11 13:05:07 -07:00
Miro Hrončok
d5bb7b866e Avoid a race condition in opt-viewer/optrecord (#131214)
See https://bugzilla.redhat.com/2336915
See https://reviews.llvm.org/D41784?id=
See
https://github.com/androm3da/optviewer-demo/issues/4#issuecomment-718787822

Fixes https://github.com/llvm/llvm-project/issues/62403.

The race condition happened when the demangler_proc was being set. The
locking mechanism itself happened too late.

This way, the lock always exists (to avoid a race when creating it) and
is always used when *creating* demangler_proc.

(cherry picked from commit e0f8898e1d432ab4fdcaf353bf87a1d3cf36491a)
2025-04-11 12:29:56 -07:00
Yingwei Zheng
d15fef4209 [IndVarSimplify] Handle the case where both operands are the same when widening IV (#135207)
`WidenIV::widenWithVariantUse` assumes that exactly one of the binop
operands is the IV to be widened. This miscompilation happens when it
tries to sign-extend the "NonIV" operand while the IV is zero-extended.
Closes https://github.com/llvm/llvm-project/issues/135182.

(cherry picked from commit d14acb78065bdd331019924feaaef52e5e744529)
2025-04-11 11:51:02 -07:00
Stefan Schmidt
91647ae0df [X86][SSE] Don't emit SSE2 load instructions in SSE1-only mode (#134547)
This fixes a regression I traced back to
8b43c1be23
/ https://github.com/llvm/llvm-project/pull/79000

The regression caused an SSE2 instruction, `movsd`, to be emitted as a
replacement for an SSE instruction, `movaps` despite the target
potentially not supporting this instruction, such as when building with
clang using `-march=pentium3`.

Fixes #134607

(cherry picked from commit 08e080ee98832c2aec6f379b04f486bea18730cc)
2025-04-11 11:37:58 -07:00
Owen Pan
d05543ed07 [clang-format] Keep the space between not and a unary operator (#135035)
Also keep the space between `not` and `::`.

Based on the
[documentation](https://releases.llvm.org/20.1.0/tools/clang/docs/ClangFormatStyleOptions.html#spaceafterlogicalnot),
it can be argued that SpaceAfterLogicalNot doesn't cover the alternative
operator `not`.

Closes #125465

(cherry picked from commit f34483838937b1a01ee11ee22bdd6e13c81e9fff)
2025-04-11 11:33:19 -07:00
Paul Kirth
81220e68a4 [fatlto] Add coroutine passes when using FatLTO with ThinLTO (#134434)
When coroutines are used w/ both -ffat-lto-objects and -flto=thin,
the coroutine passes are not added to the optimization pipelines.
Ensure they are added before ModuleOptimization to generate a
working ELF object.

Fixes #134409.

(cherry picked from commit 268c065eab06b81a0d7256ac62c0865b3781e236)
2025-04-11 11:30:09 -07:00
Owen Pan
edb54a7821 Release/20.x: [clang-format] Set C11 instead of C17 for LK_C
Backport d71ee7d23048ca64d14a7536927a006867cea39a
2025-04-11 11:17:54 -07:00
Tiezhu Yang
4181e829d1 [LLDB][LoongArch] Fix build errors about NT_LOONGARCH_HW_{BREAK,WATCH} (#126020)
On some OS distros such as LoongArch Fedora 38 mate-5 [1], there are
no macro definitions NT_LOONGARCH_HW_BREAK and NT_LOONGARCH_HW_WATCH
in the system header, then there exist some errors when building LLDB
on LoongArch.

(1) Description of Problem:

```
llvm-project/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp:529:16:
error: 'NT_LOONGARCH_HW_WATCH' was not declared in this scope; did you mean 'NT_LOONGARCH_LBT'?
  529 |   int regset = NT_LOONGARCH_HW_WATCH;
      |                ^~~~~~~~~~~~~~~~~~~~~
      |                NT_LOONGARCH_LBT
llvm-project/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp:543:12:
error: 'NT_LOONGARCH_HW_BREAK' was not declared in this scope; did you mean 'NT_LOONGARCH_CSR'?
  543 |   regset = NT_LOONGARCH_HW_BREAK;
      |            ^~~~~~~~~~~~~~~~~~~~~
      |            NT_LOONGARCH_CSR
```

(2) Steps to Reproduce:

```
git clone https://github.com/llvm/llvm-project.git
mkdir -p llvm-project/llvm/build && cd llvm-project/llvm/build
cmake .. -G "Ninja" \
         -DCMAKE_BUILD_TYPE=Release \
         -DLLVM_BUILD_RUNTIME=OFF \
         -DLLVM_ENABLE_PROJECTS="clang;lldb" \
         -DCMAKE_INSTALL_PREFIX=/usr/local/llvm \
         -DLLVM_TARGETS_TO_BUILD="LoongArch" \
         -DLLVM_HOST_TRIPLE=loongarch64-redhat-linux
ninja
```

(3) Additional Info:

Maybe there are no problems on the OS distros with newer glibc devel
library, so this issue is related with OS distros.

(4) Root Cause Analysis:

This is because the related Linux kernel commit [2] was merged in
2023-02-25 and the glibc devel library has some delay with kernel,
the glibc version of specified OS distros is not updated in time.

(5) Final Solution:

One way is to ask the maintainer of OS distros to update glibc devel
library, but it is better to not depend on the glibc version.

In order to avoid the build errors, just define NT_LOONGARCH_HW_BREAK
and NT_LOONGARCH_HW_WATCH in LLDB if there are no these definitions in
the system header.

By the way, in order to fit within 80 columns, use C++-style comments
for the new added NT_LOONGARCH_HW_BREAK and NT_LOONGARCH_HW_WATCH.

While at it, for consistency, just modify the current NT_LOONGARCH_LSX
and NT_LOONGARCH_LASX to C++-style comments too.

[1]
https://mirrors.wsyu.edu.cn/fedora/linux/development/rawhide/Everything/loongarch64/iso/livecd-fedora-mate-5.loongarch64.iso
[2]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1a69f7a161a7

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
(cherry picked from commit 50ae1c7bf40ba50aaf3132fa869eda8f06648155)
2025-04-11 11:15:57 -07:00
Martin Storsjö
7436329bfe Revert "[clang] [ARM] Explicitly enable NEON for Windows/Darwin targets (#122095)"
This reverts commit 8fa0f0efce5fb81eb422e6d7eec74c66dafef4a3.

This change broke assembling for e.g. "armv7s-apple-darwin" triples,
which should enable VFPv4 by default (and did that before this
change), but after this change, only NEON/VFPv3 were available.

This is being fixed properly in latest git main as part of
https://github.com/llvm/llvm-project/pull/130623 (possibly as a
split out change), but any proper fix here seems to have too
much potential surprises for an existing release branch.
2025-04-11 11:09:26 -07:00
Aaron Puchert
a0c8959cc8 [X86] When expanding LCMPXCHG16B_SAVE_RBX, substitute RBX in base (#134109)
The pseudo-instruction LCMPXCHG16B_SAVE_RBX is used when RBX serves as
frame base pointer. At a very late stage it is then translated into a
regular LCMPXCHG16B, preceded by copying the actual argument into RBX,
and followed by restoring the register to the base pointer.

However, in case the `cmpxchg` operates on a local variable, RBX might
also be used as a base for the memory operand in frame finalization, and
we've overwritten RBX with the input operand for `cmpxchg16b`. So we
have to rewrite the memory operand base to use the saved value of RBX.

Fixes #119959.

(cherry picked from commit 9e0ca5720bee96f4b19eeb69a119b5eda3ab5528)
2025-04-11 11:06:54 -07:00
Louis Dionne
a8b5fe017a [libc++] Add missing release note for LLVM 20 about zip_view (#134144)
We should have had a release note in LLVM 20 about implementing P2165R4
since that is technically an ABI and API break for zip_view. We don't
expect anyone to actually hit the ABI issue, but we've come across some
(fairly small) breakage due to the API change, so this should at least
be mentioned in the release notes.

(cherry picked from commit 2cd8edd1fff2a9d82902f70270b4209463a34cba)
2025-04-11 11:00:14 -07:00
Austin Schuh
41aefdbebe cuda clang: Fix argument order for __reduce_max_sync (#132881)
Fixes: https://github.com/llvm/llvm-project/issues/131415

---------

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
(cherry picked from commit 2d1517d257fcbd0c9bce14badc7646e94d81ea2b)
2025-04-11 10:58:46 -07:00
Carlos Galvez
19c2e1c12d [clang-tidy] Fix broken HeaderFilterRegex when read from config file (#133582)
PR https://github.com/llvm/llvm-project/pull/91400 broke the usage of
HeaderFilterRegex via config file, because it is now created at a
different point in the execution and leads to a different value.

The result of that is that using HeaderFilterRegex only in the config
file does NOT work, in other words clang-tidy stops triggering warnings
on header files, thereby losing a lot of coverage.

This patch reverts the logic so that the header filter is created upon
calling the getHeaderFilter() function.

Additionally, this patch adds 2 unit tests to prevent regressions in the
future:

- One of them, "simple", tests the most basic use case with a single
top-level .clang-tidy file.

- The second one, "inheritance", demonstrates that the subfolder only
gets warnings from headers within it, and not from parent headers.

Fixes #118009
Fixes #121969
Fixes #133453

Co-authored-by: Carlos Gálvez <carlos.galvez@zenseact.com>
(cherry picked from commit 6333fa5160fbde4bd2cf6afe8856695c13ab621f)
2025-04-11 09:44:59 -07:00
Mariusz Borsa
ac31db0463 [Sanitizers][Darwin][Test] XFAIL malloc_zone.cpp
The malloc_zone.cpp test currently fails on Darwin hosts, in SanitizerCommon tests with lsan enabled.

Need to XFAIL this test to buy time to investigate this failure. Also
we're trying to bring the number of test failing on Darwin bots to 0, to
get clearer signal of any new failures.

rdar://145873843

Co-authored-by: Mariusz Borsa <m_borsa@apple.com>
(cherry picked from commit 02837acaaf2cfdfcbf77e4a7f6629575edb6ffb4)
2025-04-11 09:41:50 -07:00
Utkarsh Saxena
53141e4e3c [clang] Do not infer lifetimebound for functions with void return type (#131997)
Fixes: https://github.com/llvm/llvm-project/issues/126231
Also found in : https://github.com/microsoft/STL/issues/5271

(cherry picked from commit 65ee2813f9f9a8cd11c5e9ea372da7d12867b52f)
2025-04-11 09:37:25 -07:00
dianqk
cf7bb13f0c [TailDuplicator] Determine if computed gotos using blockaddress (#132536)
Using `blockaddress` should be more reliable than determining if an
operand comes from a jump table index.

Alternative: Add the `MachineInstr::MIFlag::ComputedGoto` flag when
lowering `indirectbr`. But I don't think this approach is suitable to
backport.

(cherry picked from commit 66f158d91803875de63d8f2a437ce8ecb22c4141)
2025-04-11 09:36:02 -07:00
Tom Stellard
656289ffa0
Bump version to 20.1.3 (#134187) 2025-04-03 04:38:51 -07:00
Anutosh Bhat
58df0ef89d Define LLVM_ABI and CLANG_ABI for __EMSCRIPTEN__ builds (#131578)
While building llvm (clang, lld) against emscripten we see this
[error](https://github.com/emscripten-forge/recipes/actions/runs/13803029307/job/38608794602#step:9:1715)

```
 │ │ In file included from $SRC_DIR/llvm/lib/Frontend/OpenACC/ACC.cpp:9:
 │ │ $SRC_DIR/build/include/llvm/Frontend/OpenACC/ACC.h.inc:192:1: error: unknown type name 'LLVM_ABI'
 │ │   192 | LLVM_ABI Directive getOpenACCDirectiveKind(llvm::StringRef Str);
 │ │       | ^
 │ │ $SRC_DIR/build/include/llvm/Frontend/OpenACC/ACC.h.inc:192:19: error: expected ';' after top level declarator
 │ │   192 | LLVM_ABI Directive getOpenACCDirectiveKind(llvm::StringRef Str);
 │ │       |                   ^
 ```

Now this was happening because we weren't defining LLVM_ABI correctly when building against emscripten. If you see [llvm/Support/Compiler.h](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/Support/Compiler.h#L206-L210), the condition only checked for the platform __WASM__ . Now Emscripten targets WebAssembly but doesn't imply the platform by default so the check isn't complete to define LLVM_ABI.

The successful build after using this patch can be seen [here](https://github.com/emscripten-forge/recipes/actions/runs/13805214092/job/38614585621)

(cherry picked from commit e57cd100ca297cf81854e35cccbf703edddd4aad)
llvmorg-20.1.2
2025-04-01 16:44:12 -07:00
wanglei
e256eda153 [LoongArch][MC] Add relocation support for fld fst [x]vld [x]vst
This also fixes errors when using Clang with step-by-step compilation.
Because the optimization will pass relocation information to memory
access instructions. For example:
t.c:
```
float f = 0.1;
float foo() { return f;}
```
```
clang --target=loongarch64 -O2 -c t.c --save-temps
```

Reviewed By: tangaac, SixWeining

Pull Request: https://github.com/llvm/llvm-project/pull/133225

(cherry picked from commit d055e58334a91dcbaee22eb87bcdae85a1f33cd4)
2025-04-01 16:07:12 -07:00
wanglei
ba00d9f641 [LoongArch] Pre-commit test for #133225
Reviewed By: SixWeining

Pull Request: https://github.com/llvm/llvm-project/pull/133224

(cherry picked from commit 725a7b664b92cd2e884806de5a08900b43d43cce)
2025-04-01 16:07:12 -07:00
ZhaoQi
f07f96873a Backport/20.x: [LoongArch] Fix the type of tls-le symbols
(cherry picked from commit d6dc74e19f5cdb6995b13329480e330aff113f96)
2025-04-01 15:58:06 -07:00
Paul Schwabauer
e7406753ca [PATCH] [clang][modules] Fix serialization and de-serialization of PCH module file refs (#105994) (#132802)
The File ID is incorrectly calculated, resulting in an out-of-bounds
access. The test code is more complex because the File fetching only
happens in specific scenarios.

---------

Co-authored-by: ShaderKeeper <no-reply@shaderkeeper.com>
Co-authored-by: Chuanqi Xu <yedeng.yd@linux.alibaba.com>
(cherry picked from commit cca0f8113e2f9a1bd662c62dd3ff7e1fa197e6b5)
2025-04-01 13:12:15 -07:00
Tom Stellard
2f6c5807ca [workflows] Add missing -y option to apt-get for abi tests (#133337)
(cherry picked from commit 7793bae97d2bad36d870c6df438a6fc034f15112)
2025-03-31 22:36:20 +00:00
Lei Huang
bc65196c09 update test due to https://github.com/llvm/llvm-project/pull/126880 not being backported 2025-03-31 12:51:21 -07:00
David Green
d6d1dbf221 [ARM] Speedups for CombineBaseUpdate. (#129725)
This attempts to put limits onto CombineBaseUpdate for degenerate cases
like #127477. The biggest change is to add a limit to the number of base
updates to check in CombineBaseUpdate. 64 is hopefully plenty high
enough for most runtime unrolled loops to generate postinc where they
are beneficial.

It also moves the check for isValidBaseUpdate later so that it only
happens if we will generate a valid instruction. The 1024 limit to
hasPredecessorHelper comes from the X86 backend, which uses the same
limit.

I haven't added a test case as it would need to be very big and my
attempts at generating a smaller version did not show anything useful.

Fixes #127477.

(cherry picked from commit 86cf4ed7e9510a6828e95e8b36893eec116c9cf9)
2025-03-31 12:43:12 -07:00
Fangrui Song
5ba1949728 [MC,COFF] .safeseh: avoid changeSection (#132624)
The directive temporarily switches to the .sxdata section to emit data,
and then calls `insert`, which makes `CurFrag` out of sync of the
current section. Call push/switch/pop instead.

Related to #132464

(cherry picked from commit ece72e2731350d9840c6446db9276b04d593cc23)
2025-03-29 17:37:09 +00:00
R-Goc
943b43250b
release/20.x: [clang][docs] Move -Wnontrivial-memcall to added flags. (#132367)
-Wnon-trivial-memcall was incorrectly added to modified flags instead of
added flags. This commit moves it to the added compiler flags.
2025-03-28 23:27:50 -07:00
Martin Storsjö
44a6f6abbd [libcxx] [test] Fix restoring LLVM_DIR and Clang_DIR (#132838)
In 664f345cd53d1f624d94f9889a1c9fff803e3391, a fix was introduced,
attempting to restore LLVM_DIR and Clang_DIR after doing
find_package(Clang).

However, 6775285e7695f2d45cf455f5d31b2c9fa9362d3d added a return if the
clangTidy target wasn't found. If this is hit, we don't restore LLVM_DIR
and Clang_DIR, which causes strange effects if CMake is rerun a second
time.

Move the code for restoring LLVM_DIR and Clang_DIR to directly after the
find_package calls, to make sure they are restored, regardless of the
find_package outcome.

(cherry picked from commit 51bceb46f8eeb7c3d060387be315ca41855933c2)
2025-03-28 23:19:10 -07:00
Owen Pan
c1c4d7191d [clang-format] Allow Language: Cpp for C files (#133033)
Fix #132832

(cherry picked from commit 05fb8408de23c3ccb6125b6886742177755bd757)
2025-03-28 23:14:52 -07:00
Eli Friedman
2406e0d446 Revert "[MC] Explicitly mark MCSymbol for MO_ExternalSymbol" (#133291)
Reverts llvm/llvm-project#108880 .

The patch has no regression test, no description of why the fix is
necessary, and the code is modifying MC datastructures in a way that's
forbidden in the AsmPrinter.

Fixes #132055.

(cherry picked from commit cd6e959102888279dc7e75a41ebd75a08ac3f7a5)
2025-03-28 00:53:06 +00:00