[llvm] [RemoveDIs] Read/write DbgRecords directly from/to bitcode (PR #83251)
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 4 10:10:27 PST 2024
================
@@ -261,33 +269,39 @@ static UseListOrderStack predictUseListOrder(const Module &M) {
// constants in the last Function they're used in. Module-level constants
// have already been visited above.
for (const Function &F : llvm::reverse(M)) {
+ auto PredictValueOrderFromMetadata = [&](Metadata *MD) {
+ if (const auto *VAM = dyn_cast<ValueAsMetadata>(MD)) {
+ predictValueUseListOrder(VAM->getValue(), &F, OM, Stack);
+ } else if (const auto *AL = dyn_cast<DIArgList>(MD)) {
+ for (const auto *VAM : AL->getArgs())
+ predictValueUseListOrder(VAM->getValue(), &F, OM, Stack);
+ }
+ };
----------------
jmorse wrote:
Could you elaborate on why this is needed -- as we have our own use-list situation for RemoveDIs, and debug-info has never appeared in normal Value use-lists, is this needed?
https://github.com/llvm/llvm-project/pull/83251
More information about the llvm-commits
mailing list