summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-04-18 19:48:03 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-04-18 19:48:03 +0000
commit561edae83424f87ff86f033caf3bef6b0a54d23c (patch)
treeb2406789defffb9d9565a6169dcf100b40a9ee23 /lib
parentd290fa608fe090903f306c10d27a0e181fe6fb3b (diff)
downloadllvm-561edae83424f87ff86f033caf3bef6b0a54d23c.tar.gz
llvm-561edae83424f87ff86f033caf3bef6b0a54d23c.tar.bz2
llvm-561edae83424f87ff86f033caf3bef6b0a54d23c.tar.xz
Remove a couple of redundant copies of SmallVector::operator==.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/BasicAliasAnalysis.cpp17
-rw-r--r--lib/Analysis/CostModel.cpp15
2 files changed, 3 insertions, 29 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index c4ff3eef4d..fe90b84533 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -868,21 +868,6 @@ BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS,
return ModRefResult(AliasAnalysis::getModRefInfo(CS, Loc) & Min);
}
-static bool areVarIndicesEqual(SmallVectorImpl<VariableGEPIndex> &Indices1,
- SmallVectorImpl<VariableGEPIndex> &Indices2) {
- unsigned Size1 = Indices1.size();
- unsigned Size2 = Indices2.size();
-
- if (Size1 != Size2)
- return false;
-
- for (unsigned I = 0; I != Size1; ++I)
- if (Indices1[I] != Indices2[I])
- return false;
-
- return true;
-}
-
/// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP instruction
/// against another pointer. We know that V1 is a GEP, but we don't know
/// anything about V2. UnderlyingV1 is GetUnderlyingObject(GEP1, DL),
@@ -939,7 +924,7 @@ BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
// Same offsets.
if (GEP1BaseOffset == GEP2BaseOffset &&
- areVarIndicesEqual(GEP1VariableIndices, GEP2VariableIndices))
+ GEP1VariableIndices == GEP2VariableIndices)
return NoAlias;
GEP1VariableIndices.clear();
}
diff --git a/lib/Analysis/CostModel.cpp b/lib/Analysis/CostModel.cpp
index 9fe0bfa267..9c2de09f13 100644
--- a/lib/Analysis/CostModel.cpp
+++ b/lib/Analysis/CostModel.cpp
@@ -108,17 +108,6 @@ static TargetTransformInfo::OperandValueKind getOperandInfo(Value *V) {
return OpInfo;
}
-static bool matchMask(SmallVectorImpl<int> &M1, SmallVectorImpl<int> &M2) {
- if (M1.size() != M2.size())
- return false;
-
- for (unsigned i = 0, e = M1.size(); i != e; ++i)
- if (M1[i] != M2[i])
- return false;
-
- return true;
-}
-
static bool matchPairwiseShuffleMask(ShuffleVectorInst *SI, bool IsLeft,
unsigned Level) {
// We don't need a shuffle if we just want to have element 0 in position 0 of
@@ -136,7 +125,7 @@ static bool matchPairwiseShuffleMask(ShuffleVectorInst *SI, bool IsLeft,
Mask[i] = val;
SmallVector<int, 16> ActualMask = SI->getShuffleMask();
- if (!matchMask(Mask, ActualMask))
+ if (Mask != ActualMask)
return false;
return true;
@@ -349,7 +338,7 @@ static bool matchVectorSplittingReduction(const ExtractElementInst *ReduxRoot,
std::fill(&ShuffleMask[MaskStart], ShuffleMask.end(), -1);
SmallVector<int, 16> Mask = Shuffle->getShuffleMask();
- if (!matchMask(ShuffleMask, Mask))
+ if (ShuffleMask != Mask)
return false;
RdxOp = NextRdxOp;