7 changes: 3 additions & 4 deletions llvm/lib/CodeGen/EarlyIfConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,11 @@ class SSAIfConv {
/// Information about each phi in the Tail block.
struct PHIInfo {
MachineInstr *PHI;
unsigned TReg, FReg;
unsigned TReg = 0, FReg = 0;
// Latencies from Cond+Branch, TReg, and FReg to DstReg.
int CondCycles, TCycles, FCycles;
int CondCycles = 0, TCycles = 0, FCycles = 0;

PHIInfo(MachineInstr *phi)
: PHI(phi), TReg(0), FReg(0), CondCycles(0), TCycles(0), FCycles(0) {}
PHIInfo(MachineInstr *phi) : PHI(phi) {}
};

SmallVector<PHIInfo, 8> PHIs;
Expand Down
7 changes: 3 additions & 4 deletions llvm/lib/CodeGen/ExpandMemCmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class MemCmpExpansion {
CallInst *const CI;
ResultBlock ResBlock;
const uint64_t Size;
unsigned MaxLoadSize;
uint64_t NumLoadsNonOneByte;
unsigned MaxLoadSize = 0;
uint64_t NumLoadsNonOneByte = 0;
const uint64_t NumLoadsPerBlockForZeroCmp;
std::vector<BasicBlock *> LoadCmpBlocks;
BasicBlock *EndBlock;
Expand Down Expand Up @@ -219,8 +219,7 @@ MemCmpExpansion::MemCmpExpansion(
const TargetTransformInfo::MemCmpExpansionOptions &Options,
const bool IsUsedForZeroCmp, const DataLayout &TheDataLayout,
DomTreeUpdater *DTU)
: CI(CI), Size(Size), MaxLoadSize(0), NumLoadsNonOneByte(0),
NumLoadsPerBlockForZeroCmp(Options.NumLoadsPerBlock),
: CI(CI), Size(Size), NumLoadsPerBlockForZeroCmp(Options.NumLoadsPerBlock),
IsUsedForZeroCmp(IsUsedForZeroCmp), DL(TheDataLayout), DTU(DTU),
Builder(CI) {
assert(Size > 0 && "zero blocks");
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, LegacyLegalizeAction Action) {
return OS;
}

LegacyLegalizerInfo::LegacyLegalizerInfo() : TablesInitialized(false) {
LegacyLegalizerInfo::LegacyLegalizerInfo() {
// Set defaults.
// FIXME: these two (G_ANYEXT and G_TRUNC?) can be legalized to the
// fundamental load/store Jakob proposed. Once loads & stores are supported.
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/IfConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1211,11 +1211,11 @@ bool IfConverter::FeasibilityAnalysis(BBInfo &BBI,
void IfConverter::AnalyzeBlock(
MachineBasicBlock &MBB, std::vector<std::unique_ptr<IfcvtToken>> &Tokens) {
struct BBState {
BBState(MachineBasicBlock &MBB) : MBB(&MBB), SuccsAnalyzed(false) {}
BBState(MachineBasicBlock &MBB) : MBB(&MBB) {}
MachineBasicBlock *MBB;

/// This flag is true if MBB's successors have been analyzed.
bool SuccsAnalyzed;
bool SuccsAnalyzed = false;
};

// Push MBB to the stack.
Expand Down
9 changes: 4 additions & 5 deletions llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,10 @@ struct VectorInfo {
};

/// Basic-block the load instructions are within
BasicBlock *BB;
BasicBlock *BB = nullptr;

/// Pointer value of all participation load instructions
Value *PV;
Value *PV = nullptr;

/// Participating load instructions
std::set<LoadInst *> LIs;
Expand All @@ -668,16 +668,15 @@ struct VectorInfo {
std::set<Instruction *> Is;

/// Final shuffle-vector instruction
ShuffleVectorInst *SVI;
ShuffleVectorInst *SVI = nullptr;

/// Information of the offset for each vector element
ElementInfo *EI;

/// Vector Type
FixedVectorType *const VTy;

VectorInfo(FixedVectorType *VTy)
: BB(nullptr), PV(nullptr), SVI(nullptr), VTy(VTy) {
VectorInfo(FixedVectorType *VTy) : VTy(VTy) {
EI = new ElementInfo[VTy->getNumElements()];
}

Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class VarLocBasedLDV : public LDVImpl {
EntryValueKind,
EntryValueBackupKind,
EntryValueCopyBackupKind
} EVKind;
} EVKind = EntryValueLocKind::NonEntryValueKind;

/// The value location. Stored separately to avoid repeatedly
/// extracting it from MI.
Expand Down Expand Up @@ -397,8 +397,7 @@ class VarLocBasedLDV : public LDVImpl {
VarLoc(const MachineInstr &MI, LexicalScopes &LS)
: Var(MI.getDebugVariable(), MI.getDebugExpression(),
MI.getDebugLoc()->getInlinedAt()),
Expr(MI.getDebugExpression()), MI(MI),
EVKind(EntryValueLocKind::NonEntryValueKind) {
Expr(MI.getDebugExpression()), MI(MI) {
assert(MI.isDebugValue() && "not a DBG_VALUE");
assert((MI.isDebugValueList() || MI.getNumOperands() == 4) &&
"malformed DBG_VALUE");
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/MachineModuleSlotTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ MachineModuleSlotTracker::MachineModuleSlotTracker(
const MachineFunction *MF, bool ShouldInitializeAllMetadata)
: ModuleSlotTracker(MF->getFunction().getParent(),
ShouldInitializeAllMetadata),
TheFunction(MF->getFunction()), TheMMI(MF->getMMI()), MDNStartSlot(0),
MDNEndSlot(0) {
TheFunction(MF->getFunction()), TheMMI(MF->getMMI()) {
setProcessHook([this](AbstractSlotTrackerStorage *AST, const Module *M,
bool ShouldInitializeAllMetadata) {
this->processMachineModule(AST, M, ShouldInitializeAllMetadata);
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/MachineRegisterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ void MachineRegisterInfo::Delegate::anchor() {}

MachineRegisterInfo::MachineRegisterInfo(MachineFunction *MF)
: MF(MF), TracksSubRegLiveness(MF->getSubtarget().enableSubRegLiveness() &&
EnableSubRegLiveness),
IsUpdatedCSRsInitialized(false) {
EnableSubRegLiveness) {
unsigned NumRegs = getTargetRegisterInfo()->getNumRegs();
VRegInfo.reserve(256);
RegAllocHints.reserve(256);
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/PostRASchedulerList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace {
///
/// This is the instruction number from the top of the current block, not
/// the SlotIndex. It is only used by the AntiDepBreaker.
unsigned EndIndex;
unsigned EndIndex = 0;

public:
SchedulePostRATDList(
Expand Down Expand Up @@ -206,7 +206,7 @@ SchedulePostRATDList::SchedulePostRATDList(
const RegisterClassInfo &RCI,
TargetSubtargetInfo::AntiDepBreakMode AntiDepMode,
SmallVectorImpl<const TargetRegisterClass *> &CriticalPathRCs)
: ScheduleDAGInstrs(MF, &MLI), AA(AA), EndIndex(0) {
: ScheduleDAGInstrs(MF, &MLI), AA(AA) {

const InstrItineraryData *InstrItins =
MF.getSubtarget().getInstrItineraryData();
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace {
SelectionDAG &DAG;
const TargetLowering &TLI;
const SelectionDAGTargetInfo *STI;
CombineLevel Level;
CombineLevel Level = BeforeLegalizeTypes;
CodeGenOpt::Level OptLevel;
bool LegalDAG = false;
bool LegalOperations = false;
Expand Down Expand Up @@ -238,8 +238,7 @@ namespace {
public:
DAGCombiner(SelectionDAG &D, AliasAnalysis *AA, CodeGenOpt::Level OL)
: DAG(D), TLI(D.getTargetLoweringInfo()),
STI(D.getSubtarget().getSelectionDAGInfo()),
Level(BeforeLegalizeTypes), OptLevel(OL), AA(AA) {
STI(D.getSubtarget().getSelectionDAGInfo()), OptLevel(OL), AA(AA) {
ForCodeSize = DAG.shouldOptForSize();
DisableGenericCombines = STI && STI->disableGenericCombines(OptLevel);

Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1838,8 +1838,7 @@ FastISel::FastISel(FunctionLoweringInfo &FuncInfo,
TII(*MF->getSubtarget().getInstrInfo()),
TLI(*MF->getSubtarget().getTargetLowering()),
TRI(*MF->getSubtarget().getRegisterInfo()), LibInfo(LibInfo),
SkipTargetIndependentISel(SkipTargetIndependentISel),
LastLocalValue(nullptr), EmitStartPt(nullptr) {}
SkipTargetIndependentISel(SkipTargetIndependentISel) {}

FastISel::~FastISel() = default;

Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ static cl::opt<int> HighLatencyCycles(
"instructions take for targets with no itinerary"));

ScheduleDAGSDNodes::ScheduleDAGSDNodes(MachineFunction &mf)
: ScheduleDAG(mf), BB(nullptr), DAG(nullptr),
InstrItins(mf.getSubtarget().getInstrItineraryData()) {}
: ScheduleDAG(mf), InstrItins(mf.getSubtarget().getInstrItineraryData()) {}

/// Run - perform scheduling.
///
Expand Down Expand Up @@ -577,7 +576,7 @@ void ScheduleDAGSDNodes::RegDefIter::InitNodeNumDefs() {
// Construct a RegDefIter for this SUnit and find the first valid value.
ScheduleDAGSDNodes::RegDefIter::RegDefIter(const SUnit *SU,
const ScheduleDAGSDNodes *SD)
: SchedDAG(SD), Node(SU->getNode()), DefIdx(0), NodeNumDefs(0) {
: SchedDAG(SD), Node(SU->getNode()) {
InitNodeNumDefs();
Advance();
}
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class InstrItineraryData;
///
class ScheduleDAGSDNodes : public ScheduleDAG {
public:
MachineBasicBlock *BB;
SelectionDAG *DAG; // DAG of the current basic block
MachineBasicBlock *BB = nullptr;
SelectionDAG *DAG = nullptr; // DAG of the current basic block
const InstrItineraryData *InstrItins;

/// The schedule. Null SUnit*'s represent noop instructions.
Expand Down Expand Up @@ -138,8 +138,8 @@ class InstrItineraryData;
class RegDefIter {
const ScheduleDAGSDNodes *SchedDAG;
const SDNode *Node;
unsigned DefIdx;
unsigned NodeNumDefs;
unsigned DefIdx = 0;
unsigned NodeNumDefs = 0;
MVT ValueType;

public:
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ SelectionDAGISel::SelectionDAGISel(TargetMachine &tm, CodeGenOpt::Level OL)
CurDAG(new SelectionDAG(tm, OL)),
SDB(std::make_unique<SelectionDAGBuilder>(*CurDAG, *FuncInfo, *SwiftError,
OL)),
AA(), GFI(), OptLevel(OL), DAGSize(0) {
OptLevel(OL) {
initializeGCModuleInfoPass(*PassRegistry::getPassRegistry());
initializeBranchProbabilityInfoWrapperPassPass(
*PassRegistry::getPassRegistry());
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SlotIndexes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using namespace llvm;

char SlotIndexes::ID = 0;

SlotIndexes::SlotIndexes() : MachineFunctionPass(ID), mf(nullptr) {
SlotIndexes::SlotIndexes() : MachineFunctionPass(ID) {
initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
}

Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2877,7 +2877,7 @@ CallInst *OpenMPIRBuilder::createOMPInteropInit(
Constant *SrcLocStr = getOrCreateSrcLocStr(Loc, SrcLocStrSize);
Value *Ident = getOrCreateIdent(SrcLocStr, SrcLocStrSize);
Value *ThreadId = getOrCreateThreadID(Ident);
if (Device == NULL)
if (Device == nullptr)
Device = ConstantInt::get(Int32, -1);
Constant *InteropTypeVal = ConstantInt::get(Int64, (int)InteropType);
if (NumDependences == nullptr) {
Expand Down Expand Up @@ -2905,7 +2905,7 @@ CallInst *OpenMPIRBuilder::createOMPInteropDestroy(
Constant *SrcLocStr = getOrCreateSrcLocStr(Loc, SrcLocStrSize);
Value *Ident = getOrCreateIdent(SrcLocStr, SrcLocStrSize);
Value *ThreadId = getOrCreateThreadID(Ident);
if (Device == NULL)
if (Device == nullptr)
Device = ConstantInt::get(Int32, -1);
if (NumDependences == nullptr) {
NumDependences = ConstantInt::get(Int32, 0);
Expand Down Expand Up @@ -2933,7 +2933,7 @@ CallInst *OpenMPIRBuilder::createOMPInteropUse(const LocationDescription &Loc,
Constant *SrcLocStr = getOrCreateSrcLocStr(Loc, SrcLocStrSize);
Value *Ident = getOrCreateIdent(SrcLocStr, SrcLocStrSize);
Value *ThreadId = getOrCreateThreadID(Ident);
if (Device == NULL)
if (Device == nullptr)
Device = ConstantInt::get(Int32, -1);
if (NumDependences == nullptr) {
NumDependences = ConstantInt::get(Int32, 0);
Expand Down