[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

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

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -928,6 +936,11 @@ namespace { if (PointerAuthQualifier Q = F->getType().getPointerAuth(); Q && Q.isAddressDiscriminated()) return false; + // Non-trivially-copyable fields with pointer field protection need to be pcc wrote: We c

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

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
https://github.com/pcc edited 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-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -2268,13 +2293,22 @@ CodeGenFunction::EmitNullInitialization(Address DestPtr, QualType Ty) { // Get and call the appropriate llvm.memcpy overload. Builder.CreateMemCpy(DestPtr, SrcPtr, SizeVal, false); -return; + } else { +// Otherwise, just memset the who

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

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -2976,7 +3006,15 @@ void CodeGenFunction::EmitForwardingCallToLambda( QualType resultType = FPT->getReturnType(); ReturnValueSlot returnSlot; if (!resultType->isVoidType() && - calleeFnInfo->getReturnInfo().getKind() == ABIArgInfo::Indirect && + (calleeFnInfo

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

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -544,6 +544,7 @@ TYPE_TRAIT_2(__is_pointer_interconvertible_base_of, IsPointerInterconvertibleBas #include "clang/Basic/TransformTypeTraits.def" // Clang-only C++ Type Traits +TYPE_TRAIT_1(__has_non_relocatable_fields, HasNonRelocatableFields, KEYCXX) pcc

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

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -7756,6 +7756,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.addOptInFlag(CmdArgs, options::OPT_funique_source_file_names, options::OPT_fno_unique_source_file_names); + if (!IsCudaDevice) pcc wrote: With CU

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

2025-05-14 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] Add pointer field protection feature. (PR #133538)

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -2513,6 +2513,12 @@ def CountedByOrNull : DeclOrTypeAttr { let LangOpts = [COnly]; } +def NoPointerFieldProtection : DeclOrTypeAttr { pcc wrote: There are numerous circumstances where the C++ ABI is distinct from the platform ABI and is allowed to chang

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

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -441,6 +445,254 @@ bool PreISelIntrinsicLowering::expandMemIntrinsicUses(Function &F) const { return Changed; } +namespace { + +enum class PointerEncoding { + Rotate, + PACCopyable, + PACNonCopyable, +}; + +bool expandProtectedFieldPtr(Function &Intr) { + Module &M =

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

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -1415,6 +1469,52 @@ void CodeGenFunction::CreateCoercedStore(llvm::Value *Src, Address Dst, } } + // Coercion directly through memory does not work if the structure has pointer + // field protection because the struct passed by value has a different bit + // patt

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

2025-05-14 Thread Peter Collingbourne via llvm-branch-commits
@@ -3011,6 +3011,12 @@ defm experimental_omit_vtable_rtti : BoolFOption<"experimental-omit-vtable-rtti" NegFlag, BothFlags<[], [CC1Option], " the RTTI component from virtual tables">>; +def experimental_pointer_field_protection_EQ : Joined<["-"], "fexperimental-pointer-f

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

2025-05-13 Thread Peter Collingbourne via llvm-branch-commits
pcc wrote: Thanks for your suggestion, I tried it. This is the patch: https://github.com/pcc/llvm-project/tree/pfp-autxmxn I found that it was more code (it adds 102 insertions(+), 66 deletions(-) on top of this patch). And I only implemented the SDAG side so far, not GISel. So I'm inclined n

[llvm-branch-commits] MachineInstrBuilder: Introduce copyMIMetadata() function. (PR #133535)

2025-05-12 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

  1   2   3   >