[PATCH] D139403: [SCEV] Compute symbolic exit count for 'and' conditions

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 01:06:49 PST 2022


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

Planned separation into 2 pieces.



================
Comment at: llvm/test/Analysis/ScalarEvolution/widenable-condition.ll:27
 ; CHECK-NEXT:  Loop %loop: constant max backedge-taken count is 1999
-; CHECK-NEXT:  Loop %loop: Unpredictable symbolic max backedge-taken count.
+; CHECK-NEXT:  Loop %loop: symbolic max backedge-taken count is 1999
 ; CHECK-NEXT:  Loop %loop: Unpredictable predicated backedge-taken count.
----------------
mkazantsev wrote:
> nikic wrote:
> > I don't really get why this patch introduces these changes (i.e. why this wasn't the result previously). Aren't we already assigning the constant max to the symbol max if there is no exact?
> This is indeed strange. I will investigate.
Funny thing, it happened exactly because I've added this
```
    if (EL.ExactNotTaken != getCouldNotCompute() ||
        EL.SymbolicMaxNotTaken != getCouldNotCompute())
```
The story is simple: symbolic exit count was exaluated as constant, but then ExitCount simply wasn't added to the array because Exact was missing.

I will split it off into a separate fix.


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

https://reviews.llvm.org/D139403



More information about the llvm-commits mailing list