Fixing [PR52170]
The following commit (https://github.com/llvm/llvm-project/commit/7086025d6567562d31fadbaccf08b4fd72ec2100) enabled delinearization of fixed sized arrays. It is now possible to propagate SIV constraints to coupled subscripts in more cases, resulting in more accurate dependence analysis. When a SIV constraint is propagated we re-classify the other non-SIV subscripts. PR52170 describes a case where we hit buggy, superfluous code when doing this reclassification. This change removes this superfluous code.
The original purpose of the removed code (in checkSubscript()) was to make sure that checkUpperBound() was never called on loops whose index variable may overflow. The removed code was superfluous as checkSubscript() works on perfectly nested AddRecs. If a loop can overflow no AddRec can be created and hence checkSubscript() will return that the subscript in NonLinear, as it should.
Changes:
- Removed superfluous code from checkSubscript()
- Added a new LIT test to test that DA reports conservative dependencies when it cannot be determined if overflow will happen in the AddRec
Shouldn't %n be changed to i64 (while keeping %i as i32) so this test is more representative of the condition check being removed?