forked from OSchip/llvm-project
Do not schedule BBs before the entry point
Summary: SPEC CPU2006 perlbench triggered a bug in our heuristic block reordering algorithm where a hot edge that targets the entry point (as in a recursive tail call) would make us try to allocate the call site before the function entry point. Since we don't update function addresses yet, moving the entry point will corrupt the program. This patch fixes this. (cherry picked from FBD2562528)
This commit is contained in:
parent
b0115a4536
commit
9f41a0d263
|
@ -595,7 +595,7 @@ void BinaryFunction::optimizeLayout(bool DumpLayout) {
|
|||
int I = 0, J = 0;
|
||||
|
||||
// Case 1: BBSrc and BBDst are the same. Ignore this edge
|
||||
if (BBSrc == BBDst)
|
||||
if (BBSrc == BBDst || BBDst == Entry)
|
||||
continue;
|
||||
|
||||
// Case 2: Both BBSrc and BBDst are already allocated
|
||||
|
|
Loading…
Reference in New Issue