[llvm-dev] SCEV cannot compute the trip count of Simple loop

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 19 23:35:53 PDT 2016


Hi Kevin,

Kevin Choi <code.kchoi at gmail.com> writes:
> On Fri, Sep 16, 2016 at 4:05 PM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
>
>  Hi Kevin,
>
>  If "x + 1" and "x + 3" cannot be proven to overflow then the loop no
>  longer has a constant trip count of "2".

Firstly: I made a mistake above.  What I meant to say is If "x + 1" and
"x + 3" cannot be proven to not overflow (that is, they may overflow)
then the loop no longer has a constant trip count of "2".

> If we apply "Assuming compiler assumes program is free of UB", can
> above requirement be relaxed?

Yes, the problem is coming up with a sound way to exploit the assumption
that the program does not have UB.

-- Sanjoy


More information about the llvm-dev mailing list