diff options
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GVNHoist.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp index 10cdcd59e42..d031d675642 100644 --- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp +++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp @@ -155,7 +155,6 @@ struct CHIArg { using CHIIt = SmallVectorImpl<CHIArg>::iterator; using CHIArgs = iterator_range<CHIIt>; -using CHICache = DenseMap<BasicBlock *, SmallPtrSet<Instruction *, 4>>; using OutValuesType = DenseMap<BasicBlock *, SmallVector<CHIArg, 2>>; using InValuesType = DenseMap<BasicBlock *, SmallVector<std::pair<VNType, Instruction *>, 2>>; @@ -767,7 +766,6 @@ private: ReverseIDFCalculator IDFs(*PDT); OutValuesType OutValue; InValuesType InValue; - CHICache CachedCHIs; for (const auto &R : Ranks) { const SmallVecInsn &V = Map.lookup(R); if (V.size() < 2) @@ -786,6 +784,7 @@ private: // which currently have dead terminators that are control // dependence sources of a block which is in NewLiveBlocks. IDFs.setDefiningBlocks(VNBlocks); + IDFBlocks.clear(); IDFs.calculate(IDFBlocks); // Make a map of BB vs instructions to be hoisted. @@ -798,8 +797,7 @@ private: for (unsigned i = 0; i < V.size(); ++i) { CHIArg C = {VN, nullptr, nullptr}; // Ignore spurious PDFs. - if (DT->properlyDominates(IDFB, V[i]->getParent()) && - CachedCHIs[IDFB].insert(V[i]).second) { + if (DT->properlyDominates(IDFB, V[i]->getParent())) { OutValue[IDFB].push_back(C); LLVM_DEBUG(dbgs() << "\nInsertion a CHI for BB: " << IDFB->getName() << ", for Insn: " << *V[i]); |

