[PATCH] D67178: [SCEV] Use loop guard info when computing the max BE taken count in howFarToZero.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 13:28:15 PDT 2019


fhahn added a comment.

In D67178#1658197 <https://reviews.llvm.org/D67178#1658197>, @efriedma wrote:

> Instead of writing a C++ unittest, you should be able to use "opt -analyze -scalar-evolution" to test this.


Sure, I'll do that. The current version of the unit test only tests stuff covered by `-analyze -scalar-evolution`.

> Not sure I like the approach; rewriting the SCEV to a more complicated expression seems like it's stacking complexity.  But it might be the least code overall, I guess.

Yep, the re-writing the expression was the least invasive change. But I would be happy to change the implementation to use additional conditions differently. To cover the motivating case for the patch, it would be enough to collect the additional conditions, pass them to getRangeRef and use them there. But I think the additional conditions could be helpful in the various reasoning functions as well. Currently we can pass one additional condition to most reasoning functions, but here it would be helpful to pass multiple conditions. I am happy with either direction, please let me know what you prefer :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67178





More information about the llvm-commits mailing list