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

2024-09-26 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Split into two new reviews: https://github.com/llvm/llvm-project/pull/11 & https://github.com/llvm/llvm-project/pull/110102 https://github.com/llvm/llvm-project/pull/106724 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

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

2024-09-26 Thread Stephen Tozer via cfe-commits
@@ -22,6 +23,67 @@ namespace llvm { class LLVMContext; class raw_ostream; class DILocation; + class Function; + +#if ENABLE_DEBUGLOC_COVERAGE_TRACKING + // Used to represent different "kinds" of DebugLoc, expressing that a DebugLoc + // is either ordinary, containing

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

2024-09-26 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/107279 >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 3/5] Implement DebugLoc origin-tracking (PR #107369)

2024-09-25 Thread Stephen Tozer via cfe-commits
@@ -1279,6 +1279,9 @@ void Instruction::swapProfMetadata() { void Instruction::copyMetadata(const Instruction &SrcInst, ArrayRef WL) { + if (WL.empty() || is_contained(WL, LLVMContext::MD_dbg)) +setDebugLoc(SrcInst.getDebugLoc()); --

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-09-25 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/11 Following the commit that added the fake use intrinsic to LLVM, this patch adds a pair of flags for the clang frontend that emit fake use intrinsics, for the purpose of extending the lifetime of variables (eith

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

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

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Ping - if anyone isn't able to review themselves but has an idea of someone who might, adding/pinging them would also be appreciated. https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -1834,6 +1834,14 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setInlining(CodeGenOptions::NormalInlining); } + // If we have specified -Og and have not set any explicit -fextend-lifetimes + // value, then default to -fexten

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,30 @@ +/// Check that we generate fake uses only when -fextend-lifetimes is set and we +/// are not setting optnone, or when we have optimizations set to -Og and we have +/// not passed -fno-extend-lifetimes. +// RUN: %clang_cc1 -emit-llvm -disable-llvm-passes -O0 -fex

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

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

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,61 @@ +// RUN: %clang_cc1 %s -O0 -disable-O0-optnone -emit-llvm -fextend-lifetimes -fsanitize=null -fsanitize-trap=null -o - | FileCheck --check-prefixes=CHECK,NULL --implicit-check-not=ubsantrap %s +// RUN: %clang_cc1 %s -O0 -disable-O0-optnone -emit-llvm -fextend-li

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-29 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > As far as I understand it, these are driver options that will be passed > through to cc1? In that case we can at least test the passthrough, i.e. that > `-fextend-lifetimes` appears in the output of `-###`. I think my preferred approach would be to merge both patches simultane

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-29 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/118026 >From 7e42a82d73e3be98aab8e523b16a2e43d31b0552 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Thu, 28 Nov 2024 13:53:20 + Subject: [PATCH 1/2] Enable -fextend-lifetimes at -Og --- clang/docs/CommandGui

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -1353,6 +1353,19 @@ void CodeGenFunction::EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr) { C->setDoesNotThrow(); } +void CodeGenFunction::EmitFakeUse(Address Addr) { + // We do not emit a fake use if we want to apply optnone to this function, + // even if we mig

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
@@ -1664,6 +1710,17 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { emission.getOriginalAllocatedAddress(), emission.getSizeForLifetimeMarkers()); + // Analogous to lifetime markers,

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/110102 >From fdfa695bc74847f5cc366bfcbf142bd5c2e3937f Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 16:55:39 +0100 Subject: [PATCH 1/3] [Clang] Add fake use emission to Clang with -fextend-lifeti

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-29 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/110102 >From fdfa695bc74847f5cc366bfcbf142bd5c2e3937f Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 16:55:39 +0100 Subject: [PATCH 1/4] [Clang] Add fake use emission to Clang with -fextend-lifeti

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-27 Thread Stephen Tozer via cfe-commits
@@ -2217,6 +2217,11 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Args.getAllArgValues(OPT_fsanitize_trap_EQ), Diags, Opts.SanitizeTrap); + Opts.ExtendThisPtr = + Opts.OptimizationLevel > 0

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-27 Thread Stephen Tozer via cfe-commits
SLTozer wrote: This patch has been changed as a result of some other patches that have removed the need for the attribute that this patch once added. Since this patch does not emit fake uses (the actual emission of fake uses is added in the [next patch](https://github.com/llvm/llvm-project/pul

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-27 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,22 @@ +// RUN: %clang_cc1 %s -O2 -emit-llvm -fextend-lifetimes -o - | FileCheck %s +// Make sure we don't generate fake.use for non-scalar variables. +// Make sure we don't generate fake.use for volatile variables +// and parameters even when they are scalar. + +struct

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-11-27 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From a33566974fbf260181d20d3f1b67081d21493506 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/2] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-11-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/118026 This patch follows two other ongoing reviews, https://github.com/llvm/llvm-project/pull/11 and https://github.com/llvm/llvm-project/pull/110102, which add a new feature to Clang - `-fextend-lifetimes`, whi

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-27 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/110102 >From 7d8646edb373c38ee761de2c338c45b967a423e7 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 16:55:39 +0100 Subject: [PATCH 1/2] [Clang] Add fake use emission to Clang with -fextend-lifeti

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-25 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 %s -O2 -emit-llvm -fextend-lifetimes -o - | FileCheck %s +// Check that fake use calls are emitted at the correct locations, i.e. +// at the end of lexical blocks and at the end of the function. + +extern int use(int); +int glob1; +int glob2; +

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

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

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-11-25 Thread Stephen Tozer via cfe-commits
@@ -0,0 +1,43 @@ +// RUN: %clang_cc1 %s -triple=%itanium_abi_triple -O1 -emit-llvm -fextend-lifetimes -o - | FileCheck %s +// Make sure we don't crash compiling a lambda that is not nested in a function. +// We also check that fake uses are properly issued in lambdas. + +int glo

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From 6a873f5c487a936344f6cd226b7d525b406f34b2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/4] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-12-04 Thread Stephen Tozer via cfe-commits
@@ -1353,6 +1353,19 @@ void CodeGenFunction::EmitLifetimeEnd(llvm::Value *Size, llvm::Value *Addr) { C->setDoesNotThrow(); } +void CodeGenFunction::EmitFakeUse(Address Addr) { + // We do not emit a fake use if we want to apply optnone to this function, + // even if we mig

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

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

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-12-04 Thread Stephen Tozer via cfe-commits
@@ -1834,6 +1834,14 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setInlining(CodeGenOptions::NormalInlining); } + // If we have specified -Og and have not explicitly set -fno-extend-lifetimes, + // then default to -fextend-li

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-29 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/110102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-12-12 Thread Stephen Tozer via cfe-commits
@@ -1664,6 +1710,17 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { emission.getOriginalAllocatedAddress(), emission.getSizeForLifetimeMarkers()); + // Analogous to lifetime markers,

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

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

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

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

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-12 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From 6a873f5c487a936344f6cd226b7d525b406f34b2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/6] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-12-12 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/118026 >From efd7f58e421b0afdc886688128f72170e0c4a970 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/2] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-12-12 Thread Stephen Tozer via cfe-commits
@@ -1834,6 +1834,14 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setInlining(CodeGenOptions::NormalInlining); } + // If we have specified -Og and have not explicitly set -fno-extend-lifetimes, + // then default to -fextend-li

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-12 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From 6a873f5c487a936344f6cd226b7d525b406f34b2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/7] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-12-12 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/110102 >From fdfa695bc74847f5cc366bfcbf142bd5c2e3937f Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 16:55:39 +0100 Subject: [PATCH 1/5] [Clang] Add fake use emission to Clang with -fextend-lifeti

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-12-12 Thread Stephen Tozer via cfe-commits
SLTozer wrote: I've added a test for this patch that tests the driver - since we will now be relying on the driver to decide whether to pass these flags to the frontend, rather than trivially always doing so (so that [later on](https://github.com/llvm/llvm-project/pull/118026) we can use the d

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2024-12-12 Thread Stephen Tozer via cfe-commits
SLTozer wrote: I've removed the logic that disables this flag at O0 - this has also removed the need for `-disable-O0-optnone` in any tests. Following the prior patch updating this flag to be an `=` flag represented by an enum, the latest commit changes this patch to handle that type. Finally,

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2024-12-12 Thread Stephen Tozer via cfe-commits
SLTozer wrote: I've updated this patch, and made it dependent on a [previous PR](https://github.com/llvm/llvm-project/pull/11) - the logic for enabling the flag is coupled with code from the earlier PR, and also we now slightly extend the test added in that PR instead of creating a new one

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-08 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Post-holiday ping - I believe all the comments have been addressed now, does the new form look acceptable? https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/110102 >From fdfa695bc74847f5cc366bfcbf142bd5c2e3937f Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 16:55:39 +0100 Subject: [PATCH 1/6] [Clang] Add fake use emission to Clang with -fextend-lifeti

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-01-24 Thread Stephen Tozer via cfe-commits
@@ -412,6 +412,20 @@ New Compiler Flags only for thread-local variables, and none (which corresponds to the existing ``-fno-c++-static-destructors`` flag) skips all static destructors registration. +- The ``-fextend-variable-liveness`` flag has been added to allow for imp

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/11 >From 6a873f5c487a936344f6cd226b7d525b406f34b2 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 25 Sep 2024 15:08:39 +0100 Subject: [PATCH 1/9] [Clang] Add "extend lifetime" flags and release note Follow

[clang] [llvm] [polly] [NFC][DebugInfo] Use iterator-flavour getFirstNonPHI at many call-sites (PR #123737)

2025-01-23 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/123737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [polly] [NFC][DebugInfo] Use iterator-flavour getFirstNonPHI at many call-sites (PR #123737)

2025-01-23 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer approved this pull request. Code changes LGTM. Regarding the direction of the patch, it seems a little unfortunate to completely remove `getFirstNonPHI()` - sometimes we want the instruction and sometimes we want the iterator, and forcing all of them to go through `g

[clang] [llvm] [polly] [NFC][DebugInfo] Use iterator-flavour getFirstNonPHI at many call-sites (PR #123737)

2025-01-23 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/123737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [polly] [NFC][DebugInfo] Use iterator-flavour getFirstNonPHI at many call-sites (PR #123737)

2025-01-23 Thread Stephen Tozer via cfe-commits
@@ -173,8 +173,9 @@ Value *SSAUpdater::GetValueInMiddleOfBlock(BasicBlock *BB) { // Set the DebugLoc of the inserted PHI, if available. DebugLoc DL; - if (const Instruction *I = BB->getFirstNonPHI()) - DL = I->getDebugLoc(); + BasicBlock::iterator It = BB->getFirstN

[clang] [llvm] [polly] [NFC][DebugInfo] Use iterator-flavour getFirstNonPHI at many call-sites (PR #123737)

2025-01-23 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/123737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-23 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Ping https://github.com/llvm/llvm-project/pull/110102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-24 Thread Stephen Tozer via cfe-commits
@@ -3595,15 +3595,26 @@ static llvm::StoreInst *findDominatingStoreToReturnValue(CodeGenFunction &CGF) { llvm::BasicBlock *IP = CGF.Builder.GetInsertBlock(); if (IP->empty()) return nullptr; -// Look at directly preceding instruction, skipping bitcasts and lifetim

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

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

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: With the prior patches having landed, this is now in a state where it could land; I've rebased it onto main, meaning all of the code diff in this PR is now relevant. https://github.com/llvm/llvm-project/pull/118026 ___ cfe-commits mail

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-01-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/118026 >From beb5e1955f9b0aa106512bb10d4543232e4d4cfa Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Thu, 28 Nov 2024 13:53:20 + Subject: [PATCH] Enable -fextend-lifetimes at -Og --- clang/docs/CommandGuide/c

[clang] [llvm] [Clang] Cleanup docs and comments relating to -fextend-variable-liveness (PR #124767)

2025-01-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/124767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Cleanup docs and comments relating to -fextend-variable-liveness (PR #124767)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Apologies, I didn't expect this PR to trigger a failure and didn't catch the triggered failures; thank you for catching this so quickly! https://github.com/llvm/llvm-project/pull/124767 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: I think the forward fix has been identified, and importantly it will take a bit longer to revert than to submit the fix (adding triples to the tests), because there are 4 commits that need to be reverted and I need to run a quick build to ensure that nothing is broken by the rev

[clang] de9b0dd - Add explicit triple to fix errors from #110102

2025-01-28 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2025-01-28T19:34:41Z New Revision: de9b0ddedc43302117b15518ca21f3341cf6b5ff URL: https://github.com/llvm/llvm-project/commit/de9b0ddedc43302117b15518ca21f3341cf6b5ff DIFF: https://github.com/llvm/llvm-project/commit/de9b0ddedc43302117b15518ca21f3341cf6b5ff.diff LOG:

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Merged in [71ab44a8](https://github.com/llvm/llvm-project/commit/71ab44a8193c56e4ef9aede4d9bac8e14760c6c6), via command line so as to provide proper commit author attribution to @wolfy1961 (as this doesn't seem to be possible via the web interface). https://github.com/llvm/llvm

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/11 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4424c44 - [Clang] Add fake use emission to Clang with -fextend-lifetimes (#110102)

2025-01-28 Thread Stephen Tozer via cfe-commits
Author: Wolfgang Pieb Date: 2025-01-28T12:30:31Z New Revision: 4424c44c8c4ec8e071f5c5999fba216d36fb92c9 URL: https://github.com/llvm/llvm-project/commit/4424c44c8c4ec8e071f5c5999fba216d36fb92c9 DIFF: https://github.com/llvm/llvm-project/commit/4424c44c8c4ec8e071f5c5999fba216d36fb92c9.diff LOG:

[clang] 71ab44a - [Clang] Add "extend lifetime" flags and release note (#110000)

2025-01-28 Thread Stephen Tozer via cfe-commits
Author: Wolfgang Pieb Date: 2025-01-28T10:08:02Z New Revision: 71ab44a8193c56e4ef9aede4d9bac8e14760c6c6 URL: https://github.com/llvm/llvm-project/commit/71ab44a8193c56e4ef9aede4d9bac8e14760c6c6 DIFF: https://github.com/llvm/llvm-project/commit/71ab44a8193c56e4ef9aede4d9bac8e14760c6c6.diff LOG:

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: As with the previous commit #11, this has been merged in [4424c44c](https://github.com/llvm/llvm-project/commit/4424c44c8c4ec8e071f5c5999fba216d36fb92c9), via command line so as to provide proper commit author attribution to @wolfy1961 (as this doesn't seem to be possible vi

[clang] 548ecde - Add extra explicit triple to fix errors from #110102

2025-01-28 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2025-01-28T22:51:30Z New Revision: 548ecde42886149dd4d69366d7c2dc02076a7083 URL: https://github.com/llvm/llvm-project/commit/548ecde42886149dd4d69366d7c2dc02076a7083 DIFF: https://github.com/llvm/llvm-project/commit/548ecde42886149dd4d69366d7c2dc02076a7083.diff LOG:

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: I made a mistake and missed one of the tests in the fix-forward commit - the [build with the fix commit](https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8724466517233166081/overview) only recently finished, so I've pushed up a second fix now -

[clang] 8ad9e1e - [Clang] Fix use of deprecated method and missing triple

2025-01-28 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2025-01-28T13:21:41Z New Revision: 8ad9e1ecb7e565c2f99b4ef67517d1f37d1c80d0 URL: https://github.com/llvm/llvm-project/commit/8ad9e1ecb7e565c2f99b4ef67517d1f37d1c80d0 DIFF: https://github.com/llvm/llvm-project/commit/8ad9e1ecb7e565c2f99b4ef67517d1f37d1c80d0.diff LOG:

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Pushed up a fix-forward commit, [8ad9e1e](https://github.com/llvm/llvm-project/commit/8ad9e1ecb7e565c2f99b4ef67517d1f37d1c80d0), that should fix the above issues; if issues still remain, I'll revert and recommit after fixing offline. https://github.com/llvm/llvm-project/pull/11

[clang] [llvm] [Clang] Cleanup docs and comments relating to -fextend-variable-liveness (PR #124767)

2025-01-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/124767 This patch contains a number of changes relating to the above flag; primarily it updates comment references to the old flag names, "-fextend-lifetimes" and "-fextend-this-ptr" to refer to the new names, "-fext

[clang] [llvm] [Clang] Cleanup docs and comments relating to -fextend-variable-liveness (PR #124767)

2025-01-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/124767 >From 3afa9cafe2f39ae28dd0c017c9dcd00dc6656143 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Tue, 28 Jan 2025 15:22:22 + Subject: [PATCH 1/2] [Clang][LLVM] Cleanup docs and comments relating to -fexten

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-28 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/110102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Looks like the fix commit is passing everywhere, marking this one closed by [4424c44c](https://github.com/llvm/llvm-project/commit/4424c44c8c4ec8e071f5c5999fba216d36fb92c9) and [8ad9e1e](https://github.com/llvm/llvm-project/commit/8ad9e1ecb7e565c2f99b4ef67517d1f37d1c80d0). http

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-28 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > Commented on the commit but I'm not sure if that sends notifications. I saw it, thanks - I'll likely update the tests afterwards, though for now I'm keeping an eye on the bots/merge to make sure things turn/stay green. https://github.com/llvm/llvm-project/pull/110102 ___

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2025-01-10 Thread Stephen Tozer via cfe-commits
@@ -412,6 +412,20 @@ New Compiler Flags only for thread-local variables, and none (which corresponds to the existing ``-fno-c++-static-destructors`` flag) skips all static destructors registration. +- The ``-fextend-variable-liveness`` flag has been added to allow for imp

[clang] [Clang] Add fake use emission to Clang with -fextend-lifetimes (PR #110102)

2025-01-09 Thread Stephen Tozer via cfe-commits
SLTozer wrote: Post-holiday ping; I think all the outstanding comments have been addressed, with some minor changes since the last round of review - primarily referencing the new CodeGenOpts settings, and removing the O0-related logic. https://github.com/llvm/llvm-project/pull/110102 _

[clang] [llvm] IR: Make llvm.fake.use a DefaultAttrsIntrinsic (PR #131743)

2025-03-18 Thread Stephen Tozer via cfe-commits
@@ -113,6 +113,8 @@ static void substituteOperandWithArgument(Function *OldF, for (Use *Op : OpsToReplace) UniqueValues.insert(Op->get()); + // TODO: Preserve range metadata with ranges + SLTozer wrote: Unrelated change sneaking in? https://github.com

[clang] [llvm] IR: Make llvm.fake.use a DefaultAttrsIntrinsic (PR #131743)

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

[clang] [llvm] IR: Make llvm.fake.use a DefaultAttrsIntrinsic (PR #131743)

2025-03-18 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer approved this pull request. Some minor comments, LGTM once addressed. https://github.com/llvm/llvm-project/pull/131743 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [llvm] IR: Make llvm.fake.use a DefaultAttrsIntrinsic (PR #131743)

2025-03-18 Thread Stephen Tozer via cfe-commits
@@ -1837,13 +1837,13 @@ attributes #2 = { nounwind "target-cpu"="tahiti" } !llvm.module.flags = !{!0} !0 = !{i32 1, !"amdhsa_code_object_version", i32 500} ;. -; HSA: attributes #[[ATTR0:[0-9]+]] = { nounwind } +; HSA: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync n

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

2025-04-11 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > IIRC, there are still some open review threads in this PR, mainly related to > reducing duplication in the symbolication bits. Yes, this part won't land quite yet; as I'm kicking these reviews back into action, I'll be pushing up some other reviews to come before this one in t

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

2025-04-17 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/107279 >From 55115af37710a80abbc2ec2ca5d96d1eea5827b4 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 4 Sep 2024 12:23:52 +0100 Subject: [PATCH 1/4] Add conditionally-enabled DebugLocKinds --- clang/lib/CodeG

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-04-17 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/118026 >From c0369e1b36594d5d6f6c29d7ebb7319d79edf55b Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Thu, 28 Nov 2024 13:53:20 + Subject: [PATCH 1/2] Enable -fextend-lifetimes at -Og --- clang/docs/CommandGui

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-04-17 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/118026 ___ 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)

2025-04-17 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/107279 >From 55115af37710a80abbc2ec2ca5d96d1eea5827b4 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 4 Sep 2024 12:23:52 +0100 Subject: [PATCH 1/3] Add conditionally-enabled DebugLocKinds --- clang/lib/CodeG

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-04-23 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > Any ideas why we might be hitting this issue? This happens during a built > with `-Og`, and issue does not remove if I remove `-Og` flag. At a glance that looks like it could be related, we generate (no-op) cleanup as part of -fextend-variable-liveness. I'll look into this, bu

[clang] [Clang][CodeGen] Emit fake uses before musttail calls (PR #136867)

2025-04-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/136867 >From 90c09c8326077a1ba6797519bbefd014f32b5beb Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 23 Apr 2025 14:24:50 +0100 Subject: [PATCH 1/3] [Clang] Emit Fake Uses before musttail calls Fixes the issu

[clang] fdbf073 - Revert "[DLCov] Implement DebugLoc coverage tracking (#107279)"

2025-04-24 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2025-04-25T00:36:28+01:00 New Revision: fdbf073a86573c9ac4d595fac8e06d252ce1469f URL: https://github.com/llvm/llvm-project/commit/fdbf073a86573c9ac4d595fac8e06d252ce1469f DIFF: https://github.com/llvm/llvm-project/commit/fdbf073a86573c9ac4d595fac8e06d252ce1469f.diff

[clang] 92195f6 - Reapply "[DLCov] Implement DebugLoc coverage tracking (#107279)"

2025-04-30 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2025-04-30T11:39:29+01:00 New Revision: 92195f6fc873cd27a5aa0852252dfe44ccdc6ea0 URL: https://github.com/llvm/llvm-project/commit/92195f6fc873cd27a5aa0852252dfe44ccdc6ea0 DIFF: https://github.com/llvm/llvm-project/commit/92195f6fc873cd27a5aa0852252dfe44ccdc6ea0.diff

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

2025-04-17 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > It would be great to also have some documentation that shows step by step how > you've used these abilities to find the bugs you've found. SGTM - I think that should come in a separate patch. I have a branch with all my changes on it (not stable, I rebase semi-regularly) [her

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-04-17 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > Is this ready to go? I can't recall if we ultimately accepted the RFC. My interpretation of the RFC is that there was a general acceptance of `-Og = -O1 + -fextend-variable-liveness`, so with the acceptance here I believe this is ready! https://github.com/llvm/llvm-project/pu

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-04-17 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/118026 >From 351971bbff4e77b0f36cd92cd1a881584d17a9e7 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Thu, 28 Nov 2024 13:53:20 + Subject: [PATCH 1/2] Enable -fextend-lifetimes at -Og --- clang/docs/CommandGui

[clang] [Clang][CodeGen] Emit fake uses before musttail calls (PR #136867)

2025-04-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/136867 >From 90c09c8326077a1ba6797519bbefd014f32b5beb Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 23 Apr 2025 14:24:50 +0100 Subject: [PATCH 1/2] [Clang] Emit Fake Uses before musttail calls Fixes the issu

[clang] [Clang][CodeGen] Emit fake uses before musttail calls (PR #136867)

2025-04-25 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/136867 >From 90c09c8326077a1ba6797519bbefd014f32b5beb Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 23 Apr 2025 14:24:50 +0100 Subject: [PATCH 1/4] [Clang] Emit Fake Uses before musttail calls Fixes the issu

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-04-25 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > I did some downstream testing with "-Og" since this patch and noticed that > e.g. Thanks for catching these - in terms of legalizer support it looks like everything relevant is implemented except for `SoftenFloatOperand`, so that should be a straightforward fix. The target-sp

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

2025-04-23 Thread Stephen Tozer via cfe-commits
@@ -169,6 +169,47 @@ See the discussion in the section about :ref:`merging locations` for examples of when the rule for dropping locations applies. +.. _NewInstLocations: + +Setting locations for new instructions +-- + +Whenever a new instru

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

2025-04-24 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > Hi, I believe this merge is breaking external projects because you added > `#include "llvm/Config/config.h"` which is not available (see comments at the > top of that file). Reverted for now, will look into relanding without the inclusion issue later. https://github.com/llvm/

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

2025-04-24 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/107279 >From 55115af37710a80abbc2ec2ca5d96d1eea5827b4 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 4 Sep 2024 12:23:52 +0100 Subject: [PATCH 1/6] Add conditionally-enabled DebugLocKinds --- clang/lib/CodeG

[clang] 2dc6e98 - Revert "[Clang] Enable -fextend-lifetimes at -Og (#118026)"

2025-04-25 Thread Stephen Tozer via cfe-commits
Author: Stephen Tozer Date: 2025-04-25T12:55:10+01:00 New Revision: 2dc6e98169baeb1f73036da0ea50fd828d8323d0 URL: https://github.com/llvm/llvm-project/commit/2dc6e98169baeb1f73036da0ea50fd828d8323d0 DIFF: https://github.com/llvm/llvm-project/commit/2dc6e98169baeb1f73036da0ea50fd828d8323d0.diff

[clang] [Clang][CodeGen] Emit fake uses before musttail calls (PR #136867)

2025-04-25 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer closed https://github.com/llvm/llvm-project/pull/136867 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   >