Skip to content

[llvm] Remove unused local variables (NFC) #138467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ static void computeFunctionSummary(
auto *MemProfMD = I.getMetadata(LLVMContext::MD_memprof);
if (MemProfMD) {
std::vector<MIBInfo> MIBs;
std::vector<uint64_t> TotalSizes;
std::vector<std::vector<ContextTotalSize>> ContextSizeInfos;
for (auto &MDOp : MemProfMD->operands()) {
auto *MIBMD = cast<const MDNode>(MDOp);
Expand Down
5 changes: 0 additions & 5 deletions llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15197,10 +15197,7 @@ SDValue DAGCombiner::visitSIGN_EXTEND_INREG(SDNode *N) {
if (ISD::isExtVecInRegOpcode(N0.getOpcode())) {
SDValue N00 = N0.getOperand(0);
unsigned N00Bits = N00.getScalarValueSizeInBits();
unsigned DstElts = N0.getValueType().getVectorMinNumElements();
unsigned SrcElts = N00.getValueType().getVectorMinNumElements();
bool IsZext = N0.getOpcode() == ISD::ZERO_EXTEND_VECTOR_INREG;
APInt DemandedSrcElts = APInt::getLowBitsSet(SrcElts, DstElts);
if ((N00Bits == ExtVTBits ||
(!IsZext && (N00Bits < ExtVTBits ||
DAG.ComputeMaxSignificantBits(N00) <= ExtVTBits))) &&
Expand Down Expand Up @@ -20772,8 +20769,6 @@ SDValue DAGCombiner::TransformFPLoadStorePair(SDNode *N) {
// We're checking for cases where we have common "c3 * A" expressions.
bool DAGCombiner::isMulAddWithConstProfitable(SDNode *MulNode, SDValue AddNode,
SDValue ConstNode) {
APInt Val;

// If the add only has one use, and the target thinks the folding is
// profitable or does not lead to worse code, this would be OK to do.
if (AddNode->hasOneUse() &&
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7965,7 +7965,6 @@ bool TargetLowering::expandDIVREMByConstant(SDNode *N,
// If we shifted the input, shift the remainder left and add the bits we
// shifted off the input.
if (TrailingZeros) {
APInt Mask = APInt::getLowBitsSet(HBitWidth, TrailingZeros);
RemL = DAG.getNode(ISD::SHL, dl, HiLoVT, RemL,
DAG.getShiftAmountConstant(TrailingZeros, HiLoVT, dl));
RemL = DAG.getNode(ISD::ADD, dl, HiLoVT, RemL, PartialRem);
Expand Down
4 changes: 0 additions & 4 deletions llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,6 @@ unsigned DWARFVerifier::verifyUnitSection(const DWARFSection &S) {
bool hasDIE = DebugInfoData.isValidOffset(Offset);
DWARFUnitVector TypeUnitVector;
DWARFUnitVector CompileUnitVector;
/// A map that tracks all references (converted absolute references) so we
/// can verify each reference points to a valid DIE and not an offset that
/// lies between to valid DIEs.
ReferenceMap CrossUnitReferences;
while (hasDIE) {
if (!verifyUnitHeader(DebugInfoData, &Offset, UnitIdx, UnitType,
isUnitDWARF64)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ Error SimpleRemoteEPCServer::sendSetupMessage(

using namespace SimpleRemoteEPCDefaultBootstrapSymbolNames;

std::vector<char> SetupPacket;
SimpleRemoteEPCExecutorInfo EI;
EI.TargetTriple = sys::getProcessTriple();
if (auto PageSize = sys::Process::getPageSize())
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/ObjCopy/wasm/WasmReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Expected<std::unique_ptr<Object>> Reader::create() const {
auto Obj = std::make_unique<Object>();
Obj->Header = WasmObj.getHeader();
Obj->isRelocatableObject = WasmObj.isRelocatableObject();
std::vector<Section> Sections;
Obj->Sections.reserve(WasmObj.getNumSections());
for (const SectionRef &Sec : WasmObj.sections()) {
const WasmSection &WS = WasmObj.getWasmSection(Sec);
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,6 @@ bool SIShrinkInstructions::run(MachineFunction &MF) {

unsigned VCCReg = ST->isWave32() ? AMDGPU::VCC_LO : AMDGPU::VCC;

std::vector<unsigned> I1Defs;

for (MachineFunction::iterator BI = MF.begin(), BE = MF.end();
BI != BE; ++BI) {

Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Target/ARM/ARMSubtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,6 @@ ARMSubtarget::PushPopSplitVariation
ARMSubtarget::getPushPopSplitVariation(const MachineFunction &MF) const {
const Function &F = MF.getFunction();
const MachineFrameInfo &MFI = MF.getFrameInfo();
const std::vector<CalleeSavedInfo> CSI =
MF.getFrameInfo().getCalleeSavedInfo();

// Thumb1 always splits the pushes at R7, because the Thumb1 push instruction
// cannot use high registers except for lr.
Expand Down
6 changes: 0 additions & 6 deletions llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1323,12 +1323,6 @@ void HCE::assignInits(const ExtRoot &ER, unsigned Begin, unsigned End,
// Select the definition points, and generate the assignment between
// these points and the uses.

// For each candidate offset, keep a pair CandData consisting of
// the total number of ranges containing that candidate, and the
// vector of corresponding RangeTree nodes.
using CandData = std::pair<unsigned, SmallVector<RangeTree::Node*,8>>;
std::map<int32_t, CandData> CandMap;

RangeTree Tree;
for (const OffsetRange &R : Ranges)
Tree.add(R);
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Transforms/IPO/IROutliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,6 @@ void IROutliner::deduplicateExtractedSections(
fillOverallFunction(M, CurrentGroup, OutputStoreBBs, FuncsToRemove,
OutputMappings);

std::vector<Value *> SortedKeys;
for (unsigned Idx = 1; Idx < CurrentGroup.Regions.size(); Idx++) {
CurrentOS = CurrentGroup.Regions[Idx];
AttributeFuncs::mergeAttributesForOutlining(*CurrentGroup.OutlinedFunction,
Expand Down
1 change: 0 additions & 1 deletion llvm/tools/sancov/sancov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,6 @@ static void printNotCoveredFunctions(const SymbolizedCoverage &CovData,
// Read list of files and merges their coverage info.
static void readAndPrintRawCoverage(const std::vector<std::string> &FileNames,
raw_ostream &OS) {
std::vector<std::unique_ptr<RawCoverage>> Covs;
for (const auto &FileName : FileNames) {
auto Cov = RawCoverage::read(FileName);
if (!Cov)
Expand Down
1 change: 0 additions & 1 deletion llvm/unittests/DebugInfo/CodeView/TypeHashingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ TEST(TypeHashingTest, ContentHash) {
// LF_PROCEDURE 0x1004 {int** func(char**, int***)}
// ArgList = 0x1003
// ReturnType = 0x1001
std::vector<GloballyHashedType> Ordering1Hashes;
CharPP[0] = createPointerRecord(Ordering1, CharP);
IntPP[0] = createPointerRecord(Ordering1, IntP);
IntPPP[0] = createPointerRecord(Ordering1, IntPP[0]);
Expand Down
2 changes: 0 additions & 2 deletions llvm/unittests/XRay/GraphTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ template <typename T> void graphVertexTester(T &G) {
}

template <typename T> void graphEdgeTester(T &G) {
std::set<unsigned> V({1u, 2u, 3u, 4u, 5u, 6u});

std::set<std::pair<unsigned, unsigned>> E(
{{1u, 2u}, {2u, 3u}, {6u, 3u}, {4u, 6u}, {2u, 4u}, {2u, 5u}, {4u, 5u}});
std::vector<unsigned> VA({0u, 3u, 5u, 7u, 11u, 13u, 17u});
Expand Down
3 changes: 0 additions & 3 deletions llvm/utils/TableGen/AsmWriterEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,6 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
DenseMap<const Record *, unsigned> MCOpPredicateMap;

for (auto &Aliases : AliasMap) {
// Collection of instruction alias rules. May contain ambiguous rules.
std::vector<IAPrinter> IAPs;

for (auto &Alias : Aliases.second) {
const CodeGenInstAlias &CGA = Alias.first;
unsigned LastOpNo = CGA.ResultInstOperandIndex.size();
Expand Down
1 change: 0 additions & 1 deletion llvm/utils/TableGen/DFAEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ void DfaEmitter::emit(StringRef Name, raw_ostream &OS) {
OS << "// to by index in " << Name << "Transitions[].\n";

SequenceToOffsetTable<DfaTransitionInfo> Table;
std::map<DfaTransitionInfo, unsigned> EmittedIndices;
for (auto &T : DfaTransitions)
Table.add(T.second.second);
Table.layout();
Expand Down
1 change: 0 additions & 1 deletion llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,6 @@ void CombineRuleOperandTypeChecker::getInstEqClasses(

CombineRuleOperandTypeChecker::TypeEquivalenceClasses
CombineRuleOperandTypeChecker::getRuleEqClasses() const {
StringMap<unsigned> OpNameToEqClassIdx;
TypeEquivalenceClasses TECs;

if (DebugTypeInfer)
Expand Down