[all-commits] [llvm/llvm-project] 5a3ef5: [Utils] Skip RemoveRedundantDbgInstrs in MergeBloc...

Vedant Kumar via All-commits all-commits at lists.llvm.org
Tue Oct 27 10:13:25 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5a3ef55a524bf9e072d98286e5febdb218b1fc72
      https://github.com/llvm/llvm-project/commit/5a3ef55a524bf9e072d98286e5febdb218b1fc72
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-10-27 (Tue, 27 Oct 2020)

  Changed paths:
    M llvm/lib/CodeGen/CodeGenPrepare.cpp
    M llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
    M llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
    M llvm/test/Transforms/SimplifyCFG/hoist-dbgvalue-inlined.ll

  Log Message:
  -----------
  [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




More information about the All-commits mailing list