diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-14 18:15:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-14 18:15:46 +0000 |
commit | 75831904220042260c4faece8507a2807acba47f (patch) | |
tree | 69d0fd5dfad613c79932f7f5c53e2e61a2616cf3 /lib/VMCore/ConstantFold.cpp | |
parent | 50a47e93cebdf22dacb95a6e75a5b803fc4c3e04 (diff) | |
download | external_llvm-75831904220042260c4faece8507a2807acba47f.tar.gz external_llvm-75831904220042260c4faece8507a2807acba47f.tar.bz2 external_llvm-75831904220042260c4faece8507a2807acba47f.zip |
revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index c8292c6d61..1b50c4aa9d 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -150,7 +150,7 @@ static Constant *FoldBitCast(Constant *V, const Type *DestTy) { // This allows for other simplifications (although some of them // can only be handled by Analysis/ConstantFolding.cpp). if (isa<ConstantInt>(V) || isa<ConstantFP>(V)) - return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); + return ConstantExpr::getBitCast(ConstantVector::get(&V, 1), DestPTy); } // Finally, implement bitcast folding now. The code below doesn't handle @@ -873,7 +873,7 @@ Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1, Result.push_back(InElt); } - return ConstantVector::get(Result); + return ConstantVector::get(&Result[0], Result.size()); } Constant *llvm::ConstantFoldExtractValueInstruction(Constant *Agg, @@ -1947,11 +1947,11 @@ Constant *llvm::ConstantFoldCompareInstruction(unsigned short pred, // If we can constant fold the comparison of each element, constant fold // the whole vector comparison. SmallVector<Constant*, 4> ResElts; - // Compare the elements, producing an i1 result or constant expr. - for (unsigned i = 0, e = C1Elts.size(); i != e; ++i) + for (unsigned i = 0, e = C1Elts.size(); i != e; ++i) { + // Compare the elements, producing an i1 result or constant expr. ResElts.push_back(ConstantExpr::getCompare(pred, C1Elts[i], C2Elts[i])); - - return ConstantVector::get(ResElts); + } + return ConstantVector::get(&ResElts[0], ResElts.size()); } if (C1->getType()->isFloatingPointTy()) { |