]> granicus.if.org Git - llvm/commit
[LAA] Correctly return a half-open range in expandBounds
authorJames Molloy <james.molloy@arm.com>
Wed, 5 Apr 2017 09:24:26 +0000 (09:24 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 5 Apr 2017 09:24:26 +0000 (09:24 +0000)
commit3a168569fcd4ed97d5dc75d56dd425319f22bce6
tree9a0e11cb3d9d95c5ae155e7c22116e0015c7e304
parentf202abfbd68cee79e5ac2d26958088b3840cc6bc
[LAA] Correctly return a half-open range in expandBounds

This is a latent bug that's been hanging around for a while. For a loop-invariant
pointer, expandBounds would return the range {Ptr, Ptr}, but this was interpreted
as a half-open range, not a closed range. So we ended up planting incorrect
bounds checks. Even worse, they were tautological, so we ended up incorrectly
executing the optimized loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299526 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/LoopAccessAnalysis.cpp
test/Transforms/LoopVersioning/loop-invariant-bound.ll
test/Transforms/LoopVersioningLICM/loopversioningLICM1.ll
test/Transforms/LoopVersioningLICM/loopversioningLICM2.ll