llvm.org GIT mirror llvm / 561edae
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 Benjamin Kramer 6 years ago
3 changed file(s) with 4 addition(s) and 35 deletion(s). Raw diff Collapse all Expand all
695695 }
696696
697697 inline bool operator==(const _Self& x) const {
698 if (stack.size() != x.stack.size())
699 return false;
700 for (unsigned i = 0 ; i < stack.size(); i++)
701 if (stack[i] != x.stack[i])
702 return false;
703 return true;
698 return stack == x.stack;
704699 }
705700
706701 inline bool operator!=(const _Self& x) const { return !operator==(x); }
867867 return ModRefResult(AliasAnalysis::getModRefInfo(CS, Loc) & Min);
868868 }
869869
870 static bool areVarIndicesEqual(SmallVectorImpl &Indices1,
871 SmallVectorImpl &Indices2) {
872 unsigned Size1 = Indices1.size();
873 unsigned Size2 = Indices2.size();
874
875 if (Size1 != Size2)
876 return false;
877
878 for (unsigned I = 0; I != Size1; ++I)
879 if (Indices1[I] != Indices2[I])
880 return false;
881
882 return true;
883 }
884
885870 /// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP instruction
886871 /// against another pointer. We know that V1 is a GEP, but we don't know
887872 /// anything about V2. UnderlyingV1 is GetUnderlyingObject(GEP1, DL),
938923
939924 // Same offsets.
940925 if (GEP1BaseOffset == GEP2BaseOffset &&
941 areVarIndicesEqual(GEP1VariableIndices, GEP2VariableIndices))
926 GEP1VariableIndices == GEP2VariableIndices)
942927 return NoAlias;
943928 GEP1VariableIndices.clear();
944929 }
107107 return OpInfo;
108108 }
109109
110 static bool matchMask(SmallVectorImpl &M1, SmallVectorImpl &M2) {
111 if (M1.size() != M2.size())
112 return false;
113
114 for (unsigned i = 0, e = M1.size(); i != e; ++i)
115 if (M1[i] != M2[i])
116 return false;
117
118 return true;
119 }
120
121110 static bool matchPairwiseShuffleMask(ShuffleVectorInst *SI, bool IsLeft,
122111 unsigned Level) {
123112 // We don't need a shuffle if we just want to have element 0 in position 0 of
135124 Mask[i] = val;
136125
137126 SmallVector ActualMask = SI->getShuffleMask();
138 if (!matchMask(Mask, ActualMask))
127 if (Mask != ActualMask)
139128 return false;
140129
141130 return true;
348337 std::fill(&ShuffleMask[MaskStart], ShuffleMask.end(), -1);
349338
350339 SmallVector Mask = Shuffle->getShuffleMask();
351 if (!matchMask(ShuffleMask, Mask))
340 if (ShuffleMask != Mask)
352341 return false;
353342
354343 RdxOp = NextRdxOp;