From f1a7df5ef296296a48b892775ba39ab886b7de6f Mon Sep 17 00:00:00 2001 From: "Brian M. Rzycki" Date: Fri, 16 Feb 2018 16:35:17 +0000 Subject: [JumpThreading] PR36133 enable/disable DominatorTree for LVI analysis Summary: The LazyValueInfo pass caches a copy of the DominatorTree when available. Whenever there are pending DominatorTree updates within JumpThreading's DeferredDominance object we cannot use the cached DT for LVI analysis. This commit adds the new methods enableDT() and disableDT() to LVI. JumpThreading also sets the appropriate usage model before calling LVI analysis methods. Fixes https://bugs.llvm.org/show_bug.cgi?id=36133 Reviewers: sebpop, dberlin, kuhar Reviewed by: sebpop, kuhar Subscribers: uabelho, llvm-commits, aprantl, hiraditya, a.elovikov Differential Revision: https://reviews.llvm.org/D42717 llvm-svn: 325356 --- llvm/lib/IR/Dominators.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/IR/Dominators.cpp') diff --git a/llvm/lib/IR/Dominators.cpp b/llvm/lib/IR/Dominators.cpp index 25e4ce4e4ef..1429e1b9060 100644 --- a/llvm/lib/IR/Dominators.cpp +++ b/llvm/lib/IR/Dominators.cpp @@ -448,6 +448,9 @@ bool DeferredDominance::pendingDeletedBB(BasicBlock *DelBB) { return DeletedBBs.count(DelBB) != 0; } +/// \brief Returns true if pending DT updates are queued for a flush() event. +bool DeferredDominance::pending() { return !PendUpdates.empty(); } + /// \brief Flushes all pending updates and block deletions. Returns a /// correct DominatorTree reference to be used by the caller for analysis. DominatorTree &DeferredDominance::flush() { -- cgit v1.2.3