llvm.org GIT mirror llvm / 3c397eb
Function::getNumBlockIDs() should be used instead of Function::size() to set the upper limit on the block IDs since basic blocks might get removed (simplified away) after being initially numbered. Plus the test case, in which SelectionDAGBuilder::visitBr() calls llvm::MachineFunction::removeFromMBBNumbering(), which introduces the hole in numbering leading to an assert in llc (prior to the fix). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133113 91177308-0d34-0410-b5e6-96231b3b80d8 Anna Zaks 9 years ago
2 changed file(s) with 82 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
3838 bool EdgeBundles::runOnMachineFunction(MachineFunction &mf) {
3939 MF = &mf;
4040 EC.clear();
41 EC.grow(2 * MF->size());
41 EC.grow(2 * MF->getNumBlockIDs());
4242
4343 for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E;
4444 ++I) {
0 ; Make sure EdgeBoundles handles the case when the function size is less then
1 ; the number of block IDs.
2 ; RUN: llc -regalloc=fast < %s
3
4 define void @WIn9UJ86JKdV4dM() nounwind {
5 entry:
6 br i1 undef, label %bb5.i1632, label %bb1.i1605
7
8 bb1.i1605: ; preds = %entry
9 br i1 undef, label %bb5.i73.i, label %bb3.i68.i
10
11 bb3.i68.i: ; preds = %bb1.i1605
12 unreachable
13
14 bb5.i73.i: ; preds = %bb1.i1605
15 br i1 undef, label %bb7.i79.i, label %bb6.i76.i
16
17 bb6.i76.i: ; preds = %bb5.i73.i
18 unreachable
19
20 bb7.i79.i: ; preds = %bb5.i73.i
21 br i1 undef, label %bb.i.i1608, label %bb8.i82.i
22
23 bb8.i82.i: ; preds = %bb7.i79.i
24 unreachable
25
26 bb.i.i1608: ; preds = %bb.i.i1608, %bb7.i79.i
27 br i1 undef, label %bb1.i.dhGetPoolFolder_dispatcher.preheader_crit_edge.i, label %bb.i.i1608
28
29 bb1.i.dhGetPoolFolder_dispatcher.preheader_crit_edge.i: ; preds = %bb.i.i1608
30 br label %dhGetPoolFolder_dispatcher.i
31
32 bb3.i.i1610: ; preds = %bb8.i.i, %bb7.i.i1615
33 br i1 undef, label %bb5.i.i1613, label %bb4.i.i1611
34
35 bb4.i.i1611: ; preds = %bb3.i.i1610
36 br label %bb5.i.i1613
37
38 bb5.i.i1613: ; preds = %bb4.i.i1611, %bb3.i.i1610
39 unreachable
40
41 bb7.i.i1615: ; preds = %dhGetPoolFolder.exit.i
42 br i1 undef, label %bb3.i.i1610, label %bb8.i.i
43
44 bb8.i.i: ; preds = %bb7.i.i1615
45 br i1 undef, label %bb3.i.i1610, label %bb9.i.i
46
47 bb9.i.i: ; preds = %bb8.i.i
48 br label %bb12.i.i
49
50 bb12.i.i: ; preds = %bb12.i.i, %bb9.i.i
51 br i1 undef, label %bb13.i.bb14.i_crit_edge.i, label %bb12.i.i
52
53 bb13.i.bb14.i_crit_edge.i: ; preds = %bb12.i.i
54 br i1 undef, label %bb25.i.i, label %bb20.i.i
55
56 bb19.i.i: ; preds = %bb20.i.i
57 br label %bb20.i.i
58
59 bb20.i.i: ; preds = %bb19.i.i, %bb13.i.bb14.i_crit_edge.i
60 %or.cond.i = or i1 undef, undef
61 br i1 %or.cond.i, label %bb25.i.i, label %bb19.i.i
62
63 bb25.i.i: ; preds = %bb20.i.i, %bb13.i.bb14.i_crit_edge.i
64 unreachable
65
66 bb5.i1632: ; preds = %entry
67 unreachable
68
69 dhGetPoolFolder_dispatcher.i: ; preds = %dhGetPoolFolder.exit.i, %bb1.i.dhGetPoolFolder_dispatcher.preheader_crit_edge.i
70 br i1 undef, label %bb.i96.i, label %bb1.i102.i
71
72 bb.i96.i: ; preds = %dhGetPoolFolder_dispatcher.i
73 br label %dhGetPoolFolder.exit.i
74
75 bb1.i102.i: ; preds = %dhGetPoolFolder_dispatcher.i
76 br label %dhGetPoolFolder.exit.i
77
78 dhGetPoolFolder.exit.i: ; preds = %bb1.i102.i, %bb.i96.i
79 br i1 undef, label %bb7.i.i1615, label %dhGetPoolFolder_dispatcher.i
80 }