[LLVMdev] induction variable computation not preserving scev

Dan Gohman gohman at apple.com
Wed Jan 19 13:01:36 PST 2011


On Jan 18, 2011, at 12:32 AM, Nick Lewycky wrote:

> Hi,
> 
> I tracked down a bug in indvars where we weren't updating SCEV properly. The attached patch shows the fix to this bug with a testcase, but it also causes five new test failures.

Indvars isn't restructuring the loop there, so it ideally shouldn't
need to call forgetLoop(). Offhand, is it possible that the problem
here is the same as the one in PR8037?

> 
> Would someone be willing to take a look at the failures and figure out why we're getting worse output once this patch is applied? If I had to hazard a guess, I'd say that indvars is probably emitting code that can't be analyzed by SCEV as easily as the original.

It's certainly plausible. It's easy to loose track of things like
overflow behavior when folding casts into arithmetic, for example.

Dan





More information about the llvm-dev mailing list