Reduce code duplication resulting from the ConstantVector/ConstantDataVector split.

No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2014-02-13 16:48:38 +00:00
parent 7fd806d94a
commit 8ed2c8e99f
3 changed files with 11 additions and 32 deletions

View File

@ -5496,13 +5496,9 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I, unsigned VF) {
// Check for a splat of a constant or for a non uniform vector of constants.
if (isa<ConstantInt>(Op2))
Op2VK = TargetTransformInfo::OK_UniformConstantValue;
else if (ConstantDataVector *CDV = dyn_cast<ConstantDataVector>(Op2)) {
else if (isa<ConstantVector>(Op2) || isa<ConstantDataVector>(Op2)) {
Op2VK = TargetTransformInfo::OK_NonUniformConstantValue;
if (CDV->getSplatValue() != NULL)
Op2VK = TargetTransformInfo::OK_UniformConstantValue;
} else if (ConstantVector *CV = dyn_cast<ConstantVector>(Op2)) {
Op2VK = TargetTransformInfo::OK_NonUniformConstantValue;
if (CV->getSplatValue() != NULL)
if (cast<Constant>(Op2)->getSplatValue() != NULL)
Op2VK = TargetTransformInfo::OK_UniformConstantValue;
}