Fix an obvious omission in the SelectionDAGBuilder where we were
authorChandler Carruth <chandlerc@gmail.com>
Tue, 22 Nov 2011 11:37:46 +0000 (11:37 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 22 Nov 2011 11:37:46 +0000 (11:37 +0000)
dropping weights on the floor for invokes. This was impeding my writing
further test cases for invoke when interacting with probabilities and
block placement.

No test case as there doesn't appear to be a way to test this stuff. =/
Suggestions for a test case of course welcome. I hope to be able to add
test cases that indirectly cover this eventually by adding probabilities
to the exceptional edge and reordering blocks as a result.

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

lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index 961725cb9dd29317be2e3e570172d15fa52b1260..8d02350b6f9b0f9354fb84c1f63c7123966c5a5d 100644 (file)
@@ -1810,8 +1810,8 @@ void SelectionDAGBuilder::visitInvoke(const InvokeInst &I) {
   CopyToExportRegsIfNeeded(&I);
 
   // Update successor info
-  InvokeMBB->addSuccessor(Return);
-  InvokeMBB->addSuccessor(LandingPad);
+  addSuccessorWithWeight(InvokeMBB, Return);
+  addSuccessorWithWeight(InvokeMBB, LandingPad);
 
   // Drop into normal successor.
   DAG.setRoot(DAG.getNode(ISD::BR, getCurDebugLoc(),