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

Justin Kreiner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 11:01:38 PDT 2021


jkreiner added a comment.

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

> For our downstream arch we're seeing gains up to 27%.

That's great to hear!

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.



================
Comment at: llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp:363-366
+inline raw_ostream &operator<<(raw_ostream &OS, const ThreadingPath &TPath) {
+  TPath.print(OS);
+  return OS;
+}
----------------
dnsampaio wrote:
> In release mode I get warnings this is not used (we use -Werror):
> llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp:364:21: error: unused function 'operator<<' [-Werror,-Wunused-function]
> 
> Perhaps put it around #ifndef NDEBUG ?
I see, I'll add that #ifndef NDEBUG check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99205



More information about the llvm-commits mailing list