[PATCH] D91511: [JumpThreading] Call eraseBlock when folding a conditional branch

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 15 21:31:06 PST 2020


kazu added a comment.

In D91511#2396561 <https://reviews.llvm.org/D91511#2396561>, @yrouban wrote:

> The patch looks good, but I have some concerns.
>
>> //This patch is one of the steps before we can safely re-apply D91017 <https://reviews.llvm.org/D91017>.//
>
> Will there be any other patches? Please add links if any and dependencies to D91017 <https://reviews.llvm.org/D91017>.
> Could you please describe the problem that prevents D91017 <https://reviews.llvm.org/D91017>?

We need more calls to `BPI->eraseBlock()` if we want to require all basic blocks, including dead ones yet to be removed, to satisfy:

  SrcProbs.size() == Src->getTerminator()->getNumSuccessors() 

at all times during the jump threading pass except when it is actively modifying the CFG.

If we are OK with the consistency just for those basic blocks that are live, then the call to `BPI->eraseBlock()` being introduced in this patch may be enough.  (I haven't checked.)

The problem caused by D91017 <https://reviews.llvm.org/D91017> is due to the jump threading pass not updating edge probabilities (as addressed in this patch).

Once this patch lands, I'm going to build large pieces of software with PGO enabled to see what else is broken.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91511



More information about the llvm-commits mailing list