LSR: Fix the parameters used to compute the scaling factor cost.
authorQuentin Colombet <qcolombet@apple.com>
Wed, 19 Jun 2013 19:59:41 +0000 (19:59 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Wed, 19 Jun 2013 19:59:41 +0000 (19:59 +0000)
commit5a2fb058d3628063cacc3dda0cda331c8d4dab11
tree48c8684cae8e901efe9c6fd4e984e69bed1fd596
parentae5758bac75f561f8aa519476942e02be73022e4
LSR: Fix the parameters used to compute the scaling factor cost.

Prior to this change, the considered addressing modes may be invalid since the
maximum and minimum offsets were not taking into account.
This was causing an assertion failure.

The added test case exercices that behavior.

<rdar://problem/14199725> Assertion failed: (CurScaleCost >= 0 && "Legal
addressing mode has an illegal cost!")

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184341 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp
test/Transforms/LoopStrengthReduce/scaling_factor_cost_crash.ll [new file with mode: 0644]