diff options
author | Vedant Kumar <vsk@apple.com> | 2020-10-06 14:18:20 -0700 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2020-10-27 10:12:59 -0700 |
commit | 5a3ef55a524bf9e072d98286e5febdb218b1fc72 (patch) | |
tree | 0fd9636331470a852d8dfe955a36c69a6cc781a0 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | |
parent | 1a1aad9156407bc891e2738e9877c03bd594e67f (diff) | |
download | llvm-5a3ef55a524bf9e072d98286e5febdb218b1fc72.zip llvm-5a3ef55a524bf9e072d98286e5febdb218b1fc72.tar.gz llvm-5a3ef55a524bf9e072d98286e5febdb218b1fc72.tar.bz2 |
[Utils] Skip RemoveRedundantDbgInstrs in MergeBlockIntoPredecessor (PR47746)
This patch changes MergeBlockIntoPredecessor to skip the call to
RemoveRedundantDbgInstrs, in effect partially reverting D71480 due to
some compile-time issues spotted in LoopUnroll and SimplifyCFG.
The call to RemoveRedundantDbgInstrs appears to have changed the
worst-case behavior of the merging utility. Loosely speaking, it seems
to have gone from O(#phis) to O(#insts).
It might not be possible to mitigate this by scanning a block to
determine whether there are any debug intrinsics to remove, since such a
scan costs O(#insts).
So: skip the call to RemoveRedundantDbgInstrs. There's surprisingly
little fallout from this, and most of it can be addressed by doing
RemoveRedundantDbgInstrs later. The exception is (the block-local
version of) SimplifyCFG, where it might just be too expensive to call
RemoveRedundantDbgInstrs.
Differential Revision: https://reviews.llvm.org/D88928
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index 86b2eb0..0abedb5 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -285,11 +285,6 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU, // Add unreachable to now empty BB. new UnreachableInst(BB->getContext(), BB); - // Eliminate duplicate/redundant dbg.values. This seems to be a good place to - // do that since we might end up with redundant dbg.values describing the - // entry PHI node post-splice. - RemoveRedundantDbgInstrs(PredBB); - // Inherit predecessors name if it exists. if (!PredBB->hasName()) PredBB->takeName(BB); |