[PATCH] D30128: [LazyMachineBFI] Reimplement with getAnalysisIfAvailable

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 10:18:55 PST 2017


davidxl added a comment.

Is there a need to keep LazyBlockFrequencyInfo as a template class after this change?



================
Comment at: include/llvm/CodeGen/MachineBlockFrequencyInfo.h:41
+  /// Construct and also populate BFI.
+  MachineBlockFrequencyInfo(MachineFunction &MF,
+                            MachineBranchProbabilityInfo &MBPI,
----------------
Is there a need for this helper -- it is used only in one place. Just construct one and call calculate?


================
Comment at: lib/CodeGen/LazyMachineBlockFrequencyInfo.cpp:61
+  if (MBFI) {
+    DEBUG(dbgs() << "MachineBlockFrequencyInfo is available\n");
+    return *MBFI;
----------------
Set MBPI here too?


https://reviews.llvm.org/D30128





More information about the llvm-commits mailing list