After investigation discussed in D45439, it would seem that the nsw flag restriction is unnecessary in most cases. So the IsInductionVar lambda has been removed, the functionality extracted, and now only require nsw when using eq/ne predicates.
For me it looks fine, but please let me run some tests with this patch. I don't see obvious problem, and if they aren't revealed by this testing, I'll give my approval. It will take few hours.
|933 ↗||(On Diff #142378)|
Never mind, it's checked above. Could have been a dyn_cast on line 923.
|923 ↗||(On Diff #142378)|
Please do affinity check first and take StepRecurrence only if it passes, it will save you some compile time on non-affine phis. Also can be dyn_cast.