X86 cost model: Differentiate cost for vector shifts of constants
authorArnold Schwaighofer <aschwaighofer@apple.com>
Thu, 4 Apr 2013 23:26:24 +0000 (23:26 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Thu, 4 Apr 2013 23:26:24 +0000 (23:26 +0000)
commit2537f3c6597bc1b8eb14c76c8f8e7046be41c9ba
tree781143f2b27f08fe01dcfe79e732057fc6847445
parent6bf4f676413b8f7d97aaff289997aab344180957
X86 cost model: Differentiate cost for vector shifts of constants

SSE2 has efficient support for shifts by a scalar. My previous change of making
shifts expensive did not take this into account marking all shifts as expensive.
This would prevent vectorization from happening where it is actually beneficial.

With this change we differentiate between shifts of constants and other shifts.

radar://13576547

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178808 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86TargetTransformInfo.cpp
test/Analysis/CostModel/X86/testshiftashr.ll
test/Analysis/CostModel/X86/testshiftlshr.ll
test/Analysis/CostModel/X86/testshiftshl.ll