If the LHS of the comparison is a loop-invariant we also want to move it
authorWojciech Matyjewicz <wmatyjewicz@fastmail.fm>
Mon, 11 Feb 2008 18:37:34 +0000 (18:37 +0000)
committerWojciech Matyjewicz <wmatyjewicz@fastmail.fm>
Mon, 11 Feb 2008 18:37:34 +0000 (18:37 +0000)
commita089b104218c46803a1af374f6c441df885e54c2
tree6a3e33c1f47c3727fe9ff796ae3a1e716f63b69c
parent1f801fa5ada9cb40fb97ae755c282e91af54a1bc
If the LHS of the comparison is a loop-invariant we also want to move it
to the RHS. This simple change allows to compute loop iteration count
for loops with condition similar to the one in the testcase (which seems
to be quite common).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46959 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll [new file with mode: 0644]