[llvm] [RemoveDIs] Read/write DbgRecords directly from/to bitcode (PR #83251)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 14:21:48 PDT 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:

Keeping things in-sync makes sense to me; avoids any unexpected differences.

https://github.com/llvm/llvm-project/pull/83251


More information about the llvm-commits mailing list