From 093399cbf3bcdb31d04b3bf5c5691fc88c25da48 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Thu, 17 Feb 2011 21:22:27 +0000 Subject: Enhance constant folding of bitcast operations on vectors of floats. Add getAllOnesValue of FP numbers to Constants and APFloat. Add more tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125776 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/ConstantFold.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/VMCore/ConstantFold.cpp') diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index c8292c6d61..573efb7e57 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -43,8 +43,7 @@ using namespace llvm; static Constant *BitCastConstantVector(ConstantVector *CV, const VectorType *DstTy) { - if (CV->isAllOnesValue() && DstTy->getElementType()->isIntegerTy()) - return Constant::getAllOnesValue(DstTy); + if (CV->isAllOnesValue()) return Constant::getAllOnesValue(DstTy); if (CV->isNullValue()) return Constant::getNullValue(DstTy); // If this cast changes element count then we can't handle it here: -- cgit v1.2.3