[llvm-branch-commits] ELF: Introduce R_AARCH64_PATCHINST relocation type. (PR #133534)

2025-07-11 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc edited https://github.com/llvm/llvm-project/pull/133534 ___ 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] Introduce AArch64::PAC pseudo instruction (PR #146488)

2025-07-09 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: I think this should be opt-in behavior. It might be useful if the goal is to protect the stack, but in cases where the goal is to only protect the heap due to the high cost of protecting the stack, this change would only add overhead. If you are deploying a comprehensive stack prote

[llvm-branch-commits] Extract SipHash implementation into a header. (PR #134197)

2025-07-09 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: Adding Support maintainers https://github.com/llvm/llvm-project/pull/134197 ___ 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: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-07-09 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/132857 >From 4eac4350b8a540aba5c5ed658353b4f6abaf329b Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 5 Jun 2025 22:15:52 -0700 Subject: [PATCH 1/2] Address comments Created using spr 1.3.6-beta.1 --- llvm/l

[llvm-branch-commits] [compiler-rt] compiler-rt: Introduce runtime functions for emulated PAC. (PR #133530)

2025-07-08 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133530 >From b37a44fff650b06eda249060277d0c007226cad2 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 3 Apr 2025 21:51:44 -0700 Subject: [PATCH] Fix CMake build Created using spr 1.3.6-beta.1 --- compiler-rt

[llvm-branch-commits] Extract SipHash implementation into a header. (PR #134197)

2025-07-08 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/134197 ___ 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: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-07-08 Thread Peter Collingbourne via llvm-branch-commits
@@ -1951,9 +1952,23 @@ let Predicates = [HasPAuth] in { let Uses = [X16]; } + def AUTxMxN : Pseudo<(outs GPR64:$AuthVal, GPR64common:$Scratch), + (ins GPR64:$Val, i32imm:$Key, +i64imm:$Disc, GPR64:$AddrDisc), +

[llvm-branch-commits] [llvm] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-07-08 Thread Peter Collingbourne via llvm-branch-commits
@@ -2104,23 +2115,19 @@ void AArch64AsmPrinter::emitPtrauthAuthResign(const MachineInstr *MI) { break; } - auto AUTKey = (AArch64PACKey::ID)MI->getOperand(0).getImm(); - uint64_t AUTDisc = MI->getOperand(1).getImm(); - unsigned AUTAddrDisc = MI->getOperand(2).getReg(

[llvm-branch-commits] [llvm] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-07-08 Thread Peter Collingbourne via llvm-branch-commits
@@ -1,279 +1,327 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple arm64e-apple-darwin -global-isel=0 -verify-machineinstrs \ -; RUN: -aarch64-ptrauth-auth-checks=none | FileCheck %s -DL="L" --check-p

[llvm-branch-commits] [llvm] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-07-08 Thread Peter Collingbourne via llvm-branch-commits
@@ -33,36 +33,45 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" define i64 @test_auth_blend(i64 %arg, i64 %arg1) { ; UNCHECKED-LABEL: test_auth_blend: -; UNCHECKED: %bb.0: -; UNCHECKED-NEXT:mov x16, x0 -; UNCHECKED-NEXT:mov x17, x1 -; UNCHECKED-NEXT:

[llvm-branch-commits] [llvm] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-07-08 Thread Peter Collingbourne via llvm-branch-commits
@@ -2146,23 +2153,19 @@ void AArch64AsmPrinter::emitPtrauthAuthResign(const MachineInstr *MI) { if (!IsAUTPAC) return; - auto PACKey = (AArch64PACKey::ID)MI->getOperand(3).getImm(); - uint64_t PACDisc = MI->getOperand(4).getImm(); - unsigned PACAddrDisc = MI->getOper

[llvm-branch-commits] [llvm] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-07-08 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/132857 >From 4eac4350b8a540aba5c5ed658353b4f6abaf329b Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 5 Jun 2025 22:15:52 -0700 Subject: [PATCH] Address comments Created using spr 1.3.6-beta.1 --- llvm/lib/T

[llvm-branch-commits] [llvm] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-07-08 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/132857 >From 4eac4350b8a540aba5c5ed658353b4f6abaf329b Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 5 Jun 2025 22:15:52 -0700 Subject: [PATCH] Address comments Created using spr 1.3.6-beta.1 --- llvm/lib/T

[llvm-branch-commits] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-06-14 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: Sorry, I was having a problem with spr with this change so I pushed the updated change directly to the branch. I think there are some merge conflicts by now in the include list but they should be easy to resolve. -- Peter On Sat, Jun 14, 2025, 17:58 Fangrui Song ***@***.***> wrote:

[llvm-branch-commits] [llvm] llvm-lto2: Add print-guid subcommand. (PR #143992)

2025-06-13 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: > At least a comment in the code would be good. A variety of people end up > using these tools for tests, and I could see someone getting confused as to > why the guid doesn't match what's e.g. in the ThinLTO index. For that > understanding you'd have to read more than just what thi

[llvm-branch-commits] [llvm] llvm-lto2: Add print-guid subcommand. (PR #143992)

2025-06-13 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/143992 >From f11d7d544cc61dce582de538608bfd512147f90a Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 12 Jun 2025 16:06:14 -0700 Subject: [PATCH 1/2] Upload correct patch Created using spr 1.3.6-beta.1 --- l

[llvm-branch-commits] [llvm] llvm-lto2: Add print-guid subcommand. (PR #143992)

2025-06-13 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/143992 >From f11d7d544cc61dce582de538608bfd512147f90a Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 12 Jun 2025 16:06:14 -0700 Subject: [PATCH] Upload correct patch Created using spr 1.3.6-beta.1 --- llvm/

[llvm-branch-commits] [llvm] llvm-lto2: Add print-guid subcommand. (PR #143992)

2025-06-13 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/143992 >From f11d7d544cc61dce582de538608bfd512147f90a Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 12 Jun 2025 16:06:14 -0700 Subject: [PATCH] Upload correct patch Created using spr 1.3.6-beta.1 --- llvm/

[llvm-branch-commits] [llvm] llvm-lto2: Add print-guid subcommand. (PR #143992)

2025-06-13 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: > This needs a caveat somewhere (either in printed usage message or in a > comment) that this won't work for local linkage symbols (I suppose the user > could give the "file:" prefix but that won't work if > -funique-internal-linkage-names was specified etc). I'm not sure that is w

[llvm-branch-commits] [llvm] llvm-lto2: Add print-guid subcommand. (PR #143992)

2025-06-12 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/143992 >From f11d7d544cc61dce582de538608bfd512147f90a Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 12 Jun 2025 16:06:14 -0700 Subject: [PATCH] Upload correct patch Created using spr 1.3.6-beta.1 --- llvm/

[llvm-branch-commits] llvm-lto2: Add print-guid subcommand. (PR #143992)

2025-06-12 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/143992 This is useful for debugging ThinLTO issues. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-

[llvm-branch-commits] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-06-09 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: @MaskRay ping. https://github.com/llvm/llvm-project/pull/138366 ___ 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] LowerTypeTests: Shrink check size by 1 instruction on x86. (PR #142887)

2025-06-06 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/142887 ___ 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] LowerTypeTests: Shrink check size by 1 instruction on x86. (PR #142887)

2025-06-06 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/142887 ___ 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] LowerTypeTests: Shrink check size by 1 instruction on x86. (PR #142887)

2025-06-06 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: > Could we have a test that demonstrates the new better instruction sequence > (by precommiting to show the diff here)? Done, see #143189 https://github.com/llvm/llvm-project/pull/142887 ___ llvm-branch-commits mailing list llvm-branch-com

[llvm-branch-commits] LowerTypeTests: Shrink check size by 1 instruction on x86. (PR #142887)

2025-06-06 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/142887 ___ 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] LowerTypeTests: Shrink check size by 1 instruction on x86. (PR #142887)

2025-06-06 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/142887 ___ 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] LowerTypeTests: Avoid zext of ptrtoint ConstantExpr. (PR #142886)

2025-06-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/142886 ___ 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] LowerTypeTests: Avoid zext of ptrtoint ConstantExpr. (PR #142886)

2025-06-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/142886 ___ 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] Add SimplifyTypeTests pass. (PR #141327)

2025-06-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/141327 >From b36c74c344ed47b99e9bfdc28f9081c3c704d8c7 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 27 May 2025 23:08:59 -0700 Subject: [PATCH] Format Created using spr 1.3.6-beta.1 --- llvm/lib/Transforms

[llvm-branch-commits] [llvm] Add SimplifyTypeTests pass. (PR #141327)

2025-06-05 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/141327 >From b36c74c344ed47b99e9bfdc28f9081c3c704d8c7 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 27 May 2025 23:08:59 -0700 Subject: [PATCH] Format Created using spr 1.3.6-beta.1 --- llvm/lib/Transforms

[llvm-branch-commits] [llvm] Add SimplifyTypeTests pass. (PR #141327)

2025-06-04 Thread Peter Collingbourne via llvm-branch-commits
@@ -2478,3 +2479,76 @@ PreservedAnalyses LowerTypeTestsPass::run(Module &M, return PreservedAnalyses::all(); return PreservedAnalyses::none(); } + +PreservedAnalyses SimplifyTypeTestsPass::run(Module &M, + ModuleAnalysisManager

[llvm-branch-commits] [llvm] Add SimplifyTypeTests pass. (PR #141327)

2025-06-04 Thread Peter Collingbourne via llvm-branch-commits
@@ -2478,3 +2479,76 @@ PreservedAnalyses LowerTypeTestsPass::run(Module &M, return PreservedAnalyses::all(); return PreservedAnalyses::none(); } + +PreservedAnalyses SimplifyTypeTestsPass::run(Module &M, + ModuleAnalysisManager

[llvm-branch-commits] [llvm] Add SimplifyTypeTests pass. (PR #141327)

2025-06-04 Thread Peter Collingbourne via llvm-branch-commits
@@ -2478,3 +2479,76 @@ PreservedAnalyses LowerTypeTestsPass::run(Module &M, return PreservedAnalyses::all(); return PreservedAnalyses::none(); } + +PreservedAnalyses SimplifyTypeTestsPass::run(Module &M, + ModuleAnalysisManager

[llvm-branch-commits] [llvm] Add SimplifyTypeTests pass. (PR #141327)

2025-06-04 Thread Peter Collingbourne via llvm-branch-commits
@@ -2478,3 +2479,76 @@ PreservedAnalyses LowerTypeTestsPass::run(Module &M, return PreservedAnalyses::all(); return PreservedAnalyses::none(); } + +PreservedAnalyses SimplifyTypeTestsPass::run(Module &M, + ModuleAnalysisManager

[llvm-branch-commits] [llvm] Add SimplifyTypeTests pass. (PR #141327)

2025-06-04 Thread Peter Collingbourne via llvm-branch-commits
@@ -0,0 +1,40 @@ +; RUN: opt -S %s -passes=simplify-type-tests | FileCheck %s pcc wrote: Done https://github.com/llvm/llvm-project/pull/141327 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org htt

[llvm-branch-commits] [llvm] Add SimplifyTypeTests pass. (PR #141327)

2025-06-04 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/141327 >From b36c74c344ed47b99e9bfdc28f9081c3c704d8c7 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 27 May 2025 23:08:59 -0700 Subject: [PATCH] Format Created using spr 1.3.6-beta.1 --- llvm/lib/Transforms

[llvm-branch-commits] [llvm] Add SimplifyTypeTests pass. (PR #141327)

2025-06-04 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/141327 >From b36c74c344ed47b99e9bfdc28f9081c3c704d8c7 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 27 May 2025 23:08:59 -0700 Subject: [PATCH] Format Created using spr 1.3.6-beta.1 --- llvm/lib/Transforms

[llvm-branch-commits] X86: Add X86TTIImpl::isProfitableToSinkOperands hook for immediate operands. (PR #141326)

2025-05-28 Thread Peter Collingbourne via llvm-branch-commits
@@ -7170,16 +7165,31 @@ bool X86TTIImpl::isProfitableToSinkOperands(Instruction *I, II->getIntrinsicID() == Intrinsic::fshr) ShiftAmountOpNum = 2; } - if (ShiftAmountOpNum == -1) return false; + auto *ShiftAmount = &I->getOperandUse(ShiftAmountOpNum);

[llvm-branch-commits] Add deactivation symbol operand to ConstantPtrAuth. (PR #133537)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: > Missing verifier checks? Right, I guess the new operand can either be null (no deactivation symbol) or a globalvariable. https://github.com/llvm/llvm-project/pull/133537 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm

[llvm-branch-commits] Add deactivation symbol operand to ConstantPtrAuth. (PR #133537)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
@@ -1699,7 +1699,9 @@ LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr, LLVMValueRef Key, LLVMValueRef Disc, LLVMValueRef AddrDisc) { return wrap(ConstantPtrAuth::get( unwrap(Ptr), unwrap(Key), - unwrap(Disc), unwrap(AddrDisc)));

[llvm-branch-commits] [llvm] Add SimplifyTypeTests pass. (PR #141327)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/141327 >From b36c74c344ed47b99e9bfdc28f9081c3c704d8c7 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 27 May 2025 23:08:59 -0700 Subject: [PATCH] Format Created using spr 1.3.6-beta.1 --- llvm/lib/Transforms

[llvm-branch-commits] Add SimplifyTypeTests pass. (PR #141327)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/141327 ___ 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] Add SimplifyTypeTests pass. (PR #141327)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/141327 ___ 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] Add SimplifyTypeTests pass. (PR #141327)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc edited https://github.com/llvm/llvm-project/pull/141327 ___ 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] X86: Add X86TTIImpl::isProfitableToSinkOperands hook for immediate operands. (PR #141326)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: > This PR doesn't entirely fix the problem. Another case that I'm seeing (and > which is more effectively prevented by the previous approach) is where GVN > PRE moves the zext behind a phi, and after subsequent optimization passes it > turns into a phi pointing to other phis which u

[llvm-branch-commits] CodeGenPrepare, X86: Support sinking phi nodes. (PR #141716)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: Depends on #141326 https://github.com/llvm/llvm-project/pull/141716 ___ 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] CodeGenPrepare, X86: Support sinking phi nodes. (PR #141716)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/141716 isProfitableToSinkOperands() may now return a phi node. If it does, check that all incoming values are identical and if so, replace the phi use with a clone of the incoming value. Use this mechanism to sink phi node o

[llvm-branch-commits] X86: Add X86TargetLowering::isProfitableToHoist hook for immediate operands. (PR #141326)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: I'm fixing the code generation for the test cases that I'm adding (inhibit-zext-constant-hoist.ll) which were all extracted from a build of a large internal program built with CFI. Previously f1 looked like this where align was hoisted: ``` f1: #

[llvm-branch-commits] LowerTypeTests: Set small code model on imported globals. (PR #141324)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/141324 ___ 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] LowerTypeTests: Set small code model on imported globals. (PR #141324)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
@@ -1019,8 +1019,14 @@ LowerTypeTestsModule::importTypeId(StringRef TypeId) { return C; }; - if (TIL.TheKind != TypeTestResolution::Unsat) -TIL.OffsetedGlobal = ImportGlobal("global_addr"); + if (TIL.TheKind != TypeTestResolution::Unsat) { +auto *GV = ImportGlo

[llvm-branch-commits] LowerTypeTests: Set small code model on imported globals. (PR #141324)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/141324 ___ 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] [llvm][EmbedBitcodePass] Prevent modifying the module with ThinLTO (PR #139999)

2025-05-27 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc approved this pull request. Cloning makes sense to me at least to begin with. Since fat LTO is a seldomly used feature, it may be better overall to be a bit less efficient in order to reduce the overall maintenance burden. https://github.com/llvm/llvm-project/pull/13

[llvm-branch-commits] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
@@ -1951,9 +1952,23 @@ let Predicates = [HasPAuth] in { let Uses = [X16]; } + def AUTxMxN : Pseudo<(outs GPR64:$AuthVal, GPR64common:$Scratch), + (ins GPR64:$Val, i32imm:$Key, +i64imm:$Disc, GPR64:$AddrDisc), +

[llvm-branch-commits] Add pointer field protection feature. (PR #133538)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133538 ___ 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] Add pointer field protection feature. (PR #133538)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133538 ___ 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] Add deactivation symbol operand to ConstantPtrAuth. (PR #133537)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133537 ___ 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] Add deactivation symbol operand to ConstantPtrAuth. (PR #133537)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133537 ___ 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] Add IR and codegen support for deactivation symbols. (PR #133536)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133536 ___ 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] Add IR and codegen support for deactivation symbols. (PR #133536)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133536 ___ 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] MachineInstrBuilder: Introduce copyMIMetadata() function. (PR #133535)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133535 ___ 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] MachineInstrBuilder: Introduce copyMIMetadata() function. (PR #133535)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133535 ___ 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] ELF: Add support for R_AARCH64_INST32 relocation. (PR #133534)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133534 ___ 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] ELF: Add support for R_AARCH64_INST32 relocation. (PR #133534)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133534 ___ 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] CodeGen: Optionally emit PAuth relocations as IRELATIVE relocations. (PR #133533)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133533 ___ 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] CodeGen: Optionally emit PAuth relocations as IRELATIVE relocations. (PR #133533)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133533 ___ 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] [lld] ELF: Introduce R_AARCH64_FUNCINIT64 relocation type. (PR #133531)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133531 >From 96e7da9a083888683c2ba00d97f886fd748ea10b Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 9 Apr 2025 20:30:57 -0700 Subject: [PATCH] Undo unnecessary change Created using spr 1.3.6-beta.1 --- lld

[llvm-branch-commits] [lld] ELF: Introduce R_AARCH64_FUNCINIT64 relocation type. (PR #133531)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133531 >From 96e7da9a083888683c2ba00d97f886fd748ea10b Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 9 Apr 2025 20:30:57 -0700 Subject: [PATCH] Undo unnecessary change Created using spr 1.3.6-beta.1 --- lld

[llvm-branch-commits] [compiler-rt] compiler-rt: Introduce runtime functions for emulated PAC. (PR #133530)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133530 >From b37a44fff650b06eda249060277d0c007226cad2 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 3 Apr 2025 21:51:44 -0700 Subject: [PATCH] Fix CMake build Created using spr 1.3.6-beta.1 --- compiler-rt

[llvm-branch-commits] [compiler-rt] compiler-rt: Introduce runtime functions for emulated PAC. (PR #133530)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/133530 >From b37a44fff650b06eda249060277d0c007226cad2 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 3 Apr 2025 21:51:44 -0700 Subject: [PATCH] Fix CMake build Created using spr 1.3.6-beta.1 --- compiler-rt

[llvm-branch-commits] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: I thought about it some more and decided to go with your suggested approach anyway. Among other things, #133536 will mean that deactivation symbol support will be needed for the pseudo instruction in order to avoid deactivation symbol relocations being silently dropped, so it's best

[llvm-branch-commits] Extract SipHash implementation into a header. (PR #134197)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/134197 ___ 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] Extract SipHash implementation into a header. (PR #134197)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/134197 ___ 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] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc edited https://github.com/llvm/llvm-project/pull/132857 ___ 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] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/132857 ___ 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] AArch64: Relax x16/x17 constraint on AUT in certain cases. (PR #132857)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/132857 ___ 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] Add SimplifyTypeTests pass. (PR #141327)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/141327 This pass figures out whether inlining has exposed a constant address to a lowered type test, and remove the test if so and the address is known to pass the test. Unfortunately this pass ends up needing to reverse eng

[llvm-branch-commits] Transforms: Have CSE/GVN/LICM check isProfitableToHoist() before hoisting. (PR #141325)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/141325 LICM hoists instructions into the preheader, and CSE and GVN can effectively perform a hoist by replacing an instruction with one from another basic block, all of which can lead to the same kinds of pessimizations tha

[llvm-branch-commits] X86: Add X86TargetLowering::isProfitableToHoist hook for immediate operands. (PR #141326)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/141326 Casts taking a constant expression (generally derived from a global variable address) as an operand are not profitable to CSE because they appear as subexpressions in the instruction sequence generated by the LowerTyp

[llvm-branch-commits] LowerTypeTests: Set small code model on imported globals. (PR #141324)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/141324 This is either a vtable (in .data.rel.ro) or a jump table (in .text). Either way it's expected to be in the low 2 GiB, so set the small code model. ___ llvm-branch-commit

[llvm-branch-commits] Add pointer field protection feature. (PR #133538)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
@@ -7538,6 +7538,14 @@ static bool IsEligibleForTrivialRelocation(Sema &SemaRef, if (!SemaRef.IsCXXTriviallyRelocatableType(Field->getType())) return false; } + + // FIXME: PFP should not affect trivial relocatability, instead it should + // affect the implementat

[llvm-branch-commits] [clang] CodeGen: Fix implementation of __builtin_trivially_relocate. (PR #140312)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/140312 >From 1399ec4fdf8fe08000b590844f4e24c31a310a01 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 21 May 2025 16:20:57 -0700 Subject: [PATCH] Add test with variable count Created using spr 1.3.6-beta.1 --

[llvm-branch-commits] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/138366 >From d67e152baaf8487e5cb049166ce61e905011171e Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 30 Apr 2025 18:25:54 -0700 Subject: [PATCH] ELF: Add branch-to-branch optimization. MIME-Version: 1.0 Conte

[llvm-branch-commits] [clang] CodeGen: Fix implementation of __builtin_trivially_relocate. (PR #140312)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/140312 >From 1399ec4fdf8fe08000b590844f4e24c31a310a01 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 21 May 2025 16:20:57 -0700 Subject: [PATCH] Add test with variable count Created using spr 1.3.6-beta.1 --

[llvm-branch-commits] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-23 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: Right, this feature doesn't change section sizes, so there shouldn't be an interaction with SHT_LLVM_BB_ADDR_MAP. AFAICT LLD doesn't contain code that parses SHT_LLVM_BB_ADDR_MAP so I don't see value in adding a test for it. https://github.com/llvm/llvm-project/pull/138366 _

[llvm-branch-commits] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-22 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/138366 >From 03060849dc81f83ec48f05995ac8fd6df846c25b Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Fri, 2 May 2025 16:57:28 -0700 Subject: [PATCH 1/5] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[llvm-branch-commits] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-22 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/138366 >From e0581c892d07d8bb5518fa412b75b8830f5fb14a Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 30 Apr 2025 18:25:54 -0700 Subject: [PATCH] ELF: Add branch-to-branch optimization. MIME-Version: 1.0 Conte

[llvm-branch-commits] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-22 Thread Peter Collingbourne via llvm-branch-commits
@@ -0,0 +1,92 @@ +//===- TargetImpl.h -*- 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] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-22 Thread Peter Collingbourne via llvm-branch-commits
@@ -0,0 +1,92 @@ +//===- TargetImpl.h -*- 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] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-22 Thread Peter Collingbourne via llvm-branch-commits
@@ -975,6 +977,62 @@ void AArch64::relocateAlloc(InputSectionBase &sec, uint8_t *buf) const { } } +static std::optional getControlTransferAddend(InputSection &is, +Relocation &r) { + // Identify a control transfer rel

[llvm-branch-commits] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-22 Thread Peter Collingbourne via llvm-branch-commits
@@ -0,0 +1,92 @@ +//===- TargetImpl.h -*- 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] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-22 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc edited https://github.com/llvm/llvm-project/pull/138366 ___ 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] [lld] ELF: Add branch-to-branch optimization. (PR #138366)

2025-05-22 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc edited https://github.com/llvm/llvm-project/pull/138366 ___ 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] CodeGen: Fix implementation of __builtin_trivially_relocate. (PR #140312)

2025-05-21 Thread Peter Collingbourne via llvm-branch-commits
@@ -8,7 +8,7 @@ struct S trivially_relocatable_if_eligible { }; // CHECK: @_Z4testP1SS0_ -// CHECK: call void @llvm.memmove.p0.p0.i64 +// CHECK: call void @llvm.memmove.p0.p0.i64({{.*}}, i64 8 pcc wrote: Done https://github.com/llvm/llvm-project/pull/140312

[llvm-branch-commits] [clang] CodeGen: Fix implementation of __builtin_trivially_relocate. (PR #140312)

2025-05-21 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc updated https://github.com/llvm/llvm-project/pull/140312 >From 1399ec4fdf8fe08000b590844f4e24c31a310a01 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 21 May 2025 16:20:57 -0700 Subject: [PATCH] Add test with variable count Created using spr 1.3.6-beta.1 --

[llvm-branch-commits] CodeGen: Fix implementation of __builtin_trivially_relocate. (PR #140312)

2025-05-16 Thread Peter Collingbourne via llvm-branch-commits
@@ -4425,6 +4425,14 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, Address Dest = EmitPointerWithAlignment(E->getArg(0)); Address Src = EmitPointerWithAlignment(E->getArg(1)); Value *SizeVal = EmitScalarExpr(E->getArg(2)); +

[llvm-branch-commits] CodeGen: Fix implementation of __builtin_trivially_relocate. (PR #140312)

2025-05-16 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc created https://github.com/llvm/llvm-project/pull/140312 The builtin is documented to copy `count` elements, but the implementation copies `count` bytes. Fix that. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.

[llvm-branch-commits] Add pointer field protection feature. (PR #133538)

2025-05-15 Thread Peter Collingbourne via llvm-branch-commits
@@ -362,6 +362,17 @@ class LangOptionsBase { BKey }; + enum class PointerFieldProtectionKind { pcc wrote: I think that allowing this level of customization should be implemented as part of the separate opt-in solution (e.g. it may be a property of the

[llvm-branch-commits] Add pointer field protection feature. (PR #133538)

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc commented: Hi Oliver, thanks for your comments! I'll address them below. > Thoughts: > > This should be opt-in on a field or struct granularity, not just a global > behavior. This would certainly be easier if it were an opt-in behavior, as it would allow avoiding a sub

[llvm-branch-commits] Add pointer field protection feature. (PR #133538)

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -2201,6 +2215,22 @@ void CodeGenFunction::EmitCXXConstructorCall( EmitTypeCheck(CodeGenFunction::TCK_ConstructorCall, Loc, This, getContext().getRecordType(ClassDecl), CharUnits::Zero()); + // When initializing an object that has pointer field protect

  1   2   3   >