[llvm-commits] [llvm] r144523 - /llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h

Chandler Carruth chandlerc at gmail.com
Sun Nov 13 22:51:49 PST 2011


Author: chandlerc
Date: Mon Nov 14 00:51:49 2011
New Revision: 144523

URL: http://llvm.org/viewvc/llvm-project?rev=144523&view=rev
Log:
Add a cautionary note to this API. It was not at all obvious to me how
expensive the most useful interface to this analysis is.

Fun story -- it's also not correct. That's getting fixed in another
patch.

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h

Modified: llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h?rev=144523&r1=144522&r2=144523&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineBranchProbabilityInfo.h Mon Nov 14 00:51:49 2011
@@ -62,6 +62,9 @@
   // Return a probability as a fraction between 0 (0% probability) and
   // 1 (100% probability), however the value is never equal to 0, and can be 1
   // only iff SRC block has only one successor.
+  // NB: This routine's complexity is linear on the number of successors of
+  // Src. Querying sequentially for each successor's probability is a quadratic
+  // query pattern.
   BranchProbability getEdgeProbability(MachineBasicBlock *Src,
                                        MachineBasicBlock *Dst) const;
 





More information about the llvm-commits mailing list