Reduce code duplication resulting from the ConstantVector/ConstantDataVector split.

No intended functionality change.

llvm-svn: 201344
This commit is contained in:
Benjamin Kramer
2014-02-13 16:48:38 +00:00
parent d68aa4c0fc
commit 989b92936c
3 changed files with 11 additions and 32 deletions

View File

@@ -99,17 +99,9 @@ static TargetTransformInfo::OperandValueKind getOperandInfo(Value *V) {
TargetTransformInfo::OK_AnyValue;
// Check for a splat of a constant or for a non uniform vector of constants.
ConstantDataVector *CDV = 0;
if ((CDV = dyn_cast<ConstantDataVector>(V))) {
if (isa<ConstantVector>(V) || isa<ConstantDataVector>(V)) {
OpInfo = TargetTransformInfo::OK_NonUniformConstantValue;
if (CDV->getSplatValue() != NULL)
OpInfo = TargetTransformInfo::OK_UniformConstantValue;
}
ConstantVector *CV = 0;
if ((CV = dyn_cast<ConstantVector>(V))) {
OpInfo = TargetTransformInfo::OK_NonUniformConstantValue;
if (CV->getSplatValue() != NULL)
if (cast<Constant>(V)->getSplatValue() != NULL)
OpInfo = TargetTransformInfo::OK_UniformConstantValue;
}