[PATCH] D88293: [ControlDependentDCE] Add Control Dependent DCE pass

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 11:07:42 PDT 2020


jdoerfert added a comment.

In D88293#2295404 <https://reviews.llvm.org/D88293#2295404>, @masakiarai wrote:

> Considering only the DCE's feature, I think the ADCE pass is close to this pass's purpose.
> The big difference between this pass and others is that this pass duplicates the basic block to isolate the control flow.
> This feature can promote loop optimizations by isolating the control flow that does not enter loops out of the kernel part when there is a sequence of multiple loops in numerical applications.
> However, this first version duplicates basic blocks only in the conservative case where the performance is definitely improved.
> This pass needs to duplicate basic blocks more aggressively and selectively to facilitate loop optimizations.

OK. This does not get across from reading the tests. I usually use the update scripts to generate check lines but whatever you prefer should include enough check lines and comments to that this becomes obvious.

That said, I still am not convinced this is best implemented in a new pass. Isn't the idea here that we have the value of a branch condition available for a subset of the incoming paths? That sounds like it would compose well with other ways through which we can know the value of a conditional for a subset of the incoming paths w/o having multiple branches with the same condition:

  if (a) 
    assume(cond == 0);
  if (cond) {
  ...
  } else {
    ...
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88293/new/

https://reviews.llvm.org/D88293



More information about the llvm-commits mailing list