[llvm-commits] [llvm] r162227 - /llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Aug 20 14:05:58 PDT 2012

Author: stoklund
Date: Mon Aug 20 16:05:58 2012
New Revision: 162227

URL: http://llvm.org/viewvc/llvm-project?rev=162227&view=rev
Clarify that duplicate edges are not allowed in the Machine CFG.

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.


Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=162227&r1=162226&r2=162227&view=diff
--- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Mon Aug 20 16:05:58 2012
@@ -351,6 +351,8 @@
   /// 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

More information about the llvm-commits mailing list