12 changes: 6 additions & 6 deletions llvm/lib/CodeGen/TargetInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ TargetInstrInfo::describeLoadedValue(const MachineInstr &MI,
assert(!TRI->isSuperOrSubRegisterEq(Reg, DestReg) &&
"TargetInstrInfo::describeLoadedValue can't describe super- or "
"sub-regs for copy instructions");
return None;
return std::nullopt;
} else if (auto RegImm = isAddImmediate(MI, Reg)) {
Register SrcReg = RegImm->Reg;
Offset = RegImm->Imm;
Expand All @@ -1219,16 +1219,16 @@ TargetInstrInfo::describeLoadedValue(const MachineInstr &MI,
// If the address points to "special" memory (e.g. a spill slot), it's
// sufficient to check that it isn't aliased by any high-level IR value.
if (!PSV || PSV->mayAlias(&MFI))
return None;
return std::nullopt;

const MachineOperand *BaseOp;
if (!TII->getMemOperandWithOffset(MI, BaseOp, Offset, OffsetIsScalable,
TRI))
return None;
return std::nullopt;

// FIXME: Scalable offsets are not yet handled in the offset code below.
if (OffsetIsScalable)
return None;
return std::nullopt;

// TODO: Can currently only handle mem instructions with a single define.
// An example from the x86 target:
Expand All @@ -1237,7 +1237,7 @@ TargetInstrInfo::describeLoadedValue(const MachineInstr &MI,
// ...
//
if (MI.getNumExplicitDefs() != 1)
return None;
return std::nullopt;

// TODO: In what way do we need to take Reg into consideration here?

Expand All @@ -1249,7 +1249,7 @@ TargetInstrInfo::describeLoadedValue(const MachineInstr &MI,
return ParamLoadedValue(*BaseOp, Expr);
}

return None;
return std::nullopt;
}

/// Both DefMI and UseMI must be valid. By default, call directly to the
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/TargetPassConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ static std::string getFSProfileFile(const TargetMachine *TM) {
if (!FSProfileFile.empty())
return FSProfileFile.getValue();
const Optional<PGOOptions> &PGOOpt = TM->getPGOOption();
if (PGOOpt == None || PGOOpt->Action != PGOOptions::SampleUse)
if (PGOOpt == std::nullopt || PGOOpt->Action != PGOOptions::SampleUse)
return std::string();
return PGOOpt->ProfileFile;
}
Expand All @@ -352,7 +352,7 @@ static std::string getFSRemappingFile(const TargetMachine *TM) {
if (!FSRemappingFile.empty())
return FSRemappingFile.getValue();
const Optional<PGOOptions> &PGOOpt = TM->getPGOOption();
if (PGOOpt == None || PGOOpt->Action != PGOOptions::SampleUse)
if (PGOOpt == std::nullopt || PGOOpt->Action != PGOOptions::SampleUse)
return std::string();
return PGOOpt->ProfileRemappingFile;
}
Expand Down