summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/CostModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/CostModel.cpp')
-rw-r--r--llvm/lib/Analysis/CostModel.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/CostModel.cpp b/llvm/lib/Analysis/CostModel.cpp
index 898da8d0e8d..8eb5f6857e2 100644
--- a/llvm/lib/Analysis/CostModel.cpp
+++ b/llvm/lib/Analysis/CostModel.cpp
@@ -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;
}
OpenPOWER on IntegriCloud