Teach IVUsers to stop at non-affine expressions unless they are both
authorDan Gohman <gohman@apple.com>
Fri, 1 Jul 2011 22:05:19 +0000 (22:05 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 1 Jul 2011 22:05:19 +0000 (22:05 +0000)
commit71997f303e47343e994fba53814455753eeb7e05
treeab5eb06761b724574b21464f7e2cf0bb2bbe52a2
parentf1ac465b67d5fc11a0d9cd09b98ceb4ffa75dd97
Teach IVUsers to stop at non-affine expressions unless they are both
outside the loop and reducible.

This more completely hides them from LSR, which isn't usually able to
do anything meaningful with non-affine expressions anyway, and this
consequently hides them from SCEVExpander, which is acutely unprepared
for non-affine expressions.

Replace test/CodeGen/X86/lsr-nonaffine.ll with a new test that tests
the new behavior.

This works around the bug in PR10117 / rdar://problem/9633149, and is
generally an improvement besides.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134268 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/IVUsers.cpp
test/CodeGen/X86/lsr-nonaffine.ll