[ARM64] Fix the cost model for cheap large constants.
authorJuergen Ributzka <juergen@apple.com>
Sat, 12 Apr 2014 02:36:28 +0000 (02:36 +0000)
committerJuergen Ributzka <juergen@apple.com>
Sat, 12 Apr 2014 02:36:28 +0000 (02:36 +0000)
commit940b67465dbd12240dfc3d88288b2da9563ccdd7
tree167a5c72bddeb3a1496031c7e63bca95c95e2881
parent9c9ef05445e4ebaf56e70f61e3fdcabc0ddcffc0
[ARM64] Fix the cost model for cheap large constants.

Originally the cost model would give up for large constants and just return the
maximum cost. This is not what we want for constant hoisting, because some of
these constants are large in bitwidth, but are still cheap to materialize.

This commit fixes the cost model to either return TCC_Free if the cost cannot be
determined, or accurately calculate the cost even for large constants
(bitwidth > 128).

This fixes <rdar://problem/16591573>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206100 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM64/ARM64TargetTransformInfo.cpp
test/Transforms/ConstantHoisting/ARM64/large-immediate.ll