[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:57:52 PST 2020


kazu added a comment.

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

> In D91511#2396576 <https://reviews.llvm.org/D91511#2396576>, @kazu wrote:
>
>> 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).
>
> D91017 <https://reviews.llvm.org/D91017> is NFC, why does it reveal the bug in JumpThreading while it has not been seen without D91017 <https://reviews.llvm.org/D91017>? Can we create a test case, which passes without D91017 <https://reviews.llvm.org/D91017> but fails with it?

D91017 <https://reviews.llvm.org/D91017> introduces an additional assert in `getEdgeProbability(const BasicBlock *Src, const BasicBlock *Dst)`, and that's causing trouble.  The testcase in this patch should serve the testcase you are describing.

Once I do enough testing with profile guided optimizations to exercise BPI related code in the jump threading pass, I'm going to re-introduce the assert above by itself without D91017 <https://reviews.llvm.org/D91017>, wait for a bit, and then re-apply D91017 <https://reviews.llvm.org/D91017>.  Thoughts?


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