Thanks - that does help. I didn't realise the earlier code put the `trunc` in too - that's what's preventing the GVN pass from removing the loop entirely. I'm looking forward to your unsigned patch - then the generated IR for my example will be much better :)