| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In terms of bug catching capability, `_FORTIFY_SOURCE` does not perform
as well as some dynamic instrumentation tools. When a sanitizer is used,
generally `_FORTIFY_SOURCE` should be disabled since sanitizer runtime
does not implement most `*_chk` functions. Using `_FORTIFY_SOURCE`
will regress error checking (asan/hwasan/tsan) or cause false positives
(msan).
`*printf_chk` are the most pronounced `_chk` interceptors for
uninstrumented DSOes (https://reviews.llvm.org/D40951).
glibc 2.40 introduced `pass_object_info` style fortified source for some
functions ([1]). `fprintf` will be mangled as
`_ZL7fprintfP8_IO_FILEU17pass_object_size1PKcz`, which has no associated
interceptor, leading to printf-fortify-5.c failure.
Just disable the test. Fix #100877
[1]: https://sourceware.org/pipermail/libc-alpha/2024-February/154531.html
Pull Request: https://github.com/llvm/llvm-project/pull/101566
Gentoo-Component: compiler-rt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since glibc 2.40 some functions like openat make use of overloads when
built with `-D_FORTIFY_SOURCE=2`, see:
https://github.com/bminor/glibc/blob/master/io/bits/fcntl2.h
This means that doing something like `(uintptr_t) openat` or `(void *)
openat` is now ambiguous, breaking the compiler-rt build on new glibc
versions.
Fix this by explicitly casting the symbol to the expected function type
before casting it to an intptr. The expected type is obtained as
`decltype(REAL(func))` so we don't have to repeat the signature from
INTERCEPTOR in the INTERCEPT_FUNTION macro.
Fixes https://github.com/llvm/llvm-project/issues/100754.
(cherry picked from commit 155b7a12820ec45095988b6aa6e057afaf2bc892)
Gentoo-Component: compiler-rt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Glibc v2.40 changes the definition of __rseq_size to the usable area of
the struct rather than the actual size of the struct to accommodate
users trying to figure out what features can be used. This change breaks
llvm-exegesis trying to disable rseq as the size registered in the
kernel is no longer equal to __rseq_size. This patch adds a check to see
if __rseq_size is less than 32 bytes and uses 32 as a value if it is
given alignment requirements.
Fixes #100791.
(cherry picked from commit 1e8df9e85a1ff213e5868bd822877695f27504ad)
Gentoo-Component: llvm
|
| |
|
|
|
|
|
|
| |
This patch adds support in the bump-version script for bumping the
version of the mlgo-utils package. This should hopefully streamline the
processor for that with the rest of the project and prevent having to
manually update this package individually.
|
|
|
|
| |
* Add support for --git flag to bump version for a git suffix
* Update location of the new file where the version is stored
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The functions internal to subroutine should have the scope set to the
parent function. This allows a user to evaluate local variables of
parent function when control is stopped in the child.
Fixes #96314
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: https://phabricator.intern.facebook.com/D60250527
(cherry picked from commit 626022bfd18f335ef62a461992a05dfed4e6d715)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#100552)
For pauthtest ABI, there is a bunch of ptrauth-* options, including
ptrauth-returns. Use "ptrauth-returns" function attribute to indicate
need for LR signing with B key for non-leaf function to avoid using
"sign-return-address" and "sign-return-address-key" which were
originally designed for pac-ret.
Co-authored-by: Ahmed Bougacha <ahmed@bougacha.org>
Co-authored-by: Anatoly Trosinenko <atrosinenko@accesssoftek.com>
(cherry picked from commit 56fd2472d887392855ad85c53df5782a2c3f8ddb)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a result is potentially based on a not yet proven assumption,
BasicAA will remember it inside AssumptionBasedResults and remove
the cache entry if an assumption higher up is later disproved.
However, we currently miss the case where another cache entry ends
up depending on such an AssumptionBased result.
Fix this by introducing an additional AssumptionBased state for
cache entries. If such a result is used, we'll still increment
AAQI.NumAssumptionUses, which means that the using entry will
also become AssumptionBased and be cleared if the assumption is
disproved.
At the end of the root query, convert remaining AssumptionBased
results into definitive results.
Fixes https://github.com/llvm/llvm-project/issues/98978.
(cherry picked from commit 91073380ac5a0dceebdd09f360a1dc194d7ee93f)
|
|
|
|
|
|
|
|
|
|
| |
If the inline asm version of `ptrauth_strip` is used instead of the
builtin, the inline asm implementation currently returns an unsigned
long, causing an incompatible pointer conversion issue. The spec for
`ptrauth_sign` is that the result has the same type as the original
value, so we add a cast to the result of the inline asm.
(cherry picked from commit 25f9415713f9f57760a5322876906dc11385ef8e)
|
|
|
|
|
|
| |
Fixes #91928
(cherry picked from commit 98e733eaf2af1a5c1d9392e279d21182ffdf560d)
|
|
|
|
|
|
|
|
|
|
|
| |
1. Include `ptrauth.h` if `ptrauth_intrinsics` language feature is specified (per ptrauth spec, this is what enables `ptrauh.h` usage and functions like `ptrauth_strip`)
2. For PAC-RET fallback implement two changes:
1. Switch to macro, so we can ignore key argument
2. Ensure the unsigned value is erased from LR, so the possibility of gadget reuse is reduced.
Fixes #100467
(cherry picked from commit cc4f98979b079b517edd8a71f56a8975f436e63d)
|
|
|
|
|
|
|
|
|
| |
The `<locale>` header uses `strtoll_l` and friends which are defined in
`<xlocale.h>` on these platforms. While this works via transitive
includes when modules are disabled, this doesn't work anymore if the
platforms are modularized properly.
(cherry picked from commit a55df237375e98cfc2520d5eb1a23b302ef02ba0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#100572)
`__is_layout_compatible` was added in Clang 19 (#81506), and at that
time it wasn't entirely clear whether it should be a revertible type
trait or not. We decided to follow the example of other type traits.
Since then #95969 happened, and now we know that we don't want new
revertible type traits.
This patch removes `__is_layout_compatible` from revertible type traits
list, and leaves a comment what revertible type traits are, and that new
type traits should not be added there.
The intention is to also cherry-pick this to 19 branch.
(cherry picked from commit 3295d377f37a60597321f502d164b5d6b1948e28)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#100143)
The documentation for the __arm_get_current_vg support routine specifies
that the following registers are call-preserved:
- X1-X15, X19-X29 and SP
- Z0-Z31
- P0-P15
This patch rewrites the implementation of this routine in compiler-rt,
as the current version does not guarantee that these registers will be
preserved.
(cherry picked from commit 6da6772bf0a33131aa8540c9d4f60d5db75c32b5)
|
|
|
|
|
|
|
|
| |
Config files provide a facility to invoke the compiler with a predefined
set of options. The patch only enables these options in the flang
driver. Functionality was always there.
(cherry picked from commit 8a77961280536b680c404a49002a00b988ca45fc)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The GPU build needs to be able to inline stuff in LTO. Builtin
transformations cause problems on the functions that the optimizer does
heavy libcall recognition on. Previously we moved to using
`-fno-builtin-*` to allow us to only disable the problematic ones.
However, this still didn't allow inlining because each function had the
attribute that told the inliner not to inlining a nobuiltin function
into a non-nobuiltin function
This patch fixes that by only applying these attributes to the
entrypoints that define them. That is enough to prevent recursive calls
within the definitoins themselves.
(cherry picked from commit 8e43acbfedf53ded43ec693ddaaf518cb7416c1c)
|
|
|
|
|
|
| |
(#100480)
(cherry picked from commit 3f6eb13abf643afec17a73448ede380606531226)
|
|
|
|
|
|
|
| |
Commits c4b66bf and 7647174 add support for AArch64 trampolines. Updated
documentation to reflect the changes.
(cherry picked from commit c6e69b041a7e6d18463f6cf684b10fd46a62c496)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for llvm.init.trampoline and llvm.adjust.trampoline
intrinsics for AArch64.
Fixes https://github.com/llvm/llvm-project/issues/65573
Fixes https://github.com/llvm/llvm-project/issues/76927
Fixes https://github.com/llvm/llvm-project/issues/83555
Updates https://github.com/llvm/llvm-project/pull/66157
(cherry picked from commit c4b66bf4d065d3bbc2e2fac8512a6df8e013c704)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#99579)
We have a mechanism to allow folding expressions that aren't ICEs as an
extension; use it more consistently.
This ends up causing bad effects on diagnostics in a few cases, but
that's not specific to shifts; it's a general issue with the way those
uses handle overflow diagnostics.
(cherry picked from commit 20eff684203287828d6722fc860b9d3621429542)
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements the requirements for the container iterator requirements
for array, deque, vector, and `vector<bool>`.
Implements:
- LWG3352 strong_equality isn't a thing
Implements parts of:
- P1614R2 The Mothership has Landed
Fixes: https://github.com/llvm/llvm-project/issues/62486
|
|
|
|
|
|
|
|
| |
LIBCXX_ASSERTION_HANDLER_FILE (#100157)
Fixes #80696
(cherry picked from commit 046a17717d9c5b5385ecd914621b48bdd91524d0)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Initialize some fields of OverloadCandidate in its constructor. The goal
here is try to fix read of uninitialized variable (which I was not able
to reproduce)
https://github.com/llvm/llvm-project/pull/93430#issuecomment-2187544278
We should certainly try to improve the construction of
`OverloadCandidate` further as it can be quite britle.
(cherry picked from commit 7d787df5b932b73aae6532d1e981152f103f9244)
|
|
|
|
|
|
|
|
|
| |
The PR #93430 introduced an assertion that did not make any sense. and
caused a regression. The fix is to simply remove the assertion.
No changelog. the intent is to backport this fix to clang 19.
(cherry picked from commit dd82a84e0eeafb017c7220c4a9fbd0a8a407f8a9)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
than 2gb (#99263)
Rebase of #84114. I've only included the core changes to frame layout
calculation & CFI generation which sidesteps the regressions found after
merging #84114. Since these changes are a necessary precursor to the
overall fix and are themselves slightly beneficial as CFI is now
generated correctly, I think it is reasonable to merge this first step.
---
For very large stack frames, the offset from the stack pointer to a
local can be more than 2^31 which overflows various `int` offsets in the
frame lowering code.
This patch updates the frame lowering code to calculate the offsets as
64-bit values and fixes CFI to use the corrected sizes.
After this patch, additional work is needed to fix offset truncations in
each target's codegen.
(cherry picked from commit ca076f7a63f6a80e2e38315ec462be354b196b8d)
|
|
|
|
|
|
|
|
|
|
|
|
| |
stddef.h always includes __stddef_null.h. This is fine in modules
because it's not possible to re-include the pcm, and it's necessary to
export the _Builtin_stddef.null submodule. However, without modules it
causes NULL to always get redefined which disrupts some C++ code. Rework
the inclusion of __stddef_null.h so that with not building with modules
it's only included if __need_NULL is set by the includer, or it's the
first time stddef.h is being included.
(cherry picked from commit 92a9d4831d5e40c286247c30fcd794563adbef6e)
|
|
|
|
| |
This is a preparation for the upcoming LLVM 19 release.
|
|
|
|
|
|
|
|
|
|
| |
Similar to #99836 for AArch64.
Non-unique names save .strtab space and match GNU assembler.
Pull Request: https://github.com/llvm/llvm-project/pull/99906
(cherry picked from commit 298a9223a57c50cb0d24b82687ad1bc2f7a022e6)
|
|
|
|
|
|
|
|
|
| |
According to the spec the CI type instructions can take any of the 32
RVI registers.
Fixes #100112
(cherry picked from commit 1ebfc81a91194c000ac70b4ea53891cc956aa6eb)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Functions returning C_PTR were lowered to function returning intptr (i64
on 64bit arch). This caused conflicts when these functions were defined
as returning !fir.ref<none>/llvm.ptr in other compiler generated
contexts (e.g., malloc).
Lower them to return !fir.ref<none>.
This should deal with https://github.com/llvm/llvm-project/issues/97325
and https://github.com/llvm/llvm-project/issues/98644.
(cherry picked from commit 1ead51a86c6c746a1b9948ca1ee142df223ffebd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The builtin computes the discriminator for a type, which can be used to
sign/authenticate function pointers and member function pointers.
If the type passed to the builtin is a C++ member function pointer type,
the result is the discriminator used to signed member function pointers
of that type. If the type is a function, function pointer, or function
reference type, the result is the discriminator used to sign functions
of that type. It is ill-formed to use this builtin with any other type.
A call to this function is an integer constant expression.
Co-Authored-By: John McCall rjmccall@apple.com
(cherry picked from commit 666e3326fedfb6a033494c36c36aa95c4124d642)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#100316)
See the following case:
```
define i16 @pr100298() {
entry:
br label %for.inc
for.inc:
%indvar = phi i32 [ -15, %entry ], [ %mask, %for.inc ]
%add = add nsw i32 %indvar, 9
%mask = and i32 %add, 65535
%cmp1 = icmp ugt i32 %mask, 5
br i1 %cmp1, label %for.inc, label %for.end
for.end:
%conv = trunc i32 %add to i16
%cmp2 = icmp ugt i32 %mask, 3
%shl = shl nuw i16 %conv, 14
%res = select i1 %cmp2, i16 %conv, i16 %shl
ret i16 %res
}
```
When computing knownbits of `%shl` with `%cmp2=false`, we cannot use
this condition in the analysis of `%mask (%for.inc -> %for.inc)`.
Fixes https://github.com/llvm/llvm-project/issues/100298.
(cherry picked from commit 59eae919c938f890e9b9b4be8a3fa3cb1b11ed89)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Somewhat confusingly a `SCEVMulExpr` is a `SCEVNAryExpr`, so can have
> 2 operands. Previously, the vscale immediate matching did not check
the number of operands of the `SCEVMulExpr`, so would ignore any
operands after the first two.
This led to incorrect codegen (and results) for ArmSME in IREE
(https://github.com/iree-org/iree), which sometimes addresses things
that are a `vscale * vscale` multiple away. The test added with this
change shows an example reduced from IREE. The second write should
be offset from the first `16 * vscale * vscale` (* 4 bytes), however,
previously LSR dropped the second vscale and instead offset the write by
`#4, mul vl`, which is an offset of `16 * vscale` (* 4 bytes).
(cherry picked from commit 7fad04e94b7b594389111ae7eca0883ef18dc90b)
|
|
|
|
|
|
| |
Precommit test for #100080.
(cherry picked from commit c1b70fa5bfea973d4141e27cf9668e9325609e19)
|
|
|
|
| |
(cherry picked from commit 4bb3a1e16f3a854d05bc0b8c5b6f8f78effb1d93)
|
|
|
|
|
|
|
|
|
|
|
| |
(#100358)
This patch propagates the debug location from Clang to the
OpenMPIRBuilder.
Fixes https://github.com/llvm/llvm-project/issues/97458
(cherry picked from commit 5b15d9c441810121c23f9f421bbb007fd4c448e8)
|
|
|
|
|
|
|
| |
This PR adds support for -mcpu=pwr11/power11 and -mtune=pwr11/power11 in
clang and llvm.
(cherry picked from commit 1df4d866cca51eeab8f012a97cc50957b45971fe)
|
|
|
|
|
|
|
|
| |
This ensures that shrink_to_fit does not increase the allocated size.
Partly addresses #95161
(cherry picked from commit d0ca9f23e8f25b0509c3ff34ed215508b39ea6e7)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`vector<bool>`'s shrink_to_fit implementation is using the
"swap-to-free-container-resources-trick" which only shrinks when the
input vector is empty. Since the request to shrink_to_fit is
non-binding, this is a valid implementation. It is not a high-quality
implementation. Since `vector<bool>` is not a very popular container the
implementation has not been changed and only a test to validate the
non-growing property has been added.
This was discovered while investigating #95161.
(cherry picked from commit c2e438675754b83c31d7d5ba40cb13fe77e795de)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 3-dimentionsional `std::hypot(x,y,z)` was sub-optimally implemented.
This lead to possible over-/underflows in (intermediate) results which
can be circumvented by this proposed change.
The idea is to to scale the arguments (see linked issue for full
discussion).
Tests have been added for problematic over- and underflows.
Closes #92782
(cherry picked from commit 9628777479a970db5d0c2d0b456dac6633864760)
|
|
|
|
|
|
| |
This PR adds support for __builtin_cpu_is ("power11")
(cherry picked from commit 63b382bbde5994e8f2cec75883320e3ad9fd618f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The NVPTX backend optimizes the ABI for functions that are internal,
however, this is not legal for indirect call prototypes. Previously, we
would modify the ABI on an aggregate byval type passed to an indirect
call prototype, which would make PTXAS error. This patch just passes the
function as a nullptr to force strict ABI compliance without
modification in the helper function.
Fixes https://github.com/llvm/llvm-project/issues/100055
(cherry picked from commit e0649a5dfc6b859d652318f578bc3d49674787a4)
|
|
|
|
|
|
|
|
| |
This patch fixes the code generation for IR:
sext i32 (trunc i64 (rotr i64 %x, i64 %y) to i32) to i64
(cherry picked from commit e386aacb747b4512dedf481ad83e054d3dd641e6)
|
|
|
|
|
|
|
|
|
|
| |
(#100153)
vptr cannot be authenticated without knowing the class type if it was
signed with type discrimination.
Co-authored-by: Oliver Hunt <oliver@apple.com>
(cherry picked from commit 0a6a3c152faf56e07dd4f9e89e534d2b97eeab56)
|
|
|
|
|
|
|
|
| |
tests (#99604)
I accidentally did not include tests for the setting up runtime calls when compiling with -fptrauth-function-pointer-type-discrimination
(cherry picked from commit 8be1325cb1903797ba3dce67087e395f9e080576)
|
|
|
|
|
|
|
|
| |
This reverts commit f2ccf80136a01ca69f766becafb329db6c54c0c8.
The flag propagation code is incorrect.
(cherry picked from commit b48819dbcdb48fc737dc22304ac343e4fdbae9ff)
|
|
|
|
|
|
|
|
|
| |
As discussed in https://github.com/llvm/llvm-project/pull/92555 flip
the default for the option added in
https://github.com/llvm/llvm-project/pull/99536 to true.
This restores the original behavior for the release branch to give the
VPlan-based cost model more time to mature on main.
|
| |
|
| |
|