mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
Do not rely on std::sort and std::erase to get list of unique
exit blocks. The output is dependent on addresses of basic block. Add and use Loop::getUniqueExitBlocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29966 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -570,11 +570,8 @@ void LoopUnswitch::UnswitchNontrivialCondition(Value *LIC, Constant *Val,
|
||||
LoopBlocks.insert(LoopBlocks.end(), L->block_begin(), L->block_end());
|
||||
|
||||
std::vector<BasicBlock*> ExitBlocks;
|
||||
L->getExitBlocks(ExitBlocks);
|
||||
std::sort(ExitBlocks.begin(), ExitBlocks.end());
|
||||
ExitBlocks.erase(std::unique(ExitBlocks.begin(), ExitBlocks.end()),
|
||||
ExitBlocks.end());
|
||||
|
||||
L->getUniqueExitBlocks(ExitBlocks);
|
||||
|
||||
// Split all of the edges from inside the loop to their exit blocks. Update
|
||||
// the appropriate Phi nodes as we do so.
|
||||
unsigned NumBlocks = L->getBlocks().size();
|
||||
@ -626,11 +623,8 @@ void LoopUnswitch::UnswitchNontrivialCondition(Value *LIC, Constant *Val,
|
||||
|
||||
// The exit blocks may have been changed due to edge splitting, recompute.
|
||||
ExitBlocks.clear();
|
||||
L->getExitBlocks(ExitBlocks);
|
||||
std::sort(ExitBlocks.begin(), ExitBlocks.end());
|
||||
ExitBlocks.erase(std::unique(ExitBlocks.begin(), ExitBlocks.end()),
|
||||
ExitBlocks.end());
|
||||
|
||||
L->getUniqueExitBlocks(ExitBlocks);
|
||||
|
||||
// Add exit blocks to the loop blocks.
|
||||
LoopBlocks.insert(LoopBlocks.end(), ExitBlocks.begin(), ExitBlocks.end());
|
||||
|
||||
|
Reference in New Issue
Block a user