[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-10-13 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > looks good - a few bits should be committed separately from this change, so > please do those first and then commit this change Separate review opened up at: https://github.com/llvm/llvm-project/pull/68967 For simplicity's sake I'll keep this patch as-is, and rebase it when th

[clang-tools-extra] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-10-18 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/66632 >From 18f494a4006b4c21b364a91107d4a07ceaf88213 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Mon, 18 Sep 2023 09:59:11 +0100 Subject: [PATCH 1/3] [LLVM] Add new attribute `optdebug` to optimize for debuggin

[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-10-18 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/66632 >From eccff5693ebcaac45a7ddf56cbb33a48de281041 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Mon, 18 Sep 2023 09:59:11 +0100 Subject: [PATCH 1/3] [LLVM] Add new attribute `optdebug` to optimize for debuggin

[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-10-18 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/66632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RemoveDIs] Update Clang front end to handle DbgRecords (PR #84756)

2024-03-18 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer approved this pull request. It's been a bit without any comments, probably safe now to land this. https://github.com/llvm/llvm-project/pull/84756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] 9a96fb4 - Reapply "[NFC][RemoveDIs] Switch ConstantExpr::getAsInstruction to not insert (#84737)"

2024-03-19 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2024-03-19T15:49:10Z New Revision: 9a96fb4445f4e9d9a7899189758ee6afbeb6510b URL: https://github.com/llvm/llvm-project/commit/9a96fb4445f4e9d9a7899189758ee6afbeb6510b DIFF: https://github.com/llvm/llvm-project/commit/9a96fb4445f4e9d9a7899189758ee6afbeb6510b.diff LOG:

[clang] [llvm] [RemoveDIs][NFC] Rename DPValue -> DbgVariableRecord (PR #85216)

2024-03-19 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/85216 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Remove remaining uses of Instruction-constructors that insert before another Instruction (PR #85981)

2024-03-20 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/85981 Related to the work noted in [discourse](https://discourse.llvm.org/t/psa-instruction-constructors-changing-to-iterator-only-insertion/77845) and in [this](https://github.com/llvm/llvm-project/pull/85980) patch.

[clang] [llvm] [CMAKE] Enable FatLTO as a build option for LLVM (PR #80480)

2024-02-27 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/80480 >From 4d280199a9eb027127bdc9c31a266fa3e2fa6cea Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Tue, 22 Aug 2023 15:24:03 + Subject: [PATCH 1/2] [CMAKE] Enable FatLTO as a build option for LLVM --- clang/cma

[clang] [llvm] Remove remaining uses of Instruction-constructors that insert before another Instruction (PR #85981)

2024-04-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/85981 >From b2f6d93d87082dd0ccc91a9a8094a4c3552b81a2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 20 Mar 2024 17:43:10 + Subject: [PATCH] Assorted fixes since rebase and outside core llvm --- clang/lib

[clang] [llvm] Remove remaining uses of Instruction-constructors that insert before another Instruction (PR #85981)

2024-04-05 Thread Stephen Tozer via cfe-commits
@@ -1542,19 +1542,10 @@ class CallBase : public Instruction { OperandBundleDef OB, Instruction *InsertPt = nullptr); - /// Create a clone of \p CB with operand bundle \p OB added. - static CallBase *addO

[clang] [llvm] Remove remaining uses of Instruction-constructors that insert before another Instruction (PR #85981)

2024-04-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/85981 >From b2f6d93d87082dd0ccc91a9a8094a4c3552b81a2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 20 Mar 2024 17:43:10 + Subject: [PATCH 1/2] Assorted fixes since rebase and outside core llvm --- clang

[clang] [llvm] Remove remaining uses of Instruction-constructors that insert before another Instruction (PR #85981)

2024-04-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/85981 >From b2f6d93d87082dd0ccc91a9a8094a4c3552b81a2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 20 Mar 2024 17:43:10 + Subject: [PATCH 1/3] Assorted fixes since rebase and outside core llvm --- clang

[clang] [RemoveDIs] Update Clang front end to handle DbgRecords (PR #84756)

2024-03-11 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/84756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RemoveDIs] Update Clang front end to handle DbgRecords (PR #84756)

2024-03-11 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer commented: Maybe wants someone with more frontend knowledge to chime in, but all SGTM. https://github.com/llvm/llvm-project/pull/84756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [RemoveDIs] Update Clang front end to handle DbgRecords (PR #84756)

2024-03-11 Thread Stephen Tozer via cfe-commits
@@ -4746,20 +4746,32 @@ void CodeGenFunction::EmitOMPTaskBasedDirective( if (CGF.CGM.getCodeGenOpts().hasReducedDebugInfo()) (void)DI->EmitDeclareOfAutoVariable(SharedVar, ContextValue, CGF.Builder, false); -

[llvm] [clang] [clang-tools-extra] [DebugInfo][RemoveDIs] Don't allocate one DPMarker per instruction (PR #79345)

2024-02-06 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer approved this pull request. https://github.com/llvm/llvm-project/pull/79345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [clang] [DebugInfo][RemoveDIs] Add a DPValue implementation for instcombine sinking (PR #77930)

2024-01-25 Thread Stephen Tozer via cfe-commits
@@ -4266,19 +4285,140 @@ bool InstCombinerImpl::tryToSinkInstruction(Instruction *I, // Perform salvaging without the clones, then sink the clones. if (!DIIClones.empty()) { -// RemoveDIs: pass in empty vector of DPValues until we get to instrumenting -// this pa

[llvm] [clang-tools-extra] [clang] [DebugInfo][RemoveDIs] Add a DPValue implementation for instcombine sinking (PR #77930)

2024-01-25 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer approved this pull request. LGTM with latest changes. https://github.com/llvm/llvm-project/pull/77930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #94100)

2024-06-10 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Yes, to my knowledge Swift emits dbg.values out of its front end, so there's probably no reason (on the LLVM side) that clang couldn't do so as well. There might be good reasons internal to clang that it doesn't use debug values atm, and it's not inconceivable that we'd hit some

[clang] 2dc2290 - Revert new debug info format commits:

2024-06-11 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2024-06-11T12:19:06+01:00 New Revision: 2dc2290860355dd2bac3b655eea895fe30fde257 URL: https://github.com/llvm/llvm-project/commit/2dc2290860355dd2bac3b655eea895fe30fde257 DIFF: https://github.com/llvm/llvm-project/commit/2dc2290860355dd2bac3b655eea895fe30fde257.diff

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-13 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-13 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer reopened https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-13 Thread Stephen Tozer via cfe-commits
@@ -5746,6 +5746,57 @@ void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var, Var->addDebugInfo(GVE); } +void CGDebugInfo::EmitPseudoVariable(CGBuilderTy &Builder, + llvm::Instruction *Value, QualType Ty) { + // Only when -g2

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-13 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/95298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-13 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Abandoned in favour of https://github.com/llvm/llvm-project/pull/94226. https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] dc726c3 - Reapply#4 "[RemoveDIs] Load into new debug info format by default in LLVM (#89799)"

2024-06-14 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2024-06-14T09:54:56+01:00 New Revision: dc726c340392d4a0f3af9dde5f34c58d98198667 URL: https://github.com/llvm/llvm-project/commit/dc726c340392d4a0f3af9dde5f34c58d98198667 DIFF: https://github.com/llvm/llvm-project/commit/dc726c340392d4a0f3af9dde5f34c58d98198667.diff

[clang] [llvm] [mlir] [polly] [RemoveDIs] Print IR with debug records by default (PR #91724)

2024-06-14 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/91724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] (New) Add option to generate additional debug info for expression dereferencing pointer to pointers (PR #95298)

2024-06-14 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Small recommendation that the [patch](https://github.com/llvm/llvm-project/pull/91724) @pogo59 mentioned above has now landed, so before merging this you should rebase and update the test accordingly. https://github.com/llvm/llvm-project/pull/95298 _

[clang] [llvm] [RemoveDIs] Print IR with debug records by default (PR #91724)

2024-05-13 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > There's one part I did not fully understand. How did you identify the > "pre-script fixups"? What's the importance of those changes? I did not seen > any mention of that in your PR description. Good question, I'll add my answer to the main description: The pre-script fixups w

[clang] [llvm] [RemoveDIs] Print IR with debug records by default (PR #91724)

2024-05-13 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/91724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RemoveDIs] Print IR with debug records by default (PR #91724)

2024-05-13 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/91724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RemoveDIs] Print IR with debug records by default (PR #91724)

2024-05-13 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > Thanks for clarifying the pre-script fixes. With that resolved, this looks > good to me. TYVM for the LGTM! I'll leave the review up for a bit in case anyone has anything further to add. https://github.com/llvm/llvm-project/pull/91724 _

[clang] [clang] Store FPOptions earlier when parsing function (PR #92146)

2024-05-14 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/92146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Store FPOptions earlier when parsing function (PR #92146)

2024-05-14 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer approved this pull request. I'm not familiar with the surrounding code, but this fixes the issue and looks reasonable. https://github.com/llvm/llvm-project/pull/92146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [clang] Store FPOptions earlier when parsing function (PR #92146)

2024-05-14 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -emit-pch -DHEADER -x c++-header %s -o %t.pch +// RUN: %clang_cc1 -emit-llvm -include-pch %t.pch %s -o /dev/null + +#ifdef HEADER +__attribute__((optnone)) void foo() {} +#endif SLTozer wrote: It's not particularly important, b

[clang] [clang] Store FPOptions earlier when parsing function (PR #92146)

2024-05-15 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -emit-pch -DHEADER -x c++-header %s -o %t.pch +// RUN: %clang_cc1 -emit-llvm -include-pch %t.pch %s -o /dev/null + +#ifdef HEADER +__attribute__((optnone)) void foo() {} +#endif SLTozer wrote: Ah, that makes sense since you're

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-21 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gomit-unreferenced-members %s -emit-llvm -o - | FileCheck %s SLTozer wrote: Test needs renaming for the different flag name? https://github.com/llvm/llvm-project/pull/87018 _

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-21 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/87018 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-21 Thread Stephen Tozer via cfe-commits
@@ -2755,7 +2755,7 @@ CGDebugInfo::CreateTypeDefinition(const RecordType *Ty) { // Collect data fields (including static variables and any initializers). CollectRecordFields(RD, DefUnit, EltTys, FwdDecl); - if (CXXDecl) + if (CXXDecl && !CGM.getCodeGenOpts().DebugOmitUnr

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-21 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer commented: I think the comment about `s/members/methods/` is still outstanding - I agree that methods is more descriptive than members. I'm +1 on having this be non-default; adding it to SCE tuning is also not necessary (or desired) for now, because this is more aggr

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-21 Thread Stephen Tozer via cfe-commits
@@ -4260,6 +4260,13 @@ defm strict_dwarf : BoolOption<"g", "strict-dwarf", "the specified version, avoiding features from later versions.">, NegFlag, BothFlags<[], [ClangOption, CLOption, DXCOption]>>, Group; +defm omit_unreferenced_members : BoolOption<"g", "omit

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-28 Thread Stephen Tozer via cfe-commits
@@ -4260,6 +4260,13 @@ defm strict_dwarf : BoolOption<"g", "strict-dwarf", "the specified version, avoiding features from later versions.">, NegFlag, BothFlags<[], [ClangOption, CLOption, DXCOption]>>, Group; +defm omit_unreferenced_members : BoolOption<"g", "omit

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/87018 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer approved this pull request. > Yeah, seems I'm outvoted here. I'm a bit of a pedant for the C++ standard > language, which doesn't talk about "methods", only "member functions". All I'd say is that if we went with members, it ought to be `-gomit-unreferenced-member-fu

[clang] [RemoveDIs][Clang] Resolve DILocalVariables used by DbgRecords (PR #90882)

2024-05-02 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/90882 This patch fixes debug records in clang, by adding support for debug records to the only remaining place that refers to DbgVariableIntrinsics directly and does not handle DbgVariableRecords. >From d4e716205806b

[clang] [RemoveDIs][Clang] Resolve DILocalVariables used by DbgRecords (PR #90882)

2024-05-02 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/90882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-05-10 Thread Stephen Tozer via cfe-commits
SLTozer wrote: It looks like this is causing crashes when including precompiled headers that contain optnone functions; this can be reproduced with a very short header file and any source file, even a completely empty one. Reproducer follows: ``` $ cat header.h __attribute__((optnone)) void foo

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-03 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Extend EmitPseudoVariable to support debug records (PR #94956)

2024-06-10 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/94956 CGDebugInfo::EmitPseudoVariable currently uses detailed logic to exactly collect llvm.dbg.declare users of an alloca. This patch replaces this with an LLVM function for finding debug declares intrinsics and also

[clang] [Clang] Extend EmitPseudoVariable to support debug records (PR #94956)

2024-06-10 Thread Stephen Tozer via cfe-commits
@@ -5766,28 +5766,16 @@ void CGDebugInfo::EmitPseudoVariable(CGBuilderTy &Builder, // it is loaded upon use, so we identify such pattern here. if (llvm::LoadInst *Load = dyn_cast(Value)) { llvm::Value *Var = Load->getPointerOperand(); -if (llvm::Metadata *MDValue =

[clang] [Clang] Extend EmitPseudoVariable to support debug records (PR #94956)

2024-06-10 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/94956 >From 56109f5f411523967ffef5a32a507d6472eebdaf Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Mon, 10 Jun 2024 11:35:02 +0100 Subject: [PATCH 1/2] [Clang] Extend EmitPseudoVariable to support debug records

[clang] [Clang] Extend EmitPseudoVariable to support debug records (PR #94956)

2024-06-10 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/94956 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] c5aeca7 - Reapply#3 "[RemoveDIs] Load into new debug info format by default in LLVM (#89799)"

2024-06-10 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2024-06-10T13:04:40+01:00 New Revision: c5aeca732d1ff6769b0659efebd1cfb5f60487e4 URL: https://github.com/llvm/llvm-project/commit/c5aeca732d1ff6769b0659efebd1cfb5f60487e4 DIFF: https://github.com/llvm/llvm-project/commit/c5aeca732d1ff6769b0659efebd1cfb5f60487e4.diff

[clang] [llvm] [polly] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Alright, builds now working for LLVM, Clang, Flang, Polly, and MLIR; looks good to merge? https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [llvm] [polly] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > I think some of the overloads for constructing an instruction aren't quite > right: That's reasonable - I defaulted to adding nullptr-defaults in the case where it didn't cause incorrect overloads, but it's easier to keep only the existing defaults and let any others be added

[clang] [llvm] [polly] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-20 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/96497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Stephen Tozer via cfe-commits
@@ -637,8 +637,7 @@ void ARMParallelDSP::InsertParallelMACs(Reduction &R) { Intrinsic::getDeclaration(M, Intrinsic::arm_smlad) : Intrinsic::getDeclaration(M, Intrinsic::arm_smlald); -IRBuilder Builder(InsertAfter->getParent(), -

[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Stephen Tozer via cfe-commits
@@ -44,15 +44,19 @@ template <> struct ilist_alloc_traits { iterator_range::iterator> getDbgRecordRange(DbgMarker *); +/// Class used to generate an insert position (ultimately always a +/// BasicBlock::iterator, which it will implicitly convert to) from either: +/// - An Inst

[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/96497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/96497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Looks like I missed a spot - reverting for now, will wait for a bit to see if any other errors fall out from the various configurations on CI before reapplying. https://github.com/llvm/llvm-project/pull/96497 ___ cfe-commits mailing li

[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > Looks like using InsertPosition in IRBuilder has some overhead: Hm, we're adding an extra pointer chase when we give up passing a basicblock - I think then it makes sense to keep the option to pass BB+It, and do so when the caller already knows the BB (while removing the need

[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-25 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > My guess here would have been that the issue is the cases where an > Instruction* or BasicBlock* is passed rather than BB+Iterator, because those > two cases go through an out-of-line constructor. Seems like you're right - removing the extra dereference does little-to-nothing

[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-09-18 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/66632 This patch adds a new fn attribute, `optdebug`, that specifies that optimizations should make decisions that prioritize debug info quality, potentially at the cost of runtime performance. This patch does not ad

[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-09-19 Thread Stephen Tozer via cfe-commits
@@ -2325,6 +2325,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, B.addAttribute(llvm::Attribute::Naked); // OptimizeNone wins over OptimizeForSize and MinSize. +F->removeFnAttr(llvm::Attribute::OptimizeForDebugging); --

[clang] [clang][CodeGen] The `eh_typeid_for` intrinsic needs special care too (PR #65699)

2023-09-19 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/65699 >From f4271e03667b64c8d10d7e4de16e78b37e845229 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Fri, 8 Sep 2023 00:21:59 +0100 Subject: [PATCH 1/2] AS_cast the argument to `eh_typeid_for` iff typeinfo is not in t

[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-09-20 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Making this attribute mutually exclusive with `optdebug` and `optsize` is fine with me - as a question for the esteemed reviewers of this patch, would it be preferred to add this exclusivity and associated verifier checks in a separate patch, or as part of this patch? https://g

[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-09-21 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/66632 >From 18f494a4006b4c21b364a91107d4a07ceaf88213 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Mon, 18 Sep 2023 09:59:11 +0100 Subject: [PATCH 1/2] [LLVM] Add new attribute `optdebug` to optimize for debuggin

[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-10-12 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/66632 >From 18f494a4006b4c21b364a91107d4a07ceaf88213 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Mon, 18 Sep 2023 09:59:11 +0100 Subject: [PATCH 1/3] [LLVM] Add new attribute `optdebug` to optimize for debuggin

[clang] [LLVM] Add new attribute `optdebug` to optimize for debugging (PR #66632)

2023-10-12 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Small ping - all comments have now been addressed now I think. https://github.com/llvm/llvm-project/pull/66632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ExtendLifetimes] Add extend lifetimes to emit fake uses from clang (PR #106724)

2024-08-30 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/106724 This patch adds flags to clang to emit fake use intrinsics into IR, preserving the value of variables through codegen to improve the debugging experience. The two flags added are `-fextend-lifetimes`, which ext

[clang] [ExtendLifetimes] Add extend lifetimes to emit fake uses from clang (PR #106724)

2024-08-30 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/106724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ExtendLifetimes] Add extend lifetimes to emit fake uses from clang (PR #106724)

2024-09-02 Thread Stephen Tozer via cfe-commits
@@ -1412,6 +1420,39 @@ void CodeGenFunction::EmitAndRegisterVariableArrayDimensions( } } +/// Return the maximum size of an aggregate for which we generate a fake use +/// intrinsic when -fextend-lifetimes is in effect. +static uint64_t maxFakeUseAggregateSize(const ASTCont

[clang] [ExtendLifetimes] Add extend lifetimes to emit fake uses from clang (PR #106724)

2024-09-02 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/106724 >From 2b529d443d5e8512ffea6566a3d4d1e04e9542e3 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Fri, 30 Aug 2024 12:49:26 +0100 Subject: [PATCH 1/2] [ExtendLifetimes] Add extend lifetimes to emit fake uses fr

[clang] [ExtendLifetimes] Add extend lifetimes to emit fake uses from clang (PR #106724)

2024-09-02 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/106724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/107369 This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This patch adds an origin-tracking feature, which collects a stack trace at the point

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/107369 >From e45d7e68a371a09ea766c4accf8edc6c030fd7fd Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 4 Sep 2024 12:09:50 +0100 Subject: [PATCH 1/3] Add CMake option to enable expensive line number origin trac

[clang] [llvm] [DLCov 2/5] Implement DebugLoc coverage tracking (PR #107279)

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/107279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/107369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DLCov 2/5] Implement DebugLoc coverage tracking (PR #107279)

2024-09-04 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/107279 This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This is the patch that adds the main feature, adding a set of `DebugLoc::get` function