[PATCH] D99205: Add jump-threading optimization for deterministic finite automata

Justin Kreiner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 28 08:12:50 PDT 2021


jkreiner added a subscriber: alexey.zhikhar.
jkreiner added a comment.

In D99205#2786462 <https://reviews.llvm.org/D99205#2786462>, @foad wrote:

> In D99205#2785323 <https://reviews.llvm.org/D99205#2785323>, @jkreiner wrote:
>
>> In D99205#2784461 <https://reviews.llvm.org/D99205#2784461>, @foad wrote:
>>
>>> Naive question: does your new pass "result in irreducible control flow that harms other optimizations"? From the ASCII art diagram in the commit message it looks like it does. Why is that OK?
>>
>> It could produce irreducible control flow like that, but the pass is late enough in the pipeline that it won't have a negative impact. I experimented with putting it early in the pipeline and the gains I measured weren't great, but it seems to be profitable where it is right now.
>
> Naive follow-up question: why does this have to be a complete new implementation of jump threading? Would it be feasible to have a single implementation that takes a "don't create irreducible control flow" flag?

I just want to clarify that this is not a complete new implementation of jump threading, the cases that both of the passes catch are mutually exclusive. There were some discussions about implementing a more aggressive jump threading versus a separate pass for specific uses (FSMs) that might answer your question over here: D88307 <https://reviews.llvm.org/D88307>

In D99205#2786565 <https://reviews.llvm.org/D99205#2786565>, @dnsampaio wrote:

> @jkreiner with both llvm 12 and head I get a compiler crash in this function for file F17082111 <https://reviews.llvm.org/F17082111>. Just run `opt --dfa-jump-threading`. Sorry, I couldn't reduce it further, I just don't know how to get bugpoint to work with opt.

Thank you for providing the testcase, I reproduced it locally. It is the last day of my internship, so I won't be able to submit a fix for it. @alexey.zhikhar initially wrote some parts of the analysis, and will continue where I left off on the remaining work items for this patch.


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

https://reviews.llvm.org/D99205



More information about the llvm-commits mailing list