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

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 13:27:43 PDT 2021


reames added a comment.

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.)


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

https://reviews.llvm.org/D98697



More information about the llvm-commits mailing list