#include "llvm/Pass.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Pass.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
+#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Support/CFG.h"
#include <algorithm>
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Support/CFG.h"
#include <algorithm>
using namespace llvm;
STATISTIC(NumLCSSA, "Number of live out of a loop variables");
using namespace llvm;
STATISTIC(NumLCSSA, "Number of live out of a loop variables");
SetVector<Instruction*> getLoopValuesUsedOutsideLoop(Loop *L);
Value *GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst,
SetVector<Instruction*> getLoopValuesUsedOutsideLoop(Loop *L);
Value *GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst,
- std::map<DominatorTree::Node*, Value*> &Phis);
+ DenseMap<DominatorTree::Node*, Value*> &Phis);
/// inLoop - returns true if the given block is within the current loop
const bool inLoop(BasicBlock* B) {
/// inLoop - returns true if the given block is within the current loop
const bool inLoop(BasicBlock* B) {
++NumLCSSA; // We are applying the transformation
// Keep track of the blocks that have the value available already.
++NumLCSSA; // We are applying the transformation
// Keep track of the blocks that have the value available already.
- std::map<DominatorTree::Node*, Value*> Phis;
+ DenseMap<DominatorTree::Node*, Value*> Phis;
DominatorTree::Node *InstrNode = DT->getNode(Instr->getParent());
DominatorTree::Node *InstrNode = DT->getNode(Instr->getParent());
/// GetValueForBlock - Get the value to use within the specified basic block.
/// available values are in Phis.
Value *LCSSA::GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst,
/// GetValueForBlock - Get the value to use within the specified basic block.
/// available values are in Phis.
Value *LCSSA::GetValueForBlock(DominatorTree::Node *BB, Instruction *OrigInst,
- std::map<DominatorTree::Node*, Value*> &Phis) {
+ DenseMap<DominatorTree::Node*, Value*> &Phis) {
// If there is no dominator info for this BB, it is unreachable.
if (BB == 0)
return UndefValue::get(OrigInst->getType());
// If there is no dominator info for this BB, it is unreachable.
if (BB == 0)
return UndefValue::get(OrigInst->getType());