[PATCH] D98697: [IndVars] Provide eliminateIVComparison with context

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 03:24:22 PDT 2021


mkazantsev added a comment.

In D98697#2630151 <https://reviews.llvm.org/D98697#2630151>, @reames wrote:

> For the compile time concern, one idea you could consider exploring would be to have a version of isKnownPredicateAt which returns an Optional<bool>.  Such a routine could use the cheap proof techniques first (in both directions), and then resort to the more expensive ones.  In this particular case, it would also simplify the caller code.  Looking at a couple other callers, we seem to be missing some optimizations by not asking both.
>
> If we pushed that down all the way to the loop guard processing, that could be a substantial compile time win.  (As we'd walk the CFG once, not twice, in the case where we can't prove anything.)

This is a really good way to imrpove this, thank you for bringing this up. I'll consider this.


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

https://reviews.llvm.org/D98697



More information about the llvm-commits mailing list