From: Michael Ilseman Date: Wed, 12 Dec 2012 00:21:43 +0000 (+0000) Subject: Remove FIXMEs surrounding Constant[Data]Vectors, instead X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9d61793e69952b65845ffd4d2231a64cff1210d;p=platform%2Fupstream%2Fllvm.git Remove FIXMEs surrounding Constant[Data]Vectors, instead llvm-svn: 169938 --- diff --git a/llvm/include/llvm/Support/PatternMatch.h b/llvm/include/llvm/Support/PatternMatch.h index 36b6db7..09418808 100644 --- a/llvm/include/llvm/Support/PatternMatch.h +++ b/llvm/include/llvm/Support/PatternMatch.h @@ -98,19 +98,13 @@ struct apint_match { Res = &CI->getValue(); return true; } - // FIXME: Remove this. - if (ConstantVector *CV = dyn_cast(V)) - if (ConstantInt *CI = - dyn_cast_or_null(CV->getSplatValue())) { - Res = &CI->getValue(); - return true; - } - if (ConstantDataVector *CV = dyn_cast(V)) - if (ConstantInt *CI = - dyn_cast_or_null(CV->getSplatValue())) { - Res = &CI->getValue(); - return true; - } + if (V->getType()->isVectorTy()) + if (const Constant *C = dyn_cast(V)) + if (ConstantInt *CI = + dyn_cast_or_null(C->getSplatValue())) { + Res = &CI->getValue(); + return true; + } return false; } }; @@ -151,13 +145,11 @@ struct cst_pred_ty : public Predicate { bool match(ITy *V) { if (const ConstantInt *CI = dyn_cast(V)) return this->isValue(CI->getValue()); - // FIXME: Remove this. - if (const ConstantVector *CV = dyn_cast(V)) - if (ConstantInt *CI = dyn_cast_or_null(CV->getSplatValue())) - return this->isValue(CI->getValue()); - if (const ConstantDataVector *CV = dyn_cast(V)) - if (ConstantInt *CI = dyn_cast_or_null(CV->getSplatValue())) - return this->isValue(CI->getValue()); + if (V->getType()->isVectorTy()) + if (const Constant *C = dyn_cast(V)) + if (const ConstantInt *CI = + dyn_cast_or_null(C->getSplatValue())) + return this->isValue(CI->getValue()); return false; } }; @@ -175,21 +167,13 @@ struct api_pred_ty : public Predicate { Res = &CI->getValue(); return true; } - - // FIXME: remove. - if (const ConstantVector *CV = dyn_cast(V)) - if (ConstantInt *CI = dyn_cast_or_null(CV->getSplatValue())) - if (this->isValue(CI->getValue())) { - Res = &CI->getValue(); - return true; - } - - if (const ConstantDataVector *CV = dyn_cast(V)) - if (ConstantInt *CI = dyn_cast_or_null(CV->getSplatValue())) - if (this->isValue(CI->getValue())) { - Res = &CI->getValue(); - return true; - } + if (V->getType()->isVectorTy()) + if (const Constant *C = dyn_cast(V)) + if (ConstantInt *CI = dyn_cast_or_null(C->getSplatValue())) + if (this->isValue(CI->getValue())) { + Res = &CI->getValue(); + return true; + } return false; }