diff options
author | Zhou Sheng <zhousheng00@gmail.com> | 2009-02-20 17:49:33 +0000 |
---|---|---|
committer | Zhou Sheng <zhousheng00@gmail.com> | 2009-02-20 17:49:33 +0000 |
commit | 3f315eb5e08c9f04bde127b8994ec4fb30664b51 (patch) | |
tree | 660e0f5e73a85e7c1cc52bfaecbd44ea29a24e3a /lib/Transforms | |
parent | a248c45e005248c54704f7c616ccb8b7efe191e5 (diff) | |
download | external_llvm-3f315eb5e08c9f04bde127b8994ec4fb30664b51.zip external_llvm-3f315eb5e08c9f04bde127b8994ec4fb30664b51.tar.gz external_llvm-3f315eb5e08c9f04bde127b8994ec4fb30664b51.tar.bz2 |
Just roll back the previous change to -mem2reg.
Will re-think about this according to Chris's comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65126 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Utils/Mem2Reg.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/Transforms/Utils/Mem2Reg.cpp b/lib/Transforms/Utils/Mem2Reg.cpp index 33fcd8c..2b06d77 100644 --- a/lib/Transforms/Utils/Mem2Reg.cpp +++ b/lib/Transforms/Utils/Mem2Reg.cpp @@ -16,7 +16,6 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils/PromoteMemToReg.h" #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h" -#include "llvm/IntrinsicInst.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Instructions.h" #include "llvm/Function.h" @@ -54,30 +53,6 @@ namespace { char PromotePass::ID = 0; static RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register"); -/// Remove the invalid or redundant debug information. -static void CleanDbgInfo(Function& F) { - std::vector<Instruction*> DeadDbgs; - for (Function::iterator BBI = F.begin(), BBE = F.end(); BBI != BBE; ++BBI) { - if (BBI->size() <= 1) - continue; - for (BasicBlock::iterator I = BBI->begin(), E = BBI->getTerminator(); - I != E; ++I) { - BasicBlock::iterator NextI = I; - ++NextI; - if (isa<DbgStopPointInst>(I) && isa<DbgStopPointInst>(NextI)) - DeadDbgs.push_back(I); - else if (isa<DbgStopPointInst>(I) && isa<BranchInst>(NextI)) - DeadDbgs.push_back(I); - } - } - - while (!DeadDbgs.empty()) { - Instruction *Inst = DeadDbgs.back(); - DeadDbgs.pop_back(); - Inst->eraseFromParent(); - } -} - bool PromotePass::runOnFunction(Function &F) { std::vector<AllocaInst*> Allocas; @@ -101,7 +76,6 @@ bool PromotePass::runOnFunction(Function &F) { if (Allocas.empty()) break; PromoteMemToReg(Allocas, DT, DF); - CleanDbgInfo(F); NumPromoted += Allocas.size(); Changed = true; } |