[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)

Dan Gohman dan433584 at gmail.com
Tue Dec 18 10:54:16 PST 2012


On Tue, Dec 18, 2012 at 9:56 AM, Matthew Curtis <mcurtis at codeaurora.org> wrote:
>
> Here's how I'm evaluating the expression (in my head):
>
> 00: Add(ZeroExtend(Truncate(Minus(AddRec(Start=0,Step=3)[n],3), i8), i32),3)
>                                                          |
> 01: Add(ZeroExtend(Truncate(Minus(AddRec(Start=0,Step=3)[0],3), i8), i32),3)
>                                   |
> 02: Add(ZeroExtend(Truncate(Minus(3,3), i8), i32),3)

This step is wrong. The start value of the addrec is 0.

Dan

>                             |
> 03: Add(ZeroExtend(Truncate(0, i8), i32),3)
>                    |
> 04: Add(ZeroExtend(0, i32),3)
>         |
> 05: Add(0,3)
>     |
> 06: 3
>
> Thanks again.
> Matthew Curtis



More information about the llvm-dev mailing list