[llvm-bugs] [Bug 37929] New: JumpThreading can take take several minutes on large functions

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 25 13:39:05 PDT 2018


            Bug ID: 37929
           Summary: JumpThreading can take take several minutes on large
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: vlad at tsyrklevich.net
                CC: llvm-bugs at lists.llvm.org

Created attachment 20466
  --> https://bugs.llvm.org/attachment.cgi?id=20466&action=edit

Filing a bug for this:

The attached file (a preprocessed copy of AArch64InstPrinter.cpp) takes 80s to
compile locally with -O3 [1], and 400s with -O3 + UBSan [2].

The vast majority of that time is spent computing dominator trees for the
JumpThreading pass for two auto-generated functions
(AArch64InstPrinter::printAliasInstr and
AArch64AppleInstPrinter::printAliasInstr) where inlining significantly blows up
the number of basic blocks (from ~5k with -O1 to ~25k with -O3 and ~55k for O3
+ UBSan.) Running CFGSimplication before JumpThreading reduces the # of BBs by
~10k and improves the runtime by ~3x, but the compile for -O3 + UBSan still
takes ~2 minutes. I'm not sure if making that change is justified/sound.

[1] time clang -cc1 -triple x86_64-unknown-linux-gnu -O3 -std=c++11 -emit-llvm
-o /dev/null preprocessed.cpp
[2] time clang -cc1 -triple x86_64-unknown-linux-gnu -O3 -std=c++11 -emit-llvm
-o /dev/null preprocessed.cpp

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180625/05f4c9a7/attachment.html>

More information about the llvm-bugs mailing list