This is an archive of the discontinued LLVM Phabricator instance.

[CVP] Process binary operations even when def is local
ClosedPublic

Authored by anna on Oct 10 2017, 2:56 PM.

Details

Summary

This patch adds processing of binary operations when the def of operands are in
the same block (i.e. local processing).

Earlier we bailed out in such cases (the bail out was introduced in rL252032)
because LVI at that time was more precise about context at the end of basic
blocks, which implied local def and use analysis didn't benefit CVP.

Since then we've added support for LVI in presence of assumes and guards. The
test cases added show how local def processing in CVP helps adding more
information to the ashr, sdiv, srem and add operators.

Note: processCmp which suffers from the same problem will
be handled in a later patch.

Diff Detail

Repository
rL LLVM

Event Timeline

anna created this revision.Oct 10 2017, 2:56 PM
anna edited reviewers, added: reames; removed: philip.Oct 11 2017, 4:54 AM
apilipenko accepted this revision.Oct 12 2017, 6:45 AM

Did you measure the compile time impact somehow?

The patch itself looks good to me.

This revision is now accepted and ready to land.Oct 12 2017, 6:45 AM
spatel added a subscriber: spatel.Oct 12 2017, 9:21 AM
anna added a comment.Oct 12 2017, 2:09 PM

Did you measure the compile time impact somehow?

Compile time results on CTMark benchmarks show compile time is not affected by this change:

Tests: 10
Metric: compile_time

Program                                        Patch   NoPatch           diff
sqlite3/sqlite3                                35.23   35.53             0.8%
tramp3d-v4/tramp3d-v4                          49.20   49.61             0.8%
lencod/lencod                                  34.92   35.09             0.5%
Bullet/bullet                                  54.23   54.02            -0.4%
mafft/pairlocalalign                           20.22   20.29             0.3%
SPASS/SPASS                                    29.78   29.87             0.3%
7zip/7zip-benchmark                            79.72   79.50            -0.3%
kimwitu++/kc                                   27.46   27.53             0.3%
ClamAV/clamscan                                32.89   32.95             0.2%
consumer-typeset/consumer-typeset              23.23   23.20            -0.1%

Also discussed offline with Philip (wrt change rL252032). LVI over time has been greatly improved to get rid of compile time bottlenecks, so the compile time reason to have the LocalDefs constraint is no longer that relevant.

This revision was automatically updated to reflect the committed changes.