[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 25 14:19:00 PDT 2019


fhahn planned changes to this revision.
fhahn added a comment.

In D67178#1670316 <https://reviews.llvm.org/D67178#1670316>, @reames wrote:

> SCEV already has support for isLoopEntryGuardedByCond which should be a super set of the added code.


Agreed,  I think the final version of the patch should definitely share the guard discovery logic with isLoopEntryGuardedByCond.

> Have you explored why the distance expression isn't be canonicalized at construction?

Do you mean why the information from the loop guard is not included in the distance expression when we create it? 
IIUC, the distance expression here is the subtraction of RHS and LHS of the exit condition. As Eli indicated, including information from the guards in the expressions for the operands of the condition might increase the complexity, without much gain, besides using it to get more precise upper bounds on ranges. Do you think there would be additional benefits for including information from the guards in the distance expression, beside better range information? AFAIK, some of the reasoning methods themselves try to rewrite/simplify expressions based on information from loop guards and we might be able to skip some of those rewrites.


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