File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1751,6 +1751,7 @@ void FlowGraph::removeUnreachableBlocks(FuncInfoHashTable& funcInfoHT)
1751
1751
}
1752
1752
reassignBlockIDs ();
1753
1753
setPhysicalPredSucc ();
1754
+ reassignFuncIds (funcInfoHT);
1754
1755
}
1755
1756
1756
1757
// prevent overwriting dump file and indicate compilation order with dump serial number
@@ -2385,6 +2386,18 @@ void FlowGraph::linkDummyBB()
2385
2386
}
2386
2387
}
2387
2388
2389
+ //
2390
+ // Re-assign function ids as implementation expects them to be consecutive.
2391
+ //
2392
+ void FlowGraph::reassignFuncIds (FuncInfoHashTable& funcInfoHT)
2393
+ {
2394
+ unsigned int index = 0 ;
2395
+ for (auto & item : funcInfoHT)
2396
+ {
2397
+ item.second ->setId (index++);
2398
+ }
2399
+ }
2400
+
2388
2401
//
2389
2402
// Re-assign block ID so that we can use id to determine the ordering of two blocks in the code layout
2390
2403
//
Original file line number Diff line number Diff line change @@ -1106,11 +1106,20 @@ class FlowGraph
1106
1106
// Add a dummy BB for multiple-exit flow graph
1107
1107
//
1108
1108
void linkDummyBB ();
1109
+
1110
+ //
1111
+ // Reassign function ids in case some functions were optimized away as dead code.
1112
+ // Implementation uses function id to index in to std::vector so there shouldnt
1113
+ // be holds in function ids.
1114
+ //
1115
+ void reassignFuncIds (FuncInfoHashTable& funcInfoHT);
1116
+
1109
1117
//
1110
1118
// Re-assign block ID so that we can use id to determine the ordering of two blocks in
1111
1119
// the code layout
1112
1120
//
1113
1121
void reassignBlockIDs ();
1122
+
1114
1123
//
1115
1124
// Remove blocks that are unreachable via control flow of program
1116
1125
//
You can’t perform that action at this time.
0 commit comments