Skip to content

Commit 7dc3575

Browse files
[llvm] Remove redundant return and continue statements (NFC)
Identified with readability-redundant-control-flow.
1 parent 2efcbe2 commit 7dc3575

29 files changed

+0
-37
lines changed

llvm/include/llvm/CodeGen/LiveRegUnits.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class LiveRegUnits {
6767
UsedRegUnits.addReg(Reg);
6868
}
6969
}
70-
return;
7170
}
7271

7372
/// Initialize and clear the set.

llvm/lib/CodeGen/MachinePipeliner.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,6 @@ void SwingSchedulerDAG::checkNodeSets(NodeSetType &NodeSets) {
17511751
}
17521752
NodeSets.clear();
17531753
LLVM_DEBUG(dbgs() << "Clear recurrence node-sets\n");
1754-
return;
17551754
}
17561755

17571756
/// Add the nodes that do not belong to a recurrence set into groups

llvm/lib/Demangle/MicrosoftDemangleNodes.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,5 +649,4 @@ void SpecialTableSymbolNode::output(OutputStream &OS, OutputFlags Flags) const {
649649
TargetName->output(OS, Flags);
650650
OS << "'}";
651651
}
652-
return;
653652
}

llvm/lib/FileCheck/FileCheck.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,6 @@ bool FileCheckString::CheckNot(const SourceMgr &SM, StringRef Buffer,
23182318
PrintMatch(false, SM, Prefix, Pat->getLoc(), *Pat, 1, Buffer, Pos, MatchLen,
23192319
Req, Diags);
23202320
DirectiveFail = true;
2321-
continue;
23222321
}
23232322

23242323
return DirectiveFail;

llvm/lib/IR/AutoUpgrade.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,6 @@ void llvm::UpgradeInlineAsmString(std::string *AsmStr) {
17691769
(Pos = AsmStr->find("# marker")) != std::string::npos) {
17701770
AsmStr->replace(Pos, 1, ";");
17711771
}
1772-
return;
17731772
}
17741773

17751774
/// Upgrade a call to an old intrinsic. All argument and return casting must be

llvm/lib/Passes/StandardInstrumentations.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ void PrintIRInstrumentation::printBeforePass(StringRef PassID, Any IR) {
501501

502502
SmallString<20> Banner = formatv("*** IR Dump Before {0} ***", PassID);
503503
unwrapAndPrint(dbgs(), IR, Banner, forcePrintModuleIR());
504-
return;
505504
}
506505

507506
void PrintIRInstrumentation::printAfterPass(StringRef PassID, Any IR) {

llvm/lib/Support/Unix/Path.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,6 @@ void expand_tilde(const Twine &path, SmallVectorImpl<char> &dest) {
685685

686686
path.toVector(dest);
687687
expandTildeExpr(dest);
688-
689-
return;
690688
}
691689

692690
static file_type typeForMode(mode_t Mode) {

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3955,7 +3955,6 @@ void selectGatherScatterAddrMode(SDValue &BasePtr, SDValue &Index, EVT MemVT,
39553955
Opcode = NewOp;
39563956
BasePtr = Index->getOperand(0);
39573957
Index = ConstOffset;
3958-
return;
39593958
}
39603959

39613960
SDValue AArch64TargetLowering::LowerMGATHER(SDValue Op,

llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,6 @@ void AArch64InstructionSelector::materializeLargeCMVal(
18731873
AArch64II::MO_G1 | AArch64II::MO_NC, 16, 0);
18741874
DstReg = BuildMovK(DstReg, AArch64II::MO_G2 | AArch64II::MO_NC, 32, 0);
18751875
BuildMovK(DstReg, AArch64II::MO_G3, 48, I.getOperand(0).getReg());
1876-
return;
18771876
}
18781877

18791878
bool AArch64InstructionSelector::preISelLower(MachineInstr &I) {

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ void AMDGPUAsmBackend::relaxInstruction(MCInst &Inst,
5858
Res.setOpcode(RelaxedOpcode);
5959
Res.addOperand(Inst.getOperand(0));
6060
Inst = std::move(Res);
61-
return;
6261
}
6362

6463
bool AMDGPUAsmBackend::fixupNeedsRelaxation(const MCFixup &Fixup,

llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3087,7 +3087,6 @@ class ARMOperand : public MCParsedAsmOperand {
30873087
// This is container for the immediate that we will create the constant
30883088
// pool from
30893089
addExpr(Inst, getConstantPoolImm());
3090-
return;
30913090
}
30923091

30933092
void addMemTBBOperands(MCInst &Inst, unsigned N) const {

llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,6 @@ void MVEGatherScatterLowering::pushOutMul(PHINode *&Phi,
853853
Phi->addIncoming(NewIncrement, Phi->getIncomingBlock(LoopIncrement));
854854
Phi->removeIncomingValue((unsigned)0);
855855
Phi->removeIncomingValue((unsigned)0);
856-
return;
857856
}
858857

859858
// Check whether all usages of this instruction are as offsets of

llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,6 @@ void BPFDAGToDAGISel::PreprocessTrunc(SDNode *Node,
494494
CurDAG->ReplaceAllUsesWith(SDValue(Node, 0), BaseV);
495495
I++;
496496
CurDAG->DeleteNode(Node);
497-
498-
return;
499497
}
500498

501499
FunctionPass *llvm::createBPFISelDag(BPFTargetMachine &TM) {

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13805,7 +13805,6 @@ static void fixupShuffleMaskForPermutedSToV(SmallVectorImpl<int> &ShuffV,
1380513805
if ((Idx >= 0 && Idx < LHSMaxIdx) || (Idx >= RHSMinIdx && Idx < RHSMaxIdx))
1380613806
ShuffV[i] += HalfVec;
1380713807
}
13808-
return;
1380913808
}
1381013809

1381113810
// Replace a SCALAR_TO_VECTOR with a SCALAR_TO_VECTOR_PERMUTED except if

llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ void RISCVInstPrinter::printAtomicMemOp(const MCInst *MI, unsigned OpNo,
165165
O << "(";
166166
printRegName(O, MO.getReg());
167167
O << ")";
168-
return;
169168
}
170169

171170
void RISCVInstPrinter::printVTypeI(const MCInst *MI, unsigned OpNo,

llvm/lib/Target/X86/X86FlagsCopyLowering.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,5 +981,4 @@ void X86FlagsCopyLoweringPass::rewriteSetCC(MachineBasicBlock &TestMBB,
981981
MIB.setMemRefs(SetCCI.memoperands());
982982

983983
SetCCI.eraseFromParent();
984-
return;
985984
}

llvm/lib/Target/X86/X86IndirectThunks.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ struct LVIThunkInserter : ThunkInserter<LVIThunkInserter> {
9595
BuildMI(&MF.front(), DebugLoc(), TII->get(X86::LFENCE));
9696
BuildMI(&MF.front(), DebugLoc(), TII->get(X86::JMP64r)).addReg(X86::R11);
9797
MF.front().addLiveIn(X86::R11);
98-
return;
9998
}
10099
};
101100

llvm/lib/TextAPI/MachO/InterfaceFile.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ void InterfaceFile::addParentUmbrella(const Target &Target_, StringRef Parent) {
6969
}
7070

7171
ParentUmbrellas.emplace(Iter, Target_, std::string(Parent));
72-
return;
7372
}
7473

7574
void InterfaceFile::addUUID(const Target &Target_, StringRef UUID) {
@@ -83,7 +82,6 @@ void InterfaceFile::addUUID(const Target &Target_, StringRef UUID) {
8382
}
8483

8584
UUIDs.emplace(Iter, Target_, std::string(UUID));
86-
return;
8785
}
8886

8987
void InterfaceFile::addUUID(const Target &Target, uint8_t UUID[16]) {

llvm/lib/Transforms/Coroutines/CoroFrame.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,8 +2011,6 @@ static void sinkSpillUsesAfterCoroBegin(Function &F,
20112011
Instruction *InsertPt = CoroBegin->getNextNode();
20122012
for (Instruction *Inst : InsertionList)
20132013
Inst->moveBefore(InsertPt);
2014-
2015-
return;
20162014
}
20172015

20182016
/// For each local variable that all of its user are only used inside one of

llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3499,7 +3499,6 @@ struct AADereferenceableImpl : AADereferenceable {
34993499
State.addAccessedBytes(Offset, Size);
35003500
}
35013501
}
3502-
return;
35033502
}
35043503

35053504
/// See followUsesInMBEC

llvm/lib/Transforms/IPO/IROutliner.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,8 +1127,6 @@ void createSwitchStatement(Module &M, OutlinableGroup &OG, BasicBlock *EndBB,
11271127
Term->moveBefore(*EndBB, EndBB->end());
11281128
OutputBlock->eraseFromParent();
11291129
}
1130-
1131-
return;
11321130
}
11331131

11341132
/// Fill the new function that will serve as the replacement function for all of

llvm/lib/Transforms/IPO/OpenMPOpt.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,6 @@ struct OpenMPOpt {
11341134

11351135
RFI.foreachUse(SCC, CheckGlobalization);
11361136
}
1137-
return;
11381137
}
11391138

11401139
/// Maps the values stored in the offload arrays passed as arguments to

llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,6 +2214,4 @@ void DevirtIndex::run() {
22142214
if (PrintSummaryDevirt)
22152215
for (const auto &DT : DevirtTargets)
22162216
errs() << "Devirtualized call to " << DT << "\n";
2217-
2218-
return;
22192217
}

llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1809,7 +1809,6 @@ class LowerMatrixIntrinsics {
18091809

18101810
for (Value *Op : cast<Instruction>(V)->operand_values())
18111811
collectSharedInfo(Leaf, Op, ExprsInSubprogram, Shared);
1812-
return;
18131812
}
18141813

18151814
/// Calculate the number of exclusive and shared op counts for expression

llvm/tools/llvm-mca/CodeRegion.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ void CodeRegions::beginRegion(StringRef Description, SMLoc Loc) {
6363

6464
ActiveRegions[Description] = Regions.size();
6565
Regions.emplace_back(std::make_unique<CodeRegion>(Description, Loc));
66-
return;
6766
}
6867

6968
void CodeRegions::endRegion(StringRef Description, SMLoc Loc) {

llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,6 @@ void DumpOutputStyle::dumpSectionHeaders(StringRef Label, DbgHeaderType Type) {
19071907
P.getIndentLevel(), Header.Characteristics, 1, ""));
19081908
++I;
19091909
}
1910-
return;
19111910
}
19121911

19131912
Error DumpOutputStyle::dumpSectionContribs() {

llvm/tools/llvm-profdata/llvm-profdata.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,6 @@ static void dumpHotFunctionList(const std::vector<std::string> &ColumnTitle,
22542254
FOS.PadToColumn(ColumnOffset[3]);
22552255
FOS << R.FuncName << "\n";
22562256
}
2257-
return;
22582257
}
22592258

22602259
static int

llvm/tools/llvm-profgen/ProfiledBinary.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ void ProfiledBinary::load() {
108108
ProEpilogTracker.inferEpilogOffsets(RetAddrs);
109109

110110
// TODO: decode other sections.
111-
112-
return;
113111
}
114112

115113
bool ProfiledBinary::inlineContextEqual(uint64_t Address1,

llvm/utils/TableGen/X86FoldTablesEmitter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,6 @@ void X86FoldTablesEmitter::updateTables(const CodeGenInstruction *RegInstr,
571571
getRegOperandSize(RegOpRec) == getMemOperandSize(MemOpRec))
572572
addEntryWithFlags(Table0, RegInstr, MemInstr, S, 0);
573573
}
574-
575-
return;
576574
}
577575

578576
void X86FoldTablesEmitter::run(formatted_raw_ostream &OS) {

0 commit comments

Comments
 (0)