Include an actual proof of the property we care about, and add FIXMEs for the missing correctness checks. Also, some related cleanup.
Split off from D105216.
Paths
| Differential D105865
[ScalarEvolution][NFC] Refactor howManyLessThans AbandonedPublic Authored by efriedma on Jul 12 2021, 7:35 PM.
Details
Summary Include an actual proof of the property we care about, and add FIXMEs for the missing correctness checks. Also, some related cleanup. Split off from D105216.
Diff Detail
Unit TestsFailed Event Timelineefriedma added a child revision: D105216: [ScalarEvolution] Fix overflow in computeBECount..Jul 12 2021, 7:35 PM
Revision Contents
Diff 358126 llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/trip-count-unknown-stride.ll
|
Thinking about this a bit more, we might be able to get away with using this path even if we can't prove RHS > Start - Stride. We could use something like (max(RHS, Start - (Stride - 1)) - (Start - (Stride - 1))) /u Stride, I think. Not confident I wrote that exactly right.
Not sure how much that improves things in practice, though; the logic on this path is still predicated on the assumption that Start - (Stride - 1) doesn't overflow.