[llvm-branch-commits] [clang] [llvm] release/19.x: [AArch64] Make apple-m4 armv8.7-a again (from armv9.2-a). (PR #106599)

2024-08-29 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha milestoned https://github.com/llvm/llvm-project/pull/106599 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] release/19.x: [AArch64] Make apple-m4 armv8.7-a again (from armv9.2-a). (PR #106599)

2024-08-29 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/106599 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] release/19.x: [AArch64] Make apple-m4 armv8.7-a again (from armv9.2-a). (#106312) (PR #106599)

2024-08-29 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha created https://github.com/llvm/llvm-project/pull/106599 This is a partial revert of c66e1d6f3429. Even though that allowed us to declare v9.2-a support without picking up SVE2 in both the backend and the driver, the frontend itself still enabled SVE via the a

[llvm-branch-commits] [clang] [llvm] Add some brief LLVM 19 release notes for Pointer Authentication ABI support (PR #104657)

2024-08-19 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha approved this pull request. https://github.com/llvm/llvm-project/pull/104657 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [clang] Implement pointer authentication for C++ virtual functions, v-tables, and VTTs (PR #94056)

2024-06-21 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha reopened https://github.com/llvm/llvm-project/pull/94056 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-20 Thread Ahmed Bougacha via llvm-branch-commits
@@ -354,6 +354,23 @@ Given that ``signedPointer`` matches the layout for signed pointers signed with the given key, extract the raw pointer from it. This operation does not trap and cannot fail, even if the pointer is not validly signed. +``ptrauth_sign_constant`` +^

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-20 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93904 >From 20bbad26fa9f068910baf50b5abb60a0f4557564 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:33:04 -0700 Subject: [PATCH 1/6] [clang] Define ptrauth_sign_constant builtin. This is

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2126,14 +2219,16 @@ static ExprResult PointerAuthSignGenericData(Sema &S, CallExpr *Call) { } static ExprResult PointerAuthSignOrAuth(Sema &S, CallExpr *Call, -PointerAuthOpKind OpKind) { +Poi

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -1856,6 +1856,12 @@ class ConstantLValueEmitter : public ConstStmtVisitor ahmedbougacha wrote: The more interesting question is the usage of Constant; I think we can safely assume the integer component is always going to be a ConstantInt (because it's goin

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -938,6 +938,11 @@ class CodeGenModule : public CodeGenTypeCache { // Return the function body address of the given function. llvm::Constant *GetFunctionStart(const ValueDecl *Decl); + llvm::Constant *getConstantSignedPointer(llvm::Constant *Pointer, +

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2030,8 +2030,25 @@ bool Sema::checkConstantPointerAuthKey(Expr *Arg, unsigned &Result) { return false; } +static std::pair +findConstantBaseAndOffset(Sema &S, Expr *E) { + // Must evaluate as a pointer. + Expr::EvalResult Result; + if (!E->EvaluateAsRValue(Result, S.

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2074,16 +2091,91 @@ static bool checkPointerAuthValue(Sema &S, Expr *&Arg, if (convertArgumentToType(S, Arg, ExpectedTy)) return true; - // Warn about null pointers for non-generic sign and auth operations. - if ((OpKind == PAO_Sign || OpKind == PAO_Auth) && -

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2074,16 +2091,91 @@ static bool checkPointerAuthValue(Sema &S, Expr *&Arg, if (convertArgumentToType(S, Arg, ExpectedTy)) return true; - // Warn about null pointers for non-generic sign and auth operations. - if ((OpKind == PAO_Sign || OpKind == PAO_Auth) && -

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-elf -fptrauth-intrinsics -emit-llvm %s -o - | FileCheck %s + +extern int external; + +// CHECK: @ptr1 = global ptr ptraut

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93904 >From 20bbad26fa9f068910baf50b5abb60a0f4557564 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:33:04 -0700 Subject: [PATCH 1/5] [clang] Define ptrauth_sign_constant builtin. This is

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-18 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93904 >From 20bbad26fa9f068910baf50b5abb60a0f4557564 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:33:04 -0700 Subject: [PATCH 1/4] [clang] Define ptrauth_sign_constant builtin. This is

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-14 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/94394 >From 1e9a3fde97d907c3cd6be33db91d1c18c7236ffb Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 4 Jun 2024 12:41:47 -0700 Subject: [PATCH 1/8] [Support] Reformat SipHash.cpp to match libSupport. Wh

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16-bit ptrauth stable hash. (PR #93902)

2024-06-14 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93902 >From bf413d68cff5ad963c43bb584590908bf03bc3ce Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 4 Jun 2024 12:36:33 -0700 Subject: [PATCH] [Support] Add SipHash-based 16-bit ptrauth stable hash. Th

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-13 Thread Ahmed Bougacha via llvm-branch-commits
@@ -354,6 +354,23 @@ Given that ``signedPointer`` matches the layout for signed pointers signed with the given key, extract the raw pointer from it. This operation does not trap and cannot fail, even if the pointer is not validly signed. +``ptrauth_sign_constant`` +^

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-13 Thread Ahmed Bougacha via llvm-branch-commits
@@ -354,6 +354,23 @@ Given that ``signedPointer`` matches the layout for signed pointers signed with the given key, extract the raw pointer from it. This operation does not trap and cannot fail, even if the pointer is not validly signed. +``ptrauth_sign_constant`` +^

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-13 Thread Ahmed Bougacha via llvm-branch-commits
@@ -58,6 +58,35 @@ void test_string_discriminator(const char *str) { } +void test_sign_constant(int *dp, int (*fp)(int)) { + __builtin_ptrauth_sign_constant(&dv, VALID_DATA_KEY); // expected-error {{too few arguments}} + __builtin_ptrauth_sign_constant(&dv, VALID_DATA_KEY,

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-13 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2061,6 +2071,58 @@ ConstantLValueEmitter::VisitCallExpr(const CallExpr *E) { } } +ConstantLValue +ConstantLValueEmitter::emitPointerAuthSignConstant(const CallExpr *E) { + llvm::Constant *UnsignedPointer = emitPointerAuthPointer(E->getArg(0)); + unsigned Key = emitPoin

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-13 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/94394 >From 1e9a3fde97d907c3cd6be33db91d1c18c7236ffb Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 4 Jun 2024 12:41:47 -0700 Subject: [PATCH 1/7] [Support] Reformat SipHash.cpp to match libSupport. Wh

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-13 Thread Ahmed Bougacha via llvm-branch-commits
ahmedbougacha wrote: [37c84b9](https://github.com/llvm/llvm-project/pull/94394/commits/37c84b9dce70f40db8a7c27b7de8232c4d10f78f) shows what I had in mind, let me know what you all think. I added: ``` void getSipHash_2_4_64(const uint8_t *In, uint64_t InLen, const uint8_t

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-13 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/94394 >From 1e9a3fde97d907c3cd6be33db91d1c18c7236ffb Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 4 Jun 2024 12:41:47 -0700 Subject: [PATCH 1/6] [Support] Reformat SipHash.cpp to match libSupport. Wh

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-11 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/94394 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16-bit ptrauth stable hash. (PR #93902)

2024-06-11 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93902 >From bf413d68cff5ad963c43bb584590908bf03bc3ce Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 4 Jun 2024 12:36:33 -0700 Subject: [PATCH] [Support] Add SipHash-based 16-bit ptrauth stable hash. Th

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-11 Thread Ahmed Bougacha via llvm-branch-commits
ahmedbougacha wrote: I think this version should work on BE hosts, but that's only by thinking through the code. Only the bots will tell us one way or another ;) https://github.com/llvm/llvm-project/pull/94394 ___ llvm-branch-commits mailing list llv

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-11 Thread Ahmed Bougacha via llvm-branch-commits
@@ -1,185 +1,149 @@ -/* - SipHash reference C implementation - - Copyright (c) 2012-2022 Jean-Philippe Aumasson - - Copyright (c) 2012-2014 Daniel J. Bernstein - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighbor

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-11 Thread Ahmed Bougacha via llvm-branch-commits
@@ -1,185 +1,149 @@ -/* - SipHash reference C implementation - - Copyright (c) 2012-2022 Jean-Philippe Aumasson - - Copyright (c) 2012-2014 Daniel J. Bernstein - - To the extent possible under law, the author(s) have dedicated all copyright - and related and neighbor

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-11 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/94394 >From 1e9a3fde97d907c3cd6be33db91d1c18c7236ffb Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 4 Jun 2024 12:41:47 -0700 Subject: [PATCH 1/5] [Support] Reformat SipHash.cpp to match libSupport. Wh

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Ahmed Bougacha via llvm-branch-commits
ahmedbougacha wrote: I'll also mention that I left the original variable naming but did re-format it, whitespace being more friendly to diffs, and this being nice and tidily contained. If you or others have strong opinions, I'm happy to recapitalize them. https://github.com/llvm/llvm-project

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Ahmed Bougacha via llvm-branch-commits
ahmedbougacha wrote: > Do I understand correctly that "remove big-endian support" results in this > code not running correctly on big-endian machines? I don't recall the LLVM > project claiming that it cannot run on big-endian machines. If I understand > this correctly, I would not remove the

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Ahmed Bougacha via llvm-branch-commits
@@ -58,21 +38,15 @@ v2 = ROTL(v2, 32); \ } while (0) -/* ahmedbougacha wrote: Fair, added it back with minor tweaks; I didn't describe the template parameters because, frankly, I'm not sure I wo

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-05 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/94394 >From 1e9a3fde97d907c3cd6be33db91d1c18c7236ffb Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 4 Jun 2024 12:41:47 -0700 Subject: [PATCH 1/4] [Support] Reformat SipHash.cpp to match libSupport. Wh

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16-bit ptrauth stable hash. (PR #93902)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/93902 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/93902 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/93902 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/93902 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
@@ -0,0 +1,174 @@ +//===--- StableHash.cpp - An ABI-stable string hash ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
ahmedbougacha wrote: I split out: - https://github.com/llvm/llvm-project/pull/94393 - https://github.com/llvm/llvm-project/pull/94394 and rebased this on top: we're now left with only the thin wrapper (the 16-bit one only here) and the simple unittests. https://github.com/llvm/llvm-project/pull

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
@@ -0,0 +1,47 @@ +//===--- SipHash.h - An ABI-stable string SipHash ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/93902 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha ready_for_review https://github.com/llvm/llvm-project/pull/94394 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/94394 >From 1e9a3fde97d907c3cd6be33db91d1c18c7236ffb Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 4 Jun 2024 12:41:47 -0700 Subject: [PATCH 1/3] [Support] Reformat SipHash.cpp to match libSupport. Wh

[llvm-branch-commits] [llvm] [Support] Integrate SipHash.cpp into libSupport. (PR #94394)

2024-06-04 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha created https://github.com/llvm/llvm-project/pull/94394 Start building it as part of the library, with some minor tweaks compared to the reference implementation: - clang-format to match libSupport - remove tracing support - add file header - templatize cROUNDS/d

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-03 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2126,14 +2219,16 @@ static ExprResult PointerAuthSignGenericData(Sema &S, CallExpr *Call) { } static ExprResult PointerAuthSignOrAuth(Sema &S, CallExpr *Call, -PointerAuthOpKind OpKind) { +Poi

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-03 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93904 >From 1a23a99f23714ba6a83b354e3b9afd056b263a02 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:33:04 -0700 Subject: [PATCH 1/3] [clang] Define ptrauth_sign_constant builtin. This is

[llvm-branch-commits] [clang] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

2024-06-03 Thread Ahmed Bougacha via llvm-branch-commits
@@ -2156,6 +2156,24 @@ static ExprResult PointerAuthAuthAndResign(Sema &S, CallExpr *Call) { return Call; } +static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *call) { ahmedbougacha wrote: Clang originally had different conventions; it us

[llvm-branch-commits] [clang] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

2024-06-03 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93903 >From 61be7a922397d66773a8f4a6e476ea321f52f00c Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:22:29 -0700 Subject: [PATCH 1/4] [clang] Define ptrauth_string_discriminator builtin.

[llvm-branch-commits] [clang] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

2024-06-03 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93903 >From 61be7a922397d66773a8f4a6e476ea321f52f00c Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:22:29 -0700 Subject: [PATCH 1/3] [clang] Define ptrauth_string_discriminator builtin.

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-06-03 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93904 >From 1a23a99f23714ba6a83b354e3b9afd056b263a02 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:33:04 -0700 Subject: [PATCH 1/2] [clang] Define ptrauth_sign_constant builtin. This is

[llvm-branch-commits] [clang] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

2024-06-03 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/93903 >From 61be7a922397d66773a8f4a6e476ea321f52f00c Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 30 May 2024 17:22:29 -0700 Subject: [PATCH 1/2] [clang] Define ptrauth_string_discriminator builtin.

[llvm-branch-commits] [clang] [clang] Implement pointer authentication for C++ virtual functions, v-tables, and VTTs. (PR #93907)

2024-05-31 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha closed https://github.com/llvm/llvm-project/pull/93907 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-05-31 Thread Ahmed Bougacha via llvm-branch-commits
ahmedbougacha wrote: > Why do we want a separate builtin, as opposed to just constant-folding calls > to __builtin_ptrauth_sign? That's a good question. Mechanically, I assumed constant-evaluating `__builtin_ptrauth_sign_unauthenticated` would be a challenge, but looking around it doesn't se

[llvm-branch-commits] [clang] [clang] Update use of checkUInt32Argument to match on main (PR #93984)

2024-05-31 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha closed https://github.com/llvm/llvm-project/pull/93984 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang] Implement function pointer signing. (PR #93906)

2024-05-30 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha created https://github.com/llvm/llvm-project/pull/93906 None >From 0e85001f6d53e63beca77a76eaba1875ec84000d Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Fri, 24 May 2024 20:23:36 -0700 Subject: [PATCH] [clang] Implement function pointer signing. Co-Auth

[llvm-branch-commits] [clang] [clang] Define ptrauth_sign_constant builtin. (PR #93904)

2024-05-30 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha created https://github.com/llvm/llvm-project/pull/93904 This is a constant-expression equivalent to __builtin_ptrauth_sign, allowing its usage in global initializers, but requiring constant pointers and discriminators. >From 1a23a99f23714ba6a83b354e3b9afd056b2

[llvm-branch-commits] [clang] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)

2024-05-30 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha created https://github.com/llvm/llvm-project/pull/93903 This exposes the ABI-stable hash function that allows computing a 16-bit discriminator from a constant string. This allows manually matching the implicit string discriminators computed in the ABI (e.g., f

[llvm-branch-commits] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

2024-05-30 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha created https://github.com/llvm/llvm-project/pull/93902 Based on the SipHash reference implementation: https://github.com/veorq/SipHash which has very graciously been licensed under our llvm license (Apache-2.0 WITH LLVM-exception) by Jean-Philippe Aumasson.

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-28 Thread Ahmed Bougacha via llvm-branch-commits
@@ -1769,6 +1775,41 @@ void AArch64AsmPrinter::emitPtrauthAuthResign(const MachineInstr *MI) { OutStreamer->emitLabel(EndSym); } +void AArch64AsmPrinter::emitPtrauthBranch(const MachineInstr *MI) { + unsigned InstsEmitted = 0; + ahmedbougacha wrote: It'

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-28 Thread Ahmed Bougacha via llvm-branch-commits
@@ -817,10 +817,44 @@ bool AArch64ExpandPseudo::expandCALL_RVMARKER( MachineInstr &MI = *MBBI; MachineOperand &RVTarget = MI.getOperand(0); assert(RVTarget.isGlobal() && "invalid operand for attached call"); - MachineInstr *OriginalCall = - createCall(MBB, MBBI, TII

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-28 Thread Ahmed Bougacha via llvm-branch-commits
ahmedbougacha wrote: > One more overall style comment which might probably require an additional PR: > sometimes identifiers use `PtrAuth`, sometimes `Ptrauth`. Is this > intentional? If not, I suggest to use the same case style - it would keep > things consistent and allow for case-sensitive

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-23 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-23 Thread Ahmed Bougacha via llvm-branch-commits
ahmedbougacha wrote: Thanks for taking a look; updated https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-23 Thread Ahmed Bougacha via llvm-branch-commits
@@ -8640,6 +8642,15 @@ void SelectionDAGBuilder::LowerCallTo(const CallBase &CB, SDValue Callee, CB.countOperandBundlesOfType(LLVMContext::OB_preallocated) != 0) .setCFIType(CFIType) .setConvergenceControlToken(ConvControlToken); + + // Set the pointer a

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-23 Thread Ahmed Bougacha via llvm-branch-commits
@@ -0,0 +1,183 @@ +; RUN: llc -mtriple arm64e-apple-darwin -o - -global-isel -global-isel-abort=1 -verify-machineinstrs %s | FileCheck %s --check-prefixes=CHECK ahmedbougacha wrote: It's not standard practice to test other platforms, but sure, I added ELF check

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-23 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-23 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-23 Thread Ahmed Bougacha via llvm-branch-commits
@@ -1694,6 +1718,35 @@ let Predicates = [HasPAuth] in { def BLRABZ : AuthOneOperand<0b001, 1, "blrabz">; } + // BLRA pseudo, generalized version of BLRAA/BLRAB/Z. + // This directly manipulates x16/x17, which are the only registers the OS + // guarantees are safe to

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-23 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/85736 >From 75825f36ec58a2cf5d1a3f2d4de6a49ad06c02d8 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Mon, 27 Sep 2021 08:00:00 -0700 Subject: [PATCH 1/3] [AArch64] Adopt x8+ allocation order for GPR64noip. 7

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-14 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/85736 >From 75825f36ec58a2cf5d1a3f2d4de6a49ad06c02d8 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Mon, 27 Sep 2021 08:00:00 -0700 Subject: [PATCH 1/2] [AArch64] Adopt x8+ allocation order for GPR64noip. 7

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-10 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha edited https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang-tools-extra] [llvm] [mlir] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-10 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha updated https://github.com/llvm/llvm-project/pull/85736 error: too big or took too long to generate ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-05-10 Thread Ahmed Bougacha via llvm-branch-commits
ahmedbougacha wrote: ping https://github.com/llvm/llvm-project/pull/85736 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (PR #85736)

2024-03-18 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha created https://github.com/llvm/llvm-project/pull/85736 This adds codegen support for the "ptrauth" operand bundles, which can be used to augment indirect calls with the equivalent of an `@llvm.ptrauth.auth` intrinsic call on the call target (possibly preceded by

[llvm-branch-commits] [libcxx] [libc] [lldb] [flang] [mlir] [libcxxabi] [compiler-rt] [lld] [clang] [llvm] [openmp] [clang-tools-extra] [builtins][arm64] Build __init_cpu_features_resolver on Apple pl

2023-12-08 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha approved this pull request. LG, ty https://github.com/llvm/llvm-project/pull/73685 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-comm

[llvm-branch-commits] [llvm] [clang] [clang-tools-extra] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-12-05 Thread Ahmed Bougacha via llvm-branch-commits
https://github.com/ahmedbougacha approved this pull request. https://github.com/llvm/llvm-project/pull/73687 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [compiler-rt] [clang-tools-extra] [llvm] [clang] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-12-05 Thread Ahmed Bougacha via llvm-branch-commits
@@ -1259,6 +1270,72 @@ struct { // As features grows new fields could be added } __aarch64_cpu_features __attribute__((visibility("hidden"), nocommon)); +#if defined(__APPLE__) +#include +#if TARGET_OS_OSX || TARGET_OS_IPHONE +#include +#include + +static bool isKnownAndS

[llvm-branch-commits] [clang] f77c948 - [Triple][MachO] Define "arm64e", an AArch64 subarch for Pointer Auth.

2020-12-03 Thread Ahmed Bougacha via llvm-branch-commits
Author: Ahmed Bougacha Date: 2020-12-03T07:53:59-08:00 New Revision: f77c948d56b09b839262e258af5c6ad701e5b168 URL: https://github.com/llvm/llvm-project/commit/f77c948d56b09b839262e258af5c6ad701e5b168 DIFF: https://github.com/llvm/llvm-project/commit/f77c948d56b09b839262e258af5c6ad701e5b168.diff