When doing address-mode sinking, expand the base register first, rather
authorDan Gohman <gohman@apple.com>
Tue, 19 Jan 2010 22:45:06 +0000 (22:45 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 19 Jan 2010 22:45:06 +0000 (22:45 +0000)
commitd8d0b6a42c09f1c5b00a4e7029b08074a3da5acd
treea5c5aae0913e5c78fc57fb350dbcb630f183c283
parentc7b8814bb4f2e6052060d6118d3bc3b66f5c5b0b
When doing address-mode sinking, expand the base register first, rather
than the scaled register. This makes it more likely that subsequent
AddrModeMatcher queries will match the new address the same way as the
old, instead of accidentally matching what had been the base register
as the new scaled register, and then failing to match the scaled register.
This fixes some problems with address-mode sinking multiple muls into a
block, which will be a lot more common with some upcoming
LoopStrengthReduction changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93935 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/CodeGenPrepare.cpp