mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-16 11:30:51 +00:00
reuse vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53007 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2095c38c7a
commit
1e41f6d724
@ -85,6 +85,13 @@ namespace {
|
|||||||
/// OrigLoopExitMap - This is used to map loop exiting block with
|
/// OrigLoopExitMap - This is used to map loop exiting block with
|
||||||
/// corresponding loop exit block, before updating CFG.
|
/// corresponding loop exit block, before updating CFG.
|
||||||
DenseMap<BasicBlock *, BasicBlock *> OrigLoopExitMap;
|
DenseMap<BasicBlock *, BasicBlock *> OrigLoopExitMap;
|
||||||
|
|
||||||
|
// LoopBlocks contains all of the basic blocks of the loop, including the
|
||||||
|
// preheader of the loop, the body of the loop, and the exit blocks of the
|
||||||
|
// loop, in that order.
|
||||||
|
std::vector<BasicBlock*> LoopBlocks;
|
||||||
|
// NewBlocks contained cloned copy of basic blocks from LoopBlocks.
|
||||||
|
std::vector<BasicBlock*> NewBlocks;
|
||||||
public:
|
public:
|
||||||
static char ID; // Pass ID, replacement for typeid
|
static char ID; // Pass ID, replacement for typeid
|
||||||
explicit LoopUnswitch(bool Os = false) :
|
explicit LoopUnswitch(bool Os = false) :
|
||||||
@ -761,10 +768,8 @@ void LoopUnswitch::UnswitchNontrivialCondition(Value *LIC, Constant *Val,
|
|||||||
<< " blocks] in Function " << F->getName()
|
<< " blocks] in Function " << F->getName()
|
||||||
<< " when '" << *Val << "' == " << *LIC << "\n";
|
<< " when '" << *Val << "' == " << *LIC << "\n";
|
||||||
|
|
||||||
// LoopBlocks contains all of the basic blocks of the loop, including the
|
LoopBlocks.clear();
|
||||||
// preheader of the loop, the body of the loop, and the exit blocks of the
|
NewBlocks.clear();
|
||||||
// loop, in that order.
|
|
||||||
std::vector<BasicBlock*> LoopBlocks;
|
|
||||||
|
|
||||||
// First step, split the preheader and exit blocks, and add these blocks to
|
// First step, split the preheader and exit blocks, and add these blocks to
|
||||||
// the LoopBlocks list.
|
// the LoopBlocks list.
|
||||||
@ -792,7 +797,6 @@ void LoopUnswitch::UnswitchNontrivialCondition(Value *LIC, Constant *Val,
|
|||||||
// Next step, clone all of the basic blocks that make up the loop (including
|
// Next step, clone all of the basic blocks that make up the loop (including
|
||||||
// the loop preheader and exit blocks), keeping track of the mapping between
|
// the loop preheader and exit blocks), keeping track of the mapping between
|
||||||
// the instructions and blocks.
|
// the instructions and blocks.
|
||||||
std::vector<BasicBlock*> NewBlocks;
|
|
||||||
NewBlocks.reserve(LoopBlocks.size());
|
NewBlocks.reserve(LoopBlocks.size());
|
||||||
DenseMap<const Value*, Value*> ValueMap;
|
DenseMap<const Value*, Value*> ValueMap;
|
||||||
for (unsigned i = 0, e = LoopBlocks.size(); i != e; ++i) {
|
for (unsigned i = 0, e = LoopBlocks.size(); i != e; ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user