diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-10-21 19:11:34 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-10-21 19:11:34 +0000 |
commit | 303c81c773eca7f11b3d59a9285ec30a3bbaca08 (patch) | |
tree | 28472f7b25e4e05b0871310af4166f34d636bd79 /llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | |
parent | ce818277fc8779adc6e3dbf47b6aed2f7d4e4b3d (diff) | |
download | bcm5719-llvm-303c81c773eca7f11b3d59a9285ec30a3bbaca08.tar.gz bcm5719-llvm-303c81c773eca7f11b3d59a9285ec30a3bbaca08.zip |
Minor simplification: use ShuffleVectorInst::getMaskValue instead of a more expensive helper.
llvm-svn: 142672
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp index 6dcfa0ddd29..0995d467223 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -108,7 +108,7 @@ static Value *FindScalarElement(Value *V, unsigned EltNo) { if (ShuffleVectorInst *SVI = dyn_cast<ShuffleVectorInst>(V)) { unsigned LHSWidth = cast<VectorType>(SVI->getOperand(0)->getType())->getNumElements(); - int InEl = getShuffleMask(SVI)[EltNo]; + int InEl = SVI->getMaskValue(EltNo); if (InEl < 0) return UndefValue::get(PTy->getElementType()); if (InEl < (int)LHSWidth) @@ -212,7 +212,7 @@ Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) { // If this is extracting an element from a shufflevector, figure out where // it came from and extract from the appropriate input element instead. if (ConstantInt *Elt = dyn_cast<ConstantInt>(EI.getOperand(1))) { - int SrcIdx = getShuffleMask(SVI)[Elt->getZExtValue()]; + int SrcIdx = SVI->getMaskValue(Elt->getZExtValue()); Value *Src; unsigned LHSWidth = cast<VectorType>(SVI->getOperand(0)->getType())->getNumElements(); |