diff options
author | Teresa Johnson <tejohnson@google.com> | 2019-03-06 14:57:40 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2019-03-06 14:57:40 +0000 |
commit | b1daf0aef67d4998aef2bbfd7709bc0ee0e89923 (patch) | |
tree | 74ab9e1a47857994c2fd7e3581962ffb8035850a /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | 6b622ebea01b3ece8b8e475f15c5ce16a4cdc9f8 (diff) | |
download | llvm-b1daf0aef67d4998aef2bbfd7709bc0ee0e89923.zip llvm-b1daf0aef67d4998aef2bbfd7709bc0ee0e89923.tar.gz llvm-b1daf0aef67d4998aef2bbfd7709bc0ee0e89923.tar.bz2 |
[CGP] Avoid repeatedly building DominatorTree causing long compile-time (NFC)
Summary:
In r354298 a DominatorTree construction was added via new function
combineToUSubWithOverflow, which was subsequently restructured into
replaceMathCmpWithIntrinsic in r354689. We are hitting a very long
compile time due to this repeated construction, once per math cmp in
the function.
We shouldn't need to build the DominatorTree more than once per
function, except when a transformation invalidates it. There is already
a boolean flag that is returned from these methods indicating whether
the DT has been modified. We can simply build the DT once per
Function walk in CodeGenPrepare::runOnFunction, since any time a change
is made we break out of the Function walk and restart it.
I modified the code so that both replaceMathCmpWithIntrinsic as well as
mergeSExts (which was also building a DT) use the DT constructed by the
run method.
From -mllvm -time-passes:
Before this patch: CodeGen Prepare user time is 328s
With this patch: CodeGen Prepare user time is 21s
Reviewers: spatel
Subscribers: jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58995
llvm-svn: 355512
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
0 files changed, 0 insertions, 0 deletions