[llvm] Add a pass to collect dropped var statistics for MIR (PR #126686)

Shubham Sandeep Rastogi via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 11:32:15 PST 2025


================
@@ -91,7 +96,15 @@ bool MachineFunctionPass::runOnFunction(Function &F) {
 
   MFProps.reset(ClearedProperties);
 
-  bool RV = runOnMachineFunction(MF);
+  bool RV;
+  if (DroppedVarStatsMIR) {
+    auto PassName = getPassName();
+    DroppedVarStatsMF.runBeforePass(PassName, &MF);
+    RV = runOnMachineFunction(MF);
+    DroppedVarStatsMF.runAfterPass(PassName, &MF);
----------------
rastogishubham wrote:

@nikic is the patch good to be upstreamed?

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


More information about the llvm-commits mailing list