forked from OSchip/llvm-project
[llvm] Call *set::insert without checking membership first (NFC)
This commit is contained in:
parent
4271a1ff33
commit
437f960062
|
@ -4910,9 +4910,8 @@ bool AMDGPUAsmParser::ParseDirectiveAMDHSAKernel() {
|
||||||
if (ID == ".end_amdhsa_kernel")
|
if (ID == ".end_amdhsa_kernel")
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (Seen.find(ID) != Seen.end())
|
if (!Seen.insert(ID).second)
|
||||||
return TokError(".amdhsa_ directives cannot be repeated");
|
return TokError(".amdhsa_ directives cannot be repeated");
|
||||||
Seen.insert(ID);
|
|
||||||
|
|
||||||
SMLoc ValStart = getLoc();
|
SMLoc ValStart = getLoc();
|
||||||
int64_t IVal;
|
int64_t IVal;
|
||||||
|
|
|
@ -361,9 +361,8 @@ void A15SDOptimizer::elideCopiesAndPHIs(MachineInstr *MI,
|
||||||
MI = Front.pop_back_val();
|
MI = Front.pop_back_val();
|
||||||
|
|
||||||
// If we have already explored this MachineInstr, ignore it.
|
// If we have already explored this MachineInstr, ignore it.
|
||||||
if (Reached.find(MI) != Reached.end())
|
if (!Reached.insert(MI).second)
|
||||||
continue;
|
continue;
|
||||||
Reached.insert(MI);
|
|
||||||
if (MI->isPHI()) {
|
if (MI->isPHI()) {
|
||||||
for (unsigned I = 1, E = MI->getNumOperands(); I != E; I += 2) {
|
for (unsigned I = 1, E = MI->getNumOperands(); I != E; I += 2) {
|
||||||
Register Reg = MI->getOperand(I).getReg();
|
Register Reg = MI->getOperand(I).getReg();
|
||||||
|
|
|
@ -124,9 +124,8 @@ bool BPFMIPeephole::isPhiFrom32Def(MachineInstr *PhiMI)
|
||||||
if (!PhiDef)
|
if (!PhiDef)
|
||||||
return false;
|
return false;
|
||||||
if (PhiDef->isPHI()) {
|
if (PhiDef->isPHI()) {
|
||||||
if (PhiInsns.find(PhiDef) != PhiInsns.end())
|
if (!PhiInsns.insert(PhiDef).second)
|
||||||
return false;
|
return false;
|
||||||
PhiInsns.insert(PhiDef);
|
|
||||||
if (!isPhiFrom32Def(PhiDef))
|
if (!isPhiFrom32Def(PhiDef))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -144,9 +143,8 @@ bool BPFMIPeephole::isInsnFrom32Def(MachineInstr *DefInsn)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (DefInsn->isPHI()) {
|
if (DefInsn->isPHI()) {
|
||||||
if (PhiInsns.find(DefInsn) != PhiInsns.end())
|
if (!PhiInsns.insert(DefInsn).second)
|
||||||
return false;
|
return false;
|
||||||
PhiInsns.insert(DefInsn);
|
|
||||||
if (!isPhiFrom32Def(DefInsn))
|
if (!isPhiFrom32Def(DefInsn))
|
||||||
return false;
|
return false;
|
||||||
} else if (DefInsn->getOpcode() == BPF::COPY) {
|
} else if (DefInsn->getOpcode() == BPF::COPY) {
|
||||||
|
|
|
@ -1526,9 +1526,8 @@ void BTFDebug::processFuncPrototypes(const Function *F) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Do not emit again if already emitted.
|
// Do not emit again if already emitted.
|
||||||
if (ProtoFunctions.find(F) != ProtoFunctions.end())
|
if (!ProtoFunctions.insert(F).second)
|
||||||
return;
|
return;
|
||||||
ProtoFunctions.insert(F);
|
|
||||||
|
|
||||||
uint32_t ProtoTypeId;
|
uint32_t ProtoTypeId;
|
||||||
const std::unordered_map<uint32_t, StringRef> FuncArgNames;
|
const std::unordered_map<uint32_t, StringRef> FuncArgNames;
|
||||||
|
|
|
@ -367,8 +367,7 @@ void GenerateCaseForVersionedClauses(const std::vector<Record *> &Clauses,
|
||||||
|
|
||||||
const auto ClauseFormattedName = VerClause.getClause().getFormattedName();
|
const auto ClauseFormattedName = VerClause.getClause().getFormattedName();
|
||||||
|
|
||||||
if (Cases.find(ClauseFormattedName) == Cases.end()) {
|
if (Cases.insert(ClauseFormattedName).second) {
|
||||||
Cases.insert(ClauseFormattedName);
|
|
||||||
OS << " case " << DirLang.getClausePrefix() << ClauseFormattedName
|
OS << " case " << DirLang.getClausePrefix() << ClauseFormattedName
|
||||||
<< ":\n";
|
<< ":\n";
|
||||||
OS << " return " << VerClause.getMinVersion()
|
OS << " return " << VerClause.getMinVersion()
|
||||||
|
|
Loading…
Reference in New Issue