[LLVMdev] Rotated loop identification

Michele Scandale michele.scandale at gmail.com
Thu Feb 7 10:53:02 PST 2013


> Thanks for the details. Please add them to a bug report.

I will do this.

> InstCombine is certainly interfering with our ability to analyze the loop. I think the problem is that ScalarEvolution cannot reason about signed division. This is a general problem independent of your target. At the moment I'm not sure if we can teach ScalarEvolution to reason about this, or if we can defer certain InstCombine's until after loop passes run, including target-specific loop passes (it's hard for me to say whether this InstCombine really a necessary canonicalization before other passes). A bug report would be appropriate.

It sounds to me that the same capabilities of InstCombine should be implemented
also in the ScalarEvolution.

> Absent a fix for the above problem, it is certainly possible for you to add target-specific intrinsics. I can't guarantee that it won't interfere with optimization. It might also be possible to add metadata to the loop exit branch when it is cloned by LoopRotate, indicating that the loop is guarded by the same condition. I don't think we want something like this on trunk though since it is a heavy-handed workaround that could be hard to maintain.

Following also the proposal 'Parallel Loop Metadata' it seems to me that
basically there's the same problem. Maybe I've not fully understood the things
but, assuming to have the ability to map metadata to BasicBlocks then such
informations could be registered directly to the loop header or latch, without
custom intrinsics and hopefully without interfering with the optimizer.

What do you think about this?

Thanks again.

Best regards,
Michele Scandale



More information about the llvm-dev mailing list