Page MenuHomePhabricator

chrisjackson (Chris Jackson)
User

Projects

User does not belong to any projects.

User Details

User Since
Feb 15 2018, 9:11 AM (266 w, 10 h)

Recent Activity

Feb 13 2023

chrisjackson committed rG96267b6b8840: [mlir] Add Float8E5M2FNUZ and Float8E4M3FNUZ types to MLIR (authored by jakeh-gc).
[mlir] Add Float8E5M2FNUZ and Float8E4M3FNUZ types to MLIR
Feb 13 2023, 10:27 AM · Restricted Project, Restricted Project
chrisjackson closed D143744: Add Float8E5M2FNUZ and Float8E4M3FNUZ types to MLIR.
Feb 13 2023, 10:26 AM · Restricted Project, Restricted Project

Sep 15 2022

chrisjackson added a comment to D133310: [Assignment Tracking][15/*] Account for assignment tracking in simplifycfg.

Thanks for taking a look

Sep 15 2022, 7:04 AM · Restricted Project, Restricted Project, debug-info
chrisjackson added a comment to D133310: [Assignment Tracking][15/*] Account for assignment tracking in simplifycfg.

Just a couple of typos.

Sep 15 2022, 6:31 AM · Restricted Project, Restricted Project, debug-info
chrisjackson added a comment to D133307: [Assignment Tracking][14/*] Account for assignment tracking in instcombine.

A typo and a couple of nitish suggestions.

Sep 15 2022, 6:26 AM · Restricted Project, Restricted Project, debug-info

Sep 10 2022

chrisjackson added inline comments to D133321: [Assignment Tracking][24/*] Always RemoveRedundantDbgInstrs in instcombine in assignment tracking builds.
Sep 10 2022, 8:58 AM · Restricted Project, Restricted Project, debug-info
chrisjackson added inline comments to D132224: [Assignment Tracking][5/*] Add core infrastructure for instruction reference.
Sep 10 2022, 8:36 AM · Restricted Project, debug-info, Restricted Project

Aug 12 2022

chrisjackson added a comment to D129636: Fix a LSR debug invariance issue.

Did you consider that forgetValue in fact does not only forget the value you are aiming, but also all its users recursively? Not SCEV users (they likely don't exist), but instruction users.

Ah, that rather sounds like a blocker -- if there's no way to limit what's forgotten to "just the things unique to this Value", it's going to be impossible to peel apart "what was important to debug-info" and "what was important to codegen". A quick look at the SCEV methods suggests that plumbing in an argument flag is going to be pretty invasive, ScalarEvolution::getSCEV fans out to a lot of functions with a lot of logic.

Stephen wrote:

Though I'm also surprised that just adding something to the cache is modifying the output

I imagine you might find a different way expanding expressions for Values, depending on which PHIs you look at first, which changes if you look at the dbg.values first.

The best alternative I can suggest is to create a new ScalarEvolution instance and use it for dbg value queries. It should be good enough if the only purpose of that is to find undefs.

I'm in two minds about this -- it solves all the problems raised (obviously), on the other hand I imagine it doubles the amount of work done, which isn't ideal. However, I think the reason why we're using ScalarEvolution in this way is because all the PHIs might get replaced during loop-strength-reduction, and we need to use ScalarEvolution's map of old-to-new PHIs to reconstruct the dbg.values operands -- is that right @chrisjackson ?

Aug 12 2022, 1:11 AM · debug-info, Restricted Project, Restricted Project

Aug 11 2022

chrisjackson added a comment to D129636: Fix a LSR debug invariance issue.

The best alternative I can suggest is to create a new ScalarEvolution instance and use it for dbg value queries. It should be good enough if the only purpose of that is to find undefs.

That does sound like a very tempting alternative to be sure that these sort of issues do not crop up again. Not sure if it is possible though (@chrisjackson?)

Aug 11 2022, 3:16 AM · debug-info, Restricted Project, Restricted Project
chrisjackson added a comment to D129636: Fix a LSR debug invariance issue.

Did you consider that forgetValue in fact does not only forget the value you are aiming, but also all its users recursively? Not SCEV users (they likely don't exist), but instruction users.

Imagine that some of the users had no-wrap flags inferred from other queries. Now you forget it, and the flags get lost. Won't this introruce a similar issue in another place? It may also affect some loops into which these values are involved.

Generally, exposing API about existing SCEVs isn't a great idea, and I don't see enough justification in your case.

The best alternative I can suggest is to create a new ScalarEvolution instance and use it for dbg value queries. It should be good enough if the only purpose of that is to find undefs.

Anyways, why do you need SCEV at all to find undefs? Can we instead traverse through instructions and get rid of SCEV query at all?

Aug 11 2022, 3:06 AM · debug-info, Restricted Project, Restricted Project

Aug 9 2022

chrisjackson accepted D129636: Fix a LSR debug invariance issue.

I think this is a succinct solution and I don't perceive a problem with exposing the extra SCEV method, as I've done something similar myself in the past, as mentioned above. I would like to see a comment explaining the need to call forget(), otherwise lgtm.

Aug 9 2022, 4:50 AM · debug-info, Restricted Project, Restricted Project

Aug 5 2022

chrisjackson added a comment to D129636: Fix a LSR debug invariance issue.

I think I am missing some context here, but this looks a bit suspicious. I am not sure if exposing and checking whether a SCEV exists is the right way to go.

IIUC the main issue seems to be that we try to create SCEVs for all dbg intrinsics? Would it be possible to instead only get SCEV expressions for values we really need (that/s the induction variable I assume, for which there already should be SCEV expression)?

It is necessary to obtain SCEVs for all the values used in dbg.value within the loop, as LSR may optimise out these values and these are salvaged by generating a DWARF expression from the SCEV expression. For further explanation see:
D105207 and the EuroLLVM2022 talk on the method here :SCEV-Based debuginfo salvaging in Loop Strength Reduction.

Right, but wouldn't it be sufficient to collect all expressions LSR optimizes? For those, it will already have created SCEV expressions for. This might be more difficult, but I am wondering if it would be feasible at least in theory.

Aug 5 2022, 4:46 AM · debug-info, Restricted Project, Restricted Project

Aug 4 2022

chrisjackson added a comment to D129636: Fix a LSR debug invariance issue.

I think I am missing some context here, but this looks a bit suspicious. I am not sure if exposing and checking whether a SCEV exists is the right way to go.

IIUC the main issue seems to be that we try to create SCEVs for all dbg intrinsics? Would it be possible to instead only get SCEV expressions for values we really need (that/s the induction variable I assume, for which there already should be SCEV expression)?

Aug 4 2022, 2:37 AM · debug-info, Restricted Project, Restricted Project

Aug 3 2022

chrisjackson added a comment to D129636: Fix a LSR debug invariance issue.

Not sure if this ended up so well as it appears that getExistingSCEV was a private method and I am uncertain if we can or should make it public. Either way if we decide to go this route then we probably should add explicit tests for this part as well (i.e. to make sure that the forgetting of SCEV does not produce another invariance issue).

Aug 3 2022, 8:36 AM · debug-info, Restricted Project, Restricted Project
chrisjackson added a comment to D129636: Fix a LSR debug invariance issue.

I'm looking at the forgetValue() implementation. I think that as long as the SCEV for the value is preserved and accessable in SalvageDVI() then all is well in terms of the salvaging method.

Right, I think that forgetting a SCEV does not invalidate the SCEV itself it is just that if we were to ask for it again then we would get a new object (that would still be equivalent though not the same object pointer wise).

Thanks for hunting this down, caching layers affecting codegen sounds hard to debug.

I'm no SCEV expert, so a couple of possibly obvious questions:

  • Is it safe to store the SCEV* for a Value that's then forgotten?
  • Is there a risk that the presence of debug-info will now cause a SCEV to be forgotten that _should_ have been remembered, because of unconditionally forgetting a SCEV if it's used by debug-info?

I think the second point is the crux here. Perhaps there is a way to test if the SCEV already exists, then call forget conditionally.

A few comments up I wrote which I think does what you are requesting

For the second point maybe ScalarEvolution::getExistingSCEV() could be used to see if this SCEV existed before analyzing the dbg.value or not so that we don't end up forgetting about values that we would not forget about hadn't it been for the dbg.value.

If that makes sense I will update the patch.

Aug 3 2022, 4:48 AM · debug-info, Restricted Project, Restricted Project
chrisjackson added a comment to D129636: Fix a LSR debug invariance issue.

I'm looking at the forgetValue() implementation. I think that as long as the SCEV for the value is preserved and accessable in SalvageDVI() then all is well in terms of the salvaging method.

Aug 3 2022, 4:12 AM · debug-info, Restricted Project, Restricted Project
chrisjackson added a comment to D129636: Fix a LSR debug invariance issue.

I'd still like to get some feedback from the author of the LSR debug salvaging (@chrisjackson) before proceeding as at the moment it is a bit unclear if it actually is safe to do a SE.forgetValue() here.

Aug 3 2022, 3:01 AM · debug-info, Restricted Project, Restricted Project

May 3 2022

chrisjackson committed rG0c8c05064d57: [llvm-ar] Modify usage printouts to use the correct toolname (authored by chrisjackson).
[llvm-ar] Modify usage printouts to use the correct toolname
May 3 2022, 9:45 AM · Restricted Project, Restricted Project
chrisjackson closed D124445: [llvm-ar] Modify usage printouts to use the correct toolname.
May 3 2022, 9:45 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D124445: [llvm-ar] Modify usage printouts to use the correct toolname.
May 3 2022, 8:18 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D124445: [llvm-ar] Modify usage printouts to use the correct toolname.

Address reviewer comments by adding a clarification in the llvm-ar tool-name test.

May 3 2022, 7:08 AM · Restricted Project, Restricted Project

Apr 29 2022

chrisjackson added inline comments to D124445: [llvm-ar] Modify usage printouts to use the correct toolname.
Apr 29 2022, 1:26 AM · Restricted Project, Restricted Project

Apr 28 2022

chrisjackson committed rGc792884589b8: [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2] (authored by chrisjackson).
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]
Apr 28 2022, 6:23 AM · Restricted Project, Restricted Project
chrisjackson added a reverting change for rG3f2b76ec90b5: [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]: rGcd5f9efc4da6: Revert "[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]".
Apr 28 2022, 6:08 AM · Restricted Project, Restricted Project
chrisjackson committed rGcd5f9efc4da6: Revert "[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]" (authored by chrisjackson).
Revert "[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]"
Apr 28 2022, 6:08 AM · Restricted Project, Restricted Project
chrisjackson added a reverting change for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2]: rGcd5f9efc4da6: Revert "[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]".
Apr 28 2022, 6:07 AM · Restricted Project, Restricted Project
chrisjackson committed rG3f2b76ec90b5: [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2] (authored by chrisjackson).
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]
Apr 28 2022, 5:57 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
  • Add managed DVIRecoveryRecords to address memory leak
Apr 28 2022, 4:48 AM · Restricted Project, Restricted Project
chrisjackson added inline comments to D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Apr 28 2022, 3:15 AM · Restricted Project, Restricted Project

Apr 27 2022

chrisjackson added inline comments to D124445: [llvm-ar] Modify usage printouts to use the correct toolname.
Apr 27 2022, 9:47 AM · Restricted Project, Restricted Project
chrisjackson added inline comments to D124445: [llvm-ar] Modify usage printouts to use the correct toolname.
Apr 27 2022, 9:25 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D124445: [llvm-ar] Modify usage printouts to use the correct toolname.

Respond to reviewer comments:

  • Add missed llvm-ranlib/tool-name.test update
  • Make ranlib printout consistent with ar
  • Make toolname pattern check more strict
Apr 27 2022, 9:24 AM · Restricted Project, Restricted Project
chrisjackson committed rG74273d575f99: [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2] (authored by chrisjackson).
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]
Apr 27 2022, 5:12 AM · Restricted Project, Restricted Project
chrisjackson added a reverting change for rG8f550368b169: [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]: rG855752e563ec: Revert [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics[2/2].
Apr 27 2022, 5:07 AM · Restricted Project, Restricted Project
chrisjackson committed rG855752e563ec: Revert [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics[2/2] (authored by chrisjackson).
Revert [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics[2/2]
Apr 27 2022, 5:07 AM · Restricted Project, Restricted Project
chrisjackson added a reverting change for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2]: rG855752e563ec: Revert [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics[2/2].
Apr 27 2022, 5:07 AM · Restricted Project, Restricted Project
chrisjackson committed rG8f550368b169: [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2] (authored by chrisjackson).
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]
Apr 27 2022, 4:50 AM · Restricted Project, Restricted Project
chrisjackson closed D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Apr 27 2022, 4:50 AM · Restricted Project, Restricted Project
chrisjackson committed rGc45e4c140f98: [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [1/2] [NFC] (authored by chrisjackson).
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [1/2] [NFC]
Apr 27 2022, 3:46 AM · Restricted Project, Restricted Project
chrisjackson closed D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Apr 27 2022, 3:45 AM · Restricted Project, Restricted Project, debug-info

Apr 26 2022

chrisjackson added a comment to D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Note that this patch also fixes Issue #55097.

Apr 26 2022, 4:45 AM · Restricted Project, Restricted Project
chrisjackson updated the summary of D124445: [llvm-ar] Modify usage printouts to use the correct toolname.
Apr 26 2022, 4:38 AM · Restricted Project, Restricted Project
chrisjackson added reviewers for D124445: [llvm-ar] Modify usage printouts to use the correct toolname: JanekvO, akuran.
Apr 26 2022, 4:33 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D124445: [llvm-ar] Modify usage printouts to use the correct toolname.
Apr 26 2022, 4:28 AM · Restricted Project, Restricted Project
chrisjackson added reviewers for D124445: [llvm-ar] Modify usage printouts to use the correct toolname: gbreynoo, rupprecht, jhenderson.
Apr 26 2022, 4:26 AM · Restricted Project, Restricted Project
chrisjackson updated the summary of D124445: [llvm-ar] Modify usage printouts to use the correct toolname.
Apr 26 2022, 4:20 AM · Restricted Project, Restricted Project
chrisjackson requested review of D124445: [llvm-ar] Modify usage printouts to use the correct toolname.
Apr 26 2022, 4:20 AM · Restricted Project, Restricted Project

Apr 20 2022

chrisjackson added inline comments to D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Apr 20 2022, 12:16 PM · Restricted Project, Restricted Project
chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Made corrections to UpdateDbgValueInst() using @StephenTozer 's help.

Apr 20 2022, 12:15 PM · Restricted Project, Restricted Project
chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Removed old comments, clarified messages in some asserts. Added some comments to methods.

Apr 20 2022, 2:56 AM · Restricted Project, Restricted Project

Apr 19 2022

chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Correct diff update file.

Apr 19 2022, 8:27 AM · Restricted Project, Restricted Project
chrisjackson added inline comments to D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Apr 19 2022, 8:22 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Attempt to correct the final overwrite of the dbg.value, based on the count of DW_OP_llvm_arg operands in the expression.

Apr 19 2022, 8:22 AM · Restricted Project, Restricted Project

Apr 6 2022

chrisjackson added inline comments to D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Apr 6 2022, 5:00 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Respond to the very helpful review from @StephenTozer. Includes:

  • SCEVDbgValueBuilder.appendToVectors() now merges location vectors, preventing duplicates
  • Improved check for when a shorter DIExpression can be emitted
  • Use isComplex() instead of the size of the expression vector
Apr 6 2022, 4:59 AM · Restricted Project, Restricted Project

Mar 29 2022

chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Update some variable names and a couple of comments to improve readability.

Mar 29 2022, 5:10 AM · Restricted Project, Restricted Project

Mar 25 2022

chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Change remaining Densemap (for updated location-op indexes) to a SmallVector.

Mar 25 2022, 5:42 AM · Restricted Project, Restricted Project

Mar 22 2022

chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Mar 22 2022, 7:40 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Apply @djtodoro 's change and clang-format.

Mar 22 2022, 5:12 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Mostly refactoring of the functions that write the final salvage dbg.value. Some small corrections after a Clang-3.4 build caught a couple of corner cases (it builds fine now).

Mar 22 2022, 2:37 AM · Restricted Project, Restricted Project

Mar 21 2022

chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

A WIP update only, not ready for a re-review. Incorporated some of @StephenTozer 's suggestions e.g.

Mar 21 2022, 1:54 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D105207: [debuginfo][lsr] SCEV-based salvaging for LoopStrengthReduction.

Restored diff. I accidentally updated this diff with a file intended for a separate issue.

Mar 21 2022, 1:49 AM · Restricted Project, debug-info, Restricted Project
chrisjackson updated the diff for D105207: [debuginfo][lsr] SCEV-based salvaging for LoopStrengthReduction.

-EDIT-
Diff changed in error.

Mar 21 2022, 1:43 AM · Restricted Project, debug-info, Restricted Project

Mar 10 2022

chrisjackson updated the diff for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Add check for empty arglist that was missing from check for nullptr arglist member

Mar 10 2022, 7:40 AM · Restricted Project, Restricted Project, debug-info
chrisjackson retitled D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC] from [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] to [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Mar 10 2022, 6:17 AM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the diff for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Restore the the old behaviour for transforming DIArglist location arguments to single- location op:. When trying to determine the type of an undef Value that has become a nullptr, simply abandon the salvage attempt. This restores the NFC status of this patch.

Mar 10 2022, 6:17 AM · Restricted Project, Restricted Project, debug-info

Mar 9 2022

chrisjackson added inline comments to D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Mar 9 2022, 2:11 PM · Restricted Project, Restricted Project
chrisjackson added a comment to D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Reinstate the check for dbg.value that LSR has changed from single location-op to multi location-op. When LSR makes this change, the single location argument is changed to a DIArglist. This patch now replaces the DIArglist with a single 'undef'. This will prevent the generation of invalid dbg.value that were causing the crash as reported by @Orlando .

If that change makes the patch not-NFC, please could you add a test for this and mention it in the commit message? Lastly, please can you appease the clang-format bot?

Mar 9 2022, 1:40 PM · Restricted Project, Restricted Project, debug-info

Mar 8 2022

chrisjackson added a comment to D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Thanks @StephenTozer , these are really helpful. I will be able to address them once patch [1/2] is done, which shouldn't be much longer, so hopefully I can address your comments at the end of the week.

Mar 8 2022, 1:58 AM · Restricted Project, Restricted Project

Mar 7 2022

chrisjackson updated the diff for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Remove accidental double application of dbg.value expression restoration.

Mar 7 2022, 7:44 AM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the diff for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Reinstate the check for dbg.value that LSR has changed from single location-op to multi location-op. When LSR makes this change, the single location argument is changed to a DIArglist. This patch now replaces the DIArglist with a single 'undef'. This will prevent the generation of invalid dbg.value that were causing the crash as reported by @Orlando .

Mar 7 2022, 7:00 AM · Restricted Project, Restricted Project, debug-info
chrisjackson added a comment to D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

The change SGTM but I found a reproducer that causes clang to crash when this patch is applied:

$ cat reduce.cpp
#include <utility>
template <typename a> class Vec {
public:
  void push(a);
};
void d(int argc, char **argv) {
  Vec<std::pair<char *, unsigned>> e;
  for (int f = 0;;)
    for (; f < argc; ++f)
      e.push(std::make_pair(argv[f], f));
}

$ clang++  -O2 -g reduce.cpp

/home/och/dev/llvm/llvm-project/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h:139: llvm::DbgValueLoc::DbgValueLoc(const llvm::DIExpression*, llvm::ArrayRef<llvm::DbgValueLocEntry>, bool): Assertion `Expr && Expr->isValid() && is_contained(Expr->getElements(), dwarf::DW_OP_stack_value)' failed.
...
Mar 7 2022, 5:59 AM · Restricted Project, Restricted Project, debug-info

Mar 6 2022

chrisjackson updated the diff for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Removed the naive code to check and add dwarf::DW_OP_stack_value in UpdateDbgValueInst() following @Orlando 's helpful advice and reverted to using DIExpression::prependOpcodes().

Mar 6 2022, 9:08 AM · Restricted Project, Restricted Project, debug-info

Mar 4 2022

chrisjackson added a comment to D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

I can clarify the comment. It's my understanding that non-empty DIExpressions must have a DW_OP_stack_value terminator. The expressions generated by the SCEVDbgValueBuilder objects do not have these terminators (as the expressions may be inserted into other expressions). If the pre-LSR expression was empty, once the complete salvaging expression has been generated, then the terminator must be appended.

My main confusion was in why the addition of stack_value was necessary in the patch but wasn't added before. I'd missed that you were previously using prependOpcodes with param stackValue=true, but are now adding the opcode yourself. And I agree that adding a stack_value is correct in this instance because you're generating implicit locations (though I think "non-empty DIExpressions must have a DW_OP_stack_value terminator" is not true in general?). In any case, sorry for the protracted review as a result of my misunderstanding!

prependOpcodes also accounts for inserting a stack_value opcode before fragment opcodes, which your implementation doesn't appear to handle. Would it be possible to rearrange the code to use prependOpcodes so that all cases are accounted for?

Mar 4 2022, 1:28 PM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the diff for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Attempt to make UpdateDbgValueInst() more clear when adding the DW_OP_stack_value terminator.

Mar 4 2022, 8:43 AM · Restricted Project, Restricted Project, debug-info

Mar 3 2022

chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Mar 3 2022, 3:32 AM · Restricted Project, Restricted Project

Mar 2 2022

chrisjackson updated the diff for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Correction to failed function renaming.

Mar 2 2022, 9:38 AM · Restricted Project, Restricted Project, debug-info
chrisjackson retitled D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC] from [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [1/2] to [Debuginfo][LSR][NFC] Add support for salvaging variadic dbg.value intrinsics [1/2] .
Mar 2 2022, 7:33 AM · Restricted Project, Restricted Project, debug-info
chrisjackson added a comment to D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

I don't think there are "rules" about tagging patches as NFC (just put NFC somewhere in the title). It's definitely helpful to be able to see at a glance though - two examples: if an NFC patch is causing changes in output there's a bug, and if a patch is NFC it probably doesn't need any tests.

Nearly ready to approve but I'm still stuck on one thing (sorry if I'm just missing something obvious!).

Mar 2 2022, 5:02 AM · Restricted Project, Restricted Project, debug-info

Mar 1 2022

chrisjackson updated the diff for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Responded to review from @Orlando (Thanks!).

Mar 1 2022, 10:04 AM · Restricted Project, Restricted Project, debug-info

Feb 25 2022

chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 25 2022, 3:37 AM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the summary of D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Feb 25 2022, 3:37 AM · Restricted Project, Restricted Project
chrisjackson added a reviewer for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC]: Orlando.
Feb 25 2022, 3:35 AM · Restricted Project, Restricted Project, debug-info

Feb 23 2022

chrisjackson added inline comments to D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Feb 23 2022, 5:35 AM · Restricted Project, Restricted Project
chrisjackson updated the diff for D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].

Removed unnecessary lit test contents as per review comments.
Fixed a comment typo in ScalarEvolution.h.

Feb 23 2022, 5:33 AM · Restricted Project, Restricted Project

Feb 22 2022

chrisjackson abandoned D90418: [debuginfo] Vectorizing a loop doesn't terminate all vectorized variable locations.
Feb 22 2022, 1:28 AM · debug-info, Restricted Project

Feb 21 2022

chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 21 2022, 3:20 AM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 21 2022, 3:20 AM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the summary of D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Feb 21 2022, 2:56 AM · Restricted Project, Restricted Project
chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 21 2022, 2:49 AM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 21 2022, 2:47 AM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 21 2022, 2:46 AM · Restricted Project, Restricted Project, debug-info

Feb 19 2022

chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 19 2022, 2:45 PM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 19 2022, 1:26 PM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 19 2022, 1:25 PM · Restricted Project, Restricted Project, debug-info
chrisjackson updated the summary of D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Feb 19 2022, 1:17 AM · Restricted Project, Restricted Project
chrisjackson updated the summary of D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Feb 19 2022, 1:14 AM · Restricted Project, Restricted Project
chrisjackson updated the summary of D120169: [Debuginfo][LSR} Add support for salvaging variadic dbg.value intrinsics [2/2].
Feb 19 2022, 1:11 AM · Restricted Project, Restricted Project
chrisjackson updated the summary of D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].
Feb 19 2022, 1:05 AM · Restricted Project, Restricted Project, debug-info

Feb 18 2022

chrisjackson updated the diff for D120168: [Debuginfo][LSR] Add support for salvaging variadic dbg.value intrinsics [1/2] [NFC].

Applied clang-format.

Feb 18 2022, 4:22 PM · Restricted Project, Restricted Project, debug-info