diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2024-01-23 14:30:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 14:30:56 +0000 |
commit | 40bdfd39e394baa08fa67c5943c1b53c66c94bed (patch) | |
tree | db9fb5a84055a1e63a30960d3cba40a373c08030 /llvm/tools/llvm-reduce/llvm-reduce.cpp | |
parent | 30845e8ab46c416a2e333eb84239e9ec71e92617 (diff) | |
download | llvm-40bdfd39e394baa08fa67c5943c1b53c66c94bed.zip llvm-40bdfd39e394baa08fa67c5943c1b53c66c94bed.tar.gz llvm-40bdfd39e394baa08fa67c5943c1b53c66c94bed.tar.bz2 |
[llvm-reduce][DebugInfo] Support reducing non-instruction debug-info (#78995)
LLVM will shortly be able to represent variable locations without
encoding information into intrinsics -- they'll be stored as DPValue
objects instead. We'll still need to be able to llvm-reduce these
variable location assignments just like we can with intrinsics today,
thus, here's an llvm-reduce pass that enumerates and reduces the DPValue
objects.
The test for this is paradoxically written with dbg.value intrinsics:
this is because we're changing all the core parts of LLVM to support
this first, with the textual IR format coming last. Until that arrives,
testing the llvm-reduce'ing of DPValues needs the added test using
intrinsics. We should be able to drop the variable assignment using
%alsoloaded using this method. As with the other llvm-reduce tests, I've
got one set of check lines for making the reduction happen as desired,
and the other set to check the final output.
Diffstat (limited to 'llvm/tools/llvm-reduce/llvm-reduce.cpp')
-rw-r--r-- | llvm/tools/llvm-reduce/llvm-reduce.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/tools/llvm-reduce/llvm-reduce.cpp b/llvm/tools/llvm-reduce/llvm-reduce.cpp index bd2db63..71ce0ca5 100644 --- a/llvm/tools/llvm-reduce/llvm-reduce.cpp +++ b/llvm/tools/llvm-reduce/llvm-reduce.cpp @@ -100,6 +100,13 @@ static cl::opt<int> "of delta passes (default=5)"), cl::init(5), cl::cat(LLVMReduceOptions)); +static cl::opt<bool> TryUseNewDbgInfoFormat( + "try-experimental-debuginfo-iterators", + cl::desc("Enable debuginfo iterator positions, if they're built in"), + cl::init(false)); + +extern cl::opt<bool> UseNewDbgInfoFormat; + static codegen::RegisterCodeGenFlags CGF; /// Turn off crash debugging features @@ -143,6 +150,17 @@ int main(int Argc, char **Argv) { cl::HideUnrelatedOptions({&LLVMReduceOptions, &getColorCategory()}); cl::ParseCommandLineOptions(Argc, Argv, "LLVM automatic testcase reducer.\n"); + // RemoveDIs debug-info transition: tests may request that we /try/ to use the + // new debug-info format, if it's built in. +#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS + if (TryUseNewDbgInfoFormat) { + // If LLVM was built with support for this, turn the new debug-info format + // on. + UseNewDbgInfoFormat = true; + } +#endif + (void)TryUseNewDbgInfoFormat; + if (Argc == 1) { cl::PrintHelpMessage(); return 0; |