Skip to content

[llvm-reduce][DebugInfo] Support reducing non-instruction debug-info #78995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

jmorse
Copy link
Member

@jmorse jmorse commented Jan 22, 2024

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.

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.
@jmorse jmorse requested review from ormris, SLTozer and OCHyams January 22, 2024 15:32
Copy link

github-actions bot commented Jan 22, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 535b197b8e96b816998ad4b4ee45e011fa05fba9 443b957ec353d4c238157d4ca13fd63ad064ce9e -- llvm/tools/llvm-reduce/deltas/ReduceDPValues.cpp llvm/tools/llvm-reduce/deltas/ReduceDPValues.h llvm/tools/llvm-reduce/DeltaManager.cpp llvm/tools/llvm-reduce/llvm-reduce.cpp
View the diff from clang-format here.
diff --git a/llvm/tools/llvm-reduce/DeltaManager.cpp b/llvm/tools/llvm-reduce/DeltaManager.cpp
index 56e39b8f93..bcbcbea891 100644
--- a/llvm/tools/llvm-reduce/DeltaManager.cpp
+++ b/llvm/tools/llvm-reduce/DeltaManager.cpp
@@ -112,7 +112,7 @@ static cl::list<std::string>
     DELTA_PASS("atomic-ordering", reduceAtomicOrderingDeltaPass)               \
     DELTA_PASS("syncscopes", reduceAtomicSyncScopesDeltaPass)                  \
     DELTA_PASS("instruction-flags", reduceInstructionFlagsDeltaPass)           \
-} while (false)
+  } while (false)
 
 #define DELTA_PASSES_MIR                                                       \
   do {                                                                         \

Copy link
Contributor

@OCHyams OCHyams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jmorse jmorse merged commit 40bdfd3 into llvm:main Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants