diff options
author | Kyle Butt <kyle+llvm@iteratee.net> | 2017-04-12 03:18:20 +0000 |
---|---|---|
committer | Kyle Butt <kyle+llvm@iteratee.net> | 2017-04-12 03:18:20 +0000 |
commit | 04300b033e67e8a791d9ad217b27fccb23f6708e (patch) | |
tree | 33ad9b1a96508bb14a45e7ecc353331bb57895c5 /llvm/lib/CodeGen/MachineBlockPlacement.cpp | |
parent | f2435b95747692ddd80f2f7939c47954001f26e5 (diff) | |
download | bcm5719-llvm-04300b033e67e8a791d9ad217b27fccb23f6708e.tar.gz bcm5719-llvm-04300b033e67e8a791d9ad217b27fccb23f6708e.zip |
CodeGen: BlockPlacement: Clear ComputedEdges between functions.
Not clearing was causing non-deterministic compiles for large files. Addresses
for MachineBasicBlocks would end up colliding and we would lay out a block that
we assumed had been pre-computed when it had not been.
llvm-svn: 300022
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBlockPlacement.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index ffd88b7c8e3..1a9a166ac46 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -2640,6 +2640,9 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) { // there are no MachineLoops. PreferredLoopExit = nullptr; + assert(BlockToChain.empty()); + assert(ComputedEdges.empty()); + if (TailDupPlacement) { MPDT = &getAnalysis<MachinePostDominatorTree>(); unsigned TailDupSize = TailDupPlacementThreshold; @@ -2649,8 +2652,6 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) { precomputeTriangleChains(); } - assert(BlockToChain.empty()); - buildCFGChains(); // Changing the layout can create new tail merging opportunities. @@ -2671,6 +2672,7 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) { /*AfterBlockPlacement=*/true)) { // Redo the layout if tail merging creates/removes/moves blocks. BlockToChain.clear(); + ComputedEdges.clear(); // Must redo the post-dominator tree if blocks were changed. if (MPDT) MPDT->runOnMachineFunction(MF); @@ -2683,6 +2685,7 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) { alignBlocks(); BlockToChain.clear(); + ComputedEdges.clear(); ChainAllocator.DestroyAll(); if (AlignAllBlock) |