506367 Commits

Author SHA1 Message Date
John Brawn
1cfd675445 [AArch64] Add GCS release notes 2024-08-19 09:10:20 +02:00
yandalur
2ab8d93061
[Hexagon] Do not optimize address of another function's block (#101209)
When the constant extender optimization pass encounters an instruction
that uses an extended address pointing to another function's block,
avoid adding the instruction to the extender list for the current
machine function.

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

(cherry picked from commit 68df06a0b2998765cb0a41353fcf0919bbf57ddb)
2024-08-19 09:06:57 +02:00
Yeting Kuo
c45fc691a2 [RISCV] Use experimental.vp.splat to splat specific vector length elements. (#101329)
Previously, llvm IR is hard to create a scalable vector splat with a
specific vector length, so we use riscv.vmv.v.x and riscv.vmv.v.f to do
this work. But the two rvv intrinsics needs strict type constraint which
can not support fixed vector types and illegal vector types. Using
vp.splat could preserve old functionality and also generate more
optimized code for vector types and illegal vectors.
This patch also fixes crash for getEVT not serving ptr types.

(cherry picked from commit 87af9ee870ad7ca93abced0b09459c3760dec891)
2024-08-19 09:04:45 +02:00
Joseph Huber
1a5c4e5c4f
[Clang] Correctly forward --cuda-path to the nvlink wrapper (#100170)
Summary:
This was not forwarded properly as it would try to pass it to `nvlink`.

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

(cherry picked from commit 7e1fcf5dd657d465c3fc846f56c6f9d3a4560b43)
2024-08-19 09:02:52 +02:00
Louis Dionne
4d4a4100f6 [libc++] Fix ambiguous constructors for std::complex and std::optional (#103409)
Fixes #101960

(cherry picked from commit 4d08bb11eea5907fa9cdfe4c7bc9d5c91e79c6a7)
2024-08-15 09:40:37 +02:00
Jon Roelofs
67b06b4297 [clang][AArch64] Point the nofp ABI check diagnostics at the callee (#103392)
... whereever we have the Decl for it, and even when we don't keep the
SourceLocation of it aimed at the call site.

Fixes: #102983
(cherry picked from commit 019ef522756886caa258daf68d877f84abc1b878)
2024-08-15 09:36:31 +02:00
Owen Pan
ca3f3f6327 [clang-format] Fix annotation of braces enclosing stringification (#102998)
Fixes #102937.

(cherry picked from commit ee2359968fa307ef45254c816e14df33374168cd)
2024-08-15 09:36:13 +02:00
Zaara Syeda
9c3d4f3446 [PPC][AIX] Save/restore r31 when using base pointer (#100182)
When the base pointer r30 is used to hold the stack pointer, r30 is
spilled in the prologue. On AIX registers are saved from highest to
lowest, so r31 also needs to be saved.

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

(cherry picked from commit d07f106e512c08455b76cc1889ee48318e73c810)
2024-08-15 09:35:44 +02:00
Jacek Caban
028cef89ec [CodeGen][ARM64EC] Define hybrid_patchable EXP thunk symbol as a function. (#102898)
This is needed for MSVC link.exe to generate redirection metadata for hybrid patchable thunks.

(cherry picked from commit d550ada5ab6cd6e49de71ac4c9aa27ced4c11de0)
2024-08-15 09:35:14 +02:00
Brian Cain
a3b18fcd24 [libc++] Use a different smart ptr type alias (#102089)
The `_SP` type is used by some C libraries and this alias could conflict
with it.

(cherry picked from commit 7951673d408ee64744d0b924a49db78e8243d876)
2024-08-15 09:34:45 +02:00
Krystian Stasiowski
dec94b04c0 [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (#100392)
A class member named by an expression in a member function that may instantiate to a static _or_ non-static member is represented by a `UnresolvedLookupExpr` in order to defer the implicit transformation to a class member access expression until instantiation. Since `ASTContext::getDecltypeType` only creates a `DecltypeType` that has a `DependentDecltypeType` as its canonical type when the operand is instantiation dependent, and since we do not transform types unless they are instantiation dependent, we need to mark the `UnresolvedLookupExpr` as instantiation dependent in order to correctly build a `DecltypeType` using the expression as its operand with a `DependentDecltypeType` canonical type. Fixes #99873.

(cherry picked from commit 55ea36002bd364518c20b3ce282640c920697bf7)
2024-08-15 09:34:14 +02:00
Qiongsi Wu
28f2d04b3c [AIX] Revert #pragma mc_func check (#102919)
https://github.com/llvm/llvm-project/pull/99888 added a specific
diagnostic for `#pragma mc_func` on AIX. There are some disagreements
on:

1. If the check should be on by default. Leaving the check off by
default is dangerous, since it is difficult to be aware of such a check.
Turning it on by default at the moment causes build failures on AIX. See
https://github.com/llvm/llvm-project/pull/101336 for more details.
2. If the check can be made more general. See
https://github.com/llvm/llvm-project/pull/101336#issuecomment-2269283906.

This PR reverts this check from `main` so we can flush out these
disagreements.

(cherry picked from commit 123b6fcc70af17d81c903b839ffb55afc9a9728f)
2024-08-13 14:04:18 +02:00
Chuanqi Xu
3f193bcc5a [C++20] [Modules] Don't diagnose duplicated implicit decl in multiple named modules (#102423)
Close https://github.com/llvm/llvm-project/issues/102360
Close https://github.com/llvm/llvm-project/issues/102349

http://eel.is/c++draft/basic.def.odr#15.3 makes it clear that the
duplicated deinition are not allowed to be attached to named modules.

But we need to filter the implicit declarations as user can do nothing
about it and the diagnostic message is annoying.

(cherry picked from commit e72d956b99e920b0fe2a7946eb3a51b9e889c73c)
2024-08-13 09:08:58 +02:00
PaulXiCao
2c29bd3d4c [libc++][math] Fix undue overflowing of std::hypot(x,y,z) (#100820)
This is in relation to mr #93350. It was merged to main, but reverted
because of failing sanitizer builds on PowerPC.

The fix includes replacing the hard-coded threshold constants (e.g.
`__overflow_threshold`) for different floating-point sizes by a general
computation using `std::ldexp`. Thus, it should now work for all architectures.
This has the drawback of not being `constexpr` anymore as `std::ldexp`
is not implemented as `constexpr` (even though the standard mandates it
for C++23).

Closes #92782

(cherry picked from commit 72825fde03aab3ce9eba2635b872144d1fb6b6b2)
2024-08-13 09:07:01 +02:00
Mitch Phillips
5230e327a1 Revert "[libc++][math] Fix undue overflowing of std::hypot(x,y,z) (#93350)"
This reverts commit 9628777479a970db5d0c2d0b456dac6633864760.

More details in https://github.com/llvm/llvm-project/pull/93350, but
this broke the PowerPC sanitizer bots.

(cherry picked from commit 1031335f2ee1879737576fde3a3425ce0046e773)
2024-08-13 09:07:01 +02:00
Ahmed Bougacha
955fe3f1ef [clang] Implement -fptrauth-auth-traps. (#102417)
This provides -fptrauth-auth-traps, which at the frontend level only
controls the addition of the "ptrauth-auth-traps" function attribute.

The attribute in turn controls various aspects of backend codegen, by
providing the guarantee that every "auth" operation generated will trap
on failure.

This can either be delegated to the hardware (if AArch64 FPAC is known
to be available), in which case this attribute doesn't change codegen.
Otherwise, if FPAC isn't available, this asks the backend to emit
additional instructions to check and trap on auth failure.

(cherry picked from commit d179acd0484bac30c5ebbbed4d29a4734d92ac93)
2024-08-13 09:02:58 +02:00
Pavel Labath
c261de724b [lldb] Fix crash when adding members to an "incomplete" type (#102116)
This fixes a regression caused by delayed type definition searching
(#96755 and friends): If we end up adding a member (e.g. a typedef) to a
type that we've already attempted to complete (and failed), the
resulting AST would end up inconsistent (we would start to "forcibly"
complete it, but never finish it), and importing it into an expression
AST would crash.

This patch fixes this by detecting the situation and finishing the
definition as well.

(cherry picked from commit 57cd1000c9c93fd0e64352cfbc9fbbe5b8a8fcef)
2024-08-13 09:02:18 +02:00
Owen Pan
efdd0e9fda [clang-format] Fix a serious bug in git clang-format -f (#102629)
With the --force (or -f) option, git-clang-format wipes out input files
excluded by a .clang-format-ignore file if they have unstaged changes.

This patch adds a hidden clang-format option --list-ignored that lists
such excluded files for git-clang-format to filter out.

Fixes #102459.

(cherry picked from commit 986bc3d0719af653fecb77e8cfc59f39bec148fd)
2024-08-13 09:00:45 +02:00
Rainer Orth
4fd6b324ea [llvm-exegesis][unittests] Also disable SubprocessMemoryTest on SPARC (#102755)
Three `llvm-exegesis` tests
```
  LLVM-Unit :: tools/llvm-exegesis/./LLVMExegesisTests/SubprocessMemoryTest/DefinitionFillsCompletely
  LLVM-Unit :: tools/llvm-exegesis/./LLVMExegesisTests/SubprocessMemoryTest/MultipleDefinitions
  LLVM-Unit :: tools/llvm-exegesis/./LLVMExegesisTests/SubprocessMemoryTest/OneDefinition
```
`FAIL` on Linux/sparc64 like
```
llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp:68: Failure
Expected equality of these values:
  SharedMemoryMapping[I]
    Which is: '\0'
  ExpectedValue[I]
    Which is: '\xAA' (170)
```
It seems like this test only works on little-endian hosts: three
sub-tests are already disabled on powerpc and s390x (both big-endian),
and the fourth is additionally guarded against big-endian hosts (making
the other guards unnecessary).

However, since it's not been analyzed if this is really an endianess
issue, this patch disables the whole test on powerpc and s390x as before
adding sparc to the mix.

Tested on `sparc64-unknown-linux-gnu` and `x86_64-pc-linux-gnu`.

(cherry picked from commit a417083e27b155dc92b7f7271c0093aee0d7231c)
2024-08-12 10:40:07 +02:00
Xing Xue
f6381989f4 [NFC][libc++][test][AIX] UnXFAIL LIT test transform.pass.cpp (#102338)
Remove `XFAIL: LIBCXX-AIX-FIXME` from lit test `transform.pass.cpp` now
that AIX system call `wcsxfrm`/`wcsxfrm_l` is fixed in AIX 7.2.5.8 and
7.3.2.2 and buildbot machines have been upgraded.

Backported from commit cb5912a71061c6558bd4293596dcacc1ce0ca2f6
2024-08-12 10:39:47 +02:00
Daniel Kiss
866686180a [Arm][AArch64][Clang] Respect function's branch protection attributes. (#101978)
Default attributes assigned to all functions according to the command
line parameters. Some functions might have their own attributes and we
need to set or remove attributes accordingly.
Tests are updated to test this scenarios too.

(cherry picked from commit 9e9fa00dcb9522db3f78d921eda6a18b9ee568bb)
2024-08-10 12:31:37 +02:00
Tom Stellard
eea8e4ddd8 workflows: Fix permissions for release-sources job (#100750)
For reusable workflows, the called workflow cannot upgrade it's
permissions, and since the default permission is none, we need to
explicitly declare 'contents: read' when calling the release-sources
workflow.

Fixes the error:
The workflow is requesting 'contents: read', but is only allowed
'contents: none'.

(cherry picked from commit 82c2259aeb87f5cb418decfb6a1961287055e5d2)
2024-08-10 12:29:39 +02:00
Sharadh Rajaraman
b2de37237c [clang][driver][clang-cl] Support --precompile and -fmodule-* options in Clang-CL (#98761)
This PR is the first step in improving the situation for `clang-cl`
detailed in [this LLVM Discourse
thread](https://discourse.llvm.org/t/clang-cl-exe-support-for-c-modules/72257/28).
There has been some work done in #89772. I believe this is somewhat
orthogonal.

This is a work-in-progress; the functionality has only been tested with
the [basic 'Hello World'
example](https://clang.llvm.org/docs/StandardCPlusPlusModules.html#quick-start),
and proper test cases need to be written. I'd like some thoughts on
this, thanks!

Partially resolves #64118.

(cherry picked from commit bd576fe34285c4dcd04837bf07a89a9c00e3cd5e)
2024-08-10 12:28:36 +02:00
Tom Stellard
5972d4ddf9 workflows/release-binaries-all: Pass secrets on to release-binaries workflow (#101866)
A called workflow does not have access to secrets by default, so we need
to explicitly pass any secret that we want to use.

(cherry picked from commit 1fb1a5d8e2c5a0cbaeb39ead68352e5e55752a6d)
2024-08-10 12:28:01 +02:00
Sirraide
a02ee2f6ff [Clang] Define __cpp_pack_indexing (#101956)
Following the discussion on #101448 this defines
`__cpp_pack_indexing`. Since pack indexing is currently
supported in all language modes, the feature test macro
is also defined in all language modes.

(cherry picked from commit c65afad9c58474a784633314e945c874ed06584a)
2024-08-10 12:25:55 +02:00
Alex Langford
e908a0099c [lldb] Move definition of SBSaveCoreOptions dtor out of header (#102539)
This class is technically not usable in its current state. When you use
it in a simple C++ project, your compiler will complain about an
incomplete definition of SaveCoreOptions. Normally this isn't a problem,
other classes in the SBAPI do this. The difference is that
SBSaveCoreOptions has a default destructor in the header, so the
compiler will attempt to generate the code for the destructor with an
incomplete definition of the impl type.

All methods for every class, including constructors and destructors,
must have a separate implementation not in a header.

(cherry picked from commit 101cf540e698529d3dd899d00111bcb654a3c12b)
2024-08-10 12:18:52 +02:00
Ahmed Bougacha
ccd8d0497a [clang] Wire -fptrauth-returns to "ptrauth-returns" fn attribute. (#102416)
We already ended up with -fptrauth-returns, the feature macro, the lang
opt, and the actual backend lowering.

The only part left is threading it all through PointerAuthOptions, to
drive the addition of the "ptrauth-returns" attribute to generated
functions.
While there, do minor cleanup on ptrauth-function-attributes.c.

This also adds ptrauth_key_return_address to ptrauth.h.

(cherry picked from commit 2eb6e30fe83ccce3cf01e596e73fa6385facd44b)
2024-08-10 12:18:14 +02:00
David Green
f3261a5a64 [AArch64] Add invalid 1 x vscale costs for reductions and reduction-operations. (#102105)
The code-generator is currently not able to handle scalable vectors of
<vscale x 1 x eltty>. The usual "fix" for this until it is supported is
to mark the costs of loads/stores with an invalid cost, preventing the
vectorizer from vectorizing at those factors. But on rare occasions
loops do not contain load/stores, only reductions.

So whilst this is still unsupported return an invalid cost to avoid
selecting vscale x 1 VFs. The cost of a reduction is not currently used
by the vectorizer so this adds the cost to the add/mul/and/or/xor or
min/max that should feed the reduction. It includes reduction costs
too, for completeness. This change will be removed when code-generation
for these types is sufficiently reliable.

Fixes #99760

(cherry picked from commit 0b745a10843fc85e579bbf459f78b3f43e7ab309)
2024-08-10 12:17:41 +02:00
Fangrui Song
d893708ded Revert "demangle function names in trace files (#87626)"
This reverts commit 0fa20c55b58deb94090985a5c5ffda4d5ceb3cd1.

Storing raw symbol names is generally preferred in profile files.
Demangling might lose information. Language frontends might use
demangling schemes not supported by LLVMDemangle
(https://github.com/llvm/llvm-project/issues/45901#issuecomment-2008686663).
In addition, calling `demangle` for each function has a significant
performance overhead (#102222).

I believe that even if we decide to provide a producer-side demangling,
it would not be on by default.

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

(cherry picked from commit 72b73e23b6c36537db730ebea00f92798108a6e5)
2024-08-10 12:15:54 +02:00
Fangrui Song
39746ee004 [ELF] scanRelocations: support .crel.eh_frame
Follow-up to #98115. For EhInputSection, RelocationScanner::scan calls
sortRels, which doesn't support the CREL iterator. We should set
supportsCrel to false to ensure that the initial_location fields in
.eh_frame FDEs are relocated.

(cherry picked from commit a821fee312d15941174827a70cb534c2f2fe1177)
2024-08-10 12:15:26 +02:00
Fangrui Song
7aae895c24 [ELF] .llvm.call-graph-profile: support CREL
https://reviews.llvm.org/D105217 added RELA support. This patch adds
CREL support.

(cherry picked from commit 0766a59be3256e83a454a089f01215d6c7f94a48)
2024-08-10 12:15:26 +02:00
David Tenty
32e20009d1 [NFC][llvm][support] rename INFINITY in regcomp (#101758)
since C23 this macro is defined by float.h, which clang implements in
it's float.h since #96659 landed.

However, regcomp.c in LLVMSupport happened to define it's own macro with
that name, leading to problems when bootstrapping. This change renames
the offending macro.

(cherry picked from commit 899f648866affd011baae627752ba15baabc2ef9)
2024-08-10 12:13:21 +02:00
Antonio Frighetto
2da001d831 [TBAA] Do not rewrite TBAA if exists, always null out !tbaa.struct
Retrieve `!tbaa` metadata via `!tbaa.struct` in `adjustForAccess`
unless it already exists, as struct-path aware `MDNodes` emitted
via `new-struct-path-tbaa` may be leveraged. As `!tbaa.struct`
carries memcpy padding semantics among struct fields and `!tbaa`
is already meant to aid to alias semantics, it should be possible
to zero out `!tbaa.struct` once the memcpy has been simplified.
`SROA/tbaa-struct.ll` test has gone out of scope, as `!tbaa` has
already replaced `!tbaa.struct` in SROA.

Fixes: https://github.com/llvm/llvm-project/issues/95661.
2024-08-10 12:12:32 +02:00
Muhammad Omair Javaid
a2c18c0b2b Revert "[LLVM] Silence compiler-rt warning in runtimes build (#99525)"
This patch broke LLVM Flang build on Windows. PR #100202
This reverts commit f6f88f4b99638821af803d1911ab6a7dac04880b.

(cherry picked from commit 73d862e478738675f5d919c6a196429acd7b5f50)
2024-08-10 12:11:21 +02:00
Mirko Brkušanin
7eb25ddccc [AMDGPU] Fix folding clamp into pseudo scalar instructions (#100568)
Clamp is canonically a v_max* instruction with a VGPR dst. Folding clamp
into a pseudo scalar instruction can cause issues due to a change in
regbank. We fix this with a copy.

(cherry picked from commit 817cd726454f01e990cd84e5e1d339b120b5ebaa)
2024-08-10 12:10:49 +02:00
Mariya Podchishchaeva
0df301ba8b [clang] Fix crash when #embed used in a compound literal (#102304)
Fixes https://github.com/llvm/llvm-project/issues/102248

(cherry picked from commit 3606d69d0b57dc1d23a4362e376e7ad27f650c27)
2024-08-10 12:10:15 +02:00
Owen Pan
b084eff6ca [clang-format] Fix a bug in annotating CastRParen (#102261)
Fixes #102102.

(cherry picked from commit 8c7a038f9029c675f2a52ff5e85f7b6005ec7b3e)
2024-08-10 12:09:46 +02:00
Chen Zheng
9ec7815e2b [AIX]export function descriptor symbols related to template functions. (#101920)
This fixes regressions caused by
https://github.com/llvm/llvm-project/pull/97526

After that patch, all undefined references to DS symbol are removed.
This makes DS symbols(for template functions) have no reference in some
cases. So extract_symbols.py does not export these DS symbols for these
cases.

On AIX, exporting the function descriptor depends on references to the
function descriptor itself and the function entry symbol.

Without this fix, on AIX, we get:
```
rtld: 0712-001 Symbol _ZN4llvm15SmallVectorBaseIjE13mallocForGrowEPvmmRm was referenced
      from module llvm-project/build/unittests/Passes/Plugins/TestPlugin.so(), but a runtime definition
            of the symbol was not found.
```

(cherry picked from commit 396343f17b1182ff8ed698beac3f9b93b1d9dabd)
2024-08-10 12:09:20 +02:00
Kazu Hirata
561be3b95e [Driver] Fix a warning
This patch fixes:

  clang/lib/Driver/ToolChains/Darwin.cpp:2937:3: error: default label
  in switch which covers all enumeration values
  [-Werror,-Wcovered-switch-default]

(cherry picked from commit 0f1361baf650641a59aaa1710d7a0b7b02f2e56d)
2024-08-10 12:08:49 +02:00
Ian Anderson
dca18c3334 [clang][modules] Enable built-in modules for the upcoming Apple releases (#102239)
The upcoming Apple SDK releases will support the clang built-in headers
being in the clang built-in modules: stop passing
-fbuiltin-headers-in-system-modules for those SDK versions.

(cherry picked from commit 961639962251de7428c3fe93fa17cfa6ab3c561a)
2024-08-10 12:08:49 +02:00
Lucas Duarte Prates
c25c15edb1 [AArch64] Don't replace dst of SWP instructions with (X|W)ZR (#102139)
This change updates the AArch64DeadRegisterDefinition pass to ensure it
does not replace the destination register of a SWP instruction with the
zero register when its value is unused. This is necessary to ensure that
the ordering of such instructions in relation to DMB.LD barries adheres
to the definitions of the AArch64 Memory Model.

The memory model states the following (ARMARM version DDI 0487K.a
§B2.3.7):
```
Barrier-ordered-before

An effect E1 is Barrier-ordered-before an effect E2 if one of the following applies:
[...]
* All of the following apply:
- E1 is a Memory Read effect.
- E1 is generated by an instruction whose destination register is not WZR or XZR.
- E1 appears in program order before E3.
- E3 is either a DMB LD effect or a DSB LD effect.
- E3 appears in program order before E2.
```

Prior to this change, by replacing the destination register of such SWP
instruction with WZR/XZR, the ordering relation described above was
incorrectly removed from the generated code.

The new behaviour is ensured in this patch by adding the relevant
`SWP[L](B|H|W|X)` instructions to list in the `atomicReadDroppedOnZero`
predicate, which already covered the `LD<Op>` instructions that are
subject to the same effect.

Fixes #68428.

(cherry picked from commit beb37e2e22b549b361be7269a52a3715649e956a)
2024-08-10 12:07:27 +02:00
sinan
2e0782c4db [BOLT] Skip PLT search for zero-value weak reference symbols (#69136)
Take a common weak reference pattern for example
```
    __attribute__((weak)) void undef_weak_fun();

      if (&undef_weak_fun)
        undef_weak_fun();
```

In this case, an undefined weak symbol `undef_weak_fun` has an address
of zero, and Bolt incorrectly changes the relocation for the
corresponding symbol to symbol@PLT, leading to incorrect runtime
behavior.

(cherry picked from commit 6c8933e1a095028d648a5a26aecee0f569304dd0)
2024-08-10 12:06:43 +02:00
Oliver Stannard
eb4619cf5f [lld][ARM] Fix assertion when mixing ARM and Thumb objects (#101985)
Previously, we selected the Thumb2 PLT sequences if any input object is
marked as not supporting the ARM ISA, which then causes assertion
failures when calls from ARM code in other objects are seen. I think the
intention here was to only use Thumb PLTs when the target does not have
the ARM ISA available, signalled by no objects being marked as having it
available. To do that we need to track which ISAs we have seen as we
parse the build attributes, and defer the decision about PLTs until all
input objects have been parsed.

This bug was triggered by real code in picolibc, which have some
versions of string.h functions built with Thumb2-only build attributes,
so that they are compatible with v7-A, v7-R and v7-M.

Fixes #99008.

(cherry picked from commit a1c6467bd90905d52cf8f6162b60907f8e98a704)
2024-08-10 12:06:13 +02:00
sinan
a0f4170ab8 [BOLT] Support map other function entry address (#101466)
Allow BOLT to map the old address to a new binary address if the old
address is the entry of the function.

(cherry picked from commit 734c0488b6e69300adaf568f880f40b113ae02ca)
2024-08-10 12:05:50 +02:00
Dimitry Andric
1eae7f714a [CalcSpillWeights] Avoid x87 excess precision influencing weight result
Fixes #99396

The result of `VirtRegAuxInfo::weightCalcHelper` can be influenced by
x87 excess precision, which can result in slightly different register
choices when the compiler is hosted on x86_64 or i386. This leads to
different object file output when cross-compiling to i386, or native.

Similar to 7af3432e22b0, we need to add a `volatile` qualifier to the
local `Weight` variable to force it onto the stack, and avoid the excess
precision. Define `stack_float_t` in `MathExtras.h` for this purpose,
and use it.

(cherry picked from commit c80c09f3e380a0a2b00b36bebf72f43271a564c1)
2024-08-10 12:05:19 +02:00
Florian Hahn
87656b3115 [LAA] Refine stride checks for SCEVs during dependence analysis. (#99577)
Update getDependenceDistanceStrideAndSize to reason about different
combinations of strides directly and explicitly.

Update getPtrStride to return 0 for invariant pointers.

Then proceed by checking the strides.

If either source or sink are not strided by a constant (i.e. not a
non-wrapping AddRec) or invariant, the accesses may overlap
with earlier or later iterations and we cannot generate runtime
checks to disambiguate them.

Otherwise they are either loop invariant or strided. In that case, we
can generate a runtime check to disambiguate them.

If both are strided by constants, we proceed as previously.

This is an alternative to
https://github.com/llvm/llvm-project/pull/99239 and also replaces
additional checks if the underlying object is loop-invariant.

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

PR: https://github.com/llvm/llvm-project/pull/99577
2024-08-10 12:04:49 +02:00
Sam James
1545897f08 [LLDB] Add <cstdint> to AddressableBits (#102110)
(cherry picked from commit bb59f04e7e75dcbe39f1bf952304a157f0035314)
2024-08-10 12:01:08 +02:00
Rainer Orth
aa3bbf147f [BinaryFormat] Disable MachOTest.UnalignedLC on SPARC (#100086)
As discussed in Issue #86793, the `MachOTest.UnalignedLC` test dies with
`SIGBUS` on SPARC, a strict-alignment target. It simply cannot work
there. Besides, the test invokes undefined behaviour on big-endian
targets, so this patch disables it on all of those.

Tested on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`.

(cherry picked from commit 3a226dbe27ac7c7d935bc0968e84e31798a01207)
2024-08-10 12:00:43 +02:00
Tom Stellard
b5cb9081fa workflows/release-binaries: Give attestation artifacts a unique name (#102041)
We need a different attestation for each supported architecture, so
there artifacts all need to have a different name.

The upload step is run on a Linux runner, so no matter which
architecture's binary is being uploaded the runner.os and runner.arch
variables would always be 'Linux' and 'X64' and so we can't use them for
naming the artifact.

(cherry picked from commit 3c8dadda3aa20b89fb5ad29ae31380d9594c3430)
2024-08-10 12:00:10 +02:00
Tom Stellard
e1c32a819d workflows/release-tasks: Add missing permissions for release binaries (#102023)
Now that the release binaries create artifact attestations, we need to
ensure that we call the workflow with the correct permissions.

(cherry picked from commit dc349a3f47882cdac7112c763d2964b59e77356a)
2024-08-10 11:58:52 +02:00