diff options
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp')
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp index ccaf1aac1ce0..2d49fa369642 100644 --- a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp +++ b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp @@ -192,10 +192,8 @@ private: void push_back(Value *V) { // Do not push back duplicates. - if (!S.count(V)) { + if (S.insert(V).second) Q.push_back(V); - S.insert(V); - } } Value *pop_front_val() { @@ -1152,9 +1150,8 @@ bool PolynomialMultiplyRecognize::findCycle(Value *Out, Value *In, if (IsPhi && HadPhi) return false; HadPhi |= IsPhi; - if (Cycle.count(I)) + if (!Cycle.insert(I)) return false; - Cycle.insert(I); if (findCycle(I, In, Cycle)) break; Cycle.remove(I); @@ -1487,7 +1484,7 @@ bool PolynomialMultiplyRecognize::convertShiftsToLeft(BasicBlock *LoopB, void PolynomialMultiplyRecognize::cleanupLoopBody(BasicBlock *LoopB) { for (auto &I : *LoopB) - if (Value *SV = SimplifyInstruction(&I, {DL, &TLI, &DT})) + if (Value *SV = simplifyInstruction(&I, {DL, &TLI, &DT})) I.replaceAllUsesWith(SV); for (Instruction &I : llvm::make_early_inc_range(*LoopB)) @@ -2169,7 +2166,7 @@ CleanupAndExit: SCEV::FlagNUW); Value *NumBytes = Expander.expandCodeFor(NumBytesS, IntPtrTy, ExpPt); if (Instruction *In = dyn_cast<Instruction>(NumBytes)) - if (Value *Simp = SimplifyInstruction(In, {*DL, TLI, DT})) + if (Value *Simp = simplifyInstruction(In, {*DL, TLI, DT})) NumBytes = Simp; CallInst *NewCall; @@ -2279,7 +2276,7 @@ CleanupAndExit: Value *NumWords = Expander.expandCodeFor(NumWordsS, Int32Ty, MemmoveB->getTerminator()); if (Instruction *In = dyn_cast<Instruction>(NumWords)) - if (Value *Simp = SimplifyInstruction(In, {*DL, TLI, DT})) + if (Value *Simp = simplifyInstruction(In, {*DL, TLI, DT})) NumWords = Simp; Value *Op0 = (StoreBasePtr->getType() == Int32PtrTy) |
