Clarify that duplicate edges are not allowed in the Machine CFG.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 20 Aug 2012 21:05:58 +0000 (21:05 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 20 Aug 2012 21:05:58 +0000 (21:05 +0000)
LLVM IR has labeled duplicate CFG edges, but since Machine CFG edges
don't have labels, it doesn't make sense to allow duplicates. There is
no way of telling what the edges mean.

Duplicate CFG edges cause confusion when dealing with edge weights. It
seems that code producing duplicate CFG edges usually does the wrong
thing with edge weights.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162227 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineBasicBlock.h

index c917bd8b818393ceeae3347885f61e49ee8f775d..92d25ccf5738872deadafe79a558411a0794cd6c 100644 (file)
@@ -351,6 +351,8 @@ public:
   /// parameter is stored in Weights list and it may be used by
   /// MachineBranchProbabilityInfo analysis to calculate branch probability.
   ///
+  /// Note that duplicate Machine CFG edges are not allowed.
+  ///
   void addSuccessor(MachineBasicBlock *succ, uint32_t weight = 0);
 
   /// removeSuccessor - Remove successor from the successors list of this