aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-10-21 19:11:34 +0000
committerStephen Hines <srhines@google.com>2011-11-14 09:11:01 -0800
commit9c8021eb096dc41b1e0c1744aa1c8069920abe74 (patch)
tree8947217a701ec62ac540902988022dcf49ebb71a /lib/Transforms/InstCombine/InstCombineVectorOps.cpp
parentb5396d68fe4392651cae48e4b63d6acb6731a617 (diff)
downloadexternal_llvm-9c8021eb096dc41b1e0c1744aa1c8069920abe74.tar.gz
external_llvm-9c8021eb096dc41b1e0c1744aa1c8069920abe74.tar.bz2
external_llvm-9c8021eb096dc41b1e0c1744aa1c8069920abe74.zip
Minor simplification: use ShuffleVectorInst::getMaskValue instead of a more expensive helper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142672 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineVectorOps.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineVectorOps.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 6dcfa0ddd2..0995d46722 100644
--- a/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/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();