[PATCH] D102615: [LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 25 11:36:19 PDT 2021


nikic added a comment.

In D102615#2778959 <https://reviews.llvm.org/D102615#2778959>, @nikic wrote:

> As a heads-up, it looks like this change has a non-trivial compile-time impact: https://llvm-compile-time-tracker.com/compare.php?from=ce245246043d3c4f12515b2c773ed6c9174345b5&to=2531fd70d19aa5d61feb533bbdeee7717a4129eb&stat=instructions I haven't looked any closer yet.

Just looked into this. libclamav_wwunpack.c from test-suite is a good test case, small file with about 10% compile-time regression. Callgrind says that most of the additional time is spent inside isKnownPredicateAt(), where in turn most of the time is spent in isImpliedCond(). That's a familiar issue...

Is the "at" part an important part of this optimization? If no, if this used just isKnownPredicate(), I expect it would be fine. If yes, then I think that this (and really, any new optimization that uses isKnownPredicateAt) is probably not viable unless and until someone makes a serious effort towards improving its performance.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102615



More information about the llvm-commits mailing list