diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-11 23:56:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-11 23:56:08 +0000 |
commit | 92f8d26a987f8fa57ceacd18d0802e7010ad49df (patch) | |
tree | b5e762a3b215675a037734022e63946cc6d4cf6a /lib/Transforms | |
parent | 204c64a7117240e986fc265224e3209455247698 (diff) | |
download | external_llvm-92f8d26a987f8fa57ceacd18d0802e7010ad49df.zip external_llvm-92f8d26a987f8fa57ceacd18d0802e7010ad49df.tar.gz external_llvm-92f8d26a987f8fa57ceacd18d0802e7010ad49df.tar.bz2 |
revert r83814 for now, it is making the llvm-gcc bootstrap unhappy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index b608186..0c790f6 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -101,20 +101,6 @@ namespace { Add(I); } - /// AddInitialGroup - Add the specified batch of stuff in reverse order. - /// which should only be done when the worklist is empty and when the group - /// has no duplicates. - void AddInitialGroup(Instruction *const *List, unsigned NumEntries) { - assert(Worklist.empty() && "Worklist must be empty to add initial group"); - Worklist.reserve(NumEntries+16); - DEBUG(errs() << "IC: ADDING: " << NumEntries << " instrs to worklist\n"); - for (; NumEntries; --NumEntries) { - Instruction *I = List[NumEntries-1]; - WorklistMap.insert(std::make_pair(I, Worklist.size())); - Worklist.push_back(I); - } - } - // Remove - remove I from the worklist if it exists. void Remove(Instruction *I) { DenseMap<Instruction*, unsigned>::iterator It = WorklistMap.find(I); @@ -12677,9 +12663,6 @@ static void AddReachableCodeToWorklist(BasicBlock *BB, const TargetData *TD) { SmallVector<BasicBlock*, 256> Worklist; Worklist.push_back(BB); - - std::vector<Instruction*> InstrsForInstCombineWorklist; - InstrsForInstCombineWorklist.reserve(128); while (!Worklist.empty()) { BB = Worklist.back(); @@ -12726,7 +12709,7 @@ static void AddReachableCodeToWorklist(BasicBlock *BB, DBI_Prev = 0; } - InstrsForInstCombineWorklist.push_back(Inst); + IC.Worklist.Add(Inst); } // Recursively visit successors. If this is a branch or switch on a @@ -12758,14 +12741,6 @@ static void AddReachableCodeToWorklist(BasicBlock *BB, for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) Worklist.push_back(TI->getSuccessor(i)); } - - // Once we've found all of the instructions to add to instcombine's worklist, - // add them in reverse order. This way instcombine will visit from the top - // of the function down. This jives well with the way that it adds all uses - // of instructions to the worklist after doing a transformation, thus avoiding - // some N^2 behavior in pathological cases. - IC.Worklist.AddInitialGroup(&InstrsForInstCombineWorklist[0], - InstrsForInstCombineWorklist.size()); } bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) { |