[LLVM] Use {} instead of std::nullopt to initialize empty ArrayRef (#109133)

It is almost always simpler to use {} instead of std::nullopt to
initialize an empty ArrayRef. This patch changes all occurrences I could
find in LLVM itself. In future the ArrayRef(std::nullopt_t) constructor
could be deprecated or removed.
This commit is contained in:
Jay Foad 2024-09-19 16:16:38 +01:00 committed by GitHub
parent 14120227a3
commit e03f427196
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
108 changed files with 362 additions and 420 deletions

View File

@ -135,7 +135,7 @@ public:
// implicit conversion operator to ArrayRef.
operator ArrayRef<EltTy>() const {
if (Val.isNull())
return std::nullopt;
return {};
if (isa<EltTy>(Val))
return *Val.getAddrOfPtr1();
return *cast<VecTy *>(Val);
@ -144,7 +144,7 @@ public:
// implicit conversion operator to MutableArrayRef.
operator MutableArrayRef<EltTy>() {
if (Val.isNull())
return std::nullopt;
return {};
if (isa<EltTy>(Val))
return *Val.getAddrOfPtr1();
return *cast<VecTy *>(Val);

View File

@ -1130,11 +1130,10 @@ public:
/// as arguments and asserts enforce that internally.
/*implicit*/ ExitLimit(const SCEV *E);
ExitLimit(
const SCEV *E, const SCEV *ConstantMaxNotTaken,
const SCEV *SymbolicMaxNotTaken, bool MaxOrZero,
ArrayRef<const SmallPtrSetImpl<const SCEVPredicate *> *> PredSetList =
std::nullopt);
ExitLimit(const SCEV *E, const SCEV *ConstantMaxNotTaken,
const SCEV *SymbolicMaxNotTaken, bool MaxOrZero,
ArrayRef<const SmallPtrSetImpl<const SCEVPredicate *> *>
PredSetList = {});
ExitLimit(const SCEV *E, const SCEV *ConstantMaxNotTaken,
const SCEV *SymbolicMaxNotTaken, bool MaxOrZero,

View File

@ -1279,8 +1279,7 @@ public:
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
TTI::OperandValueInfo Opd1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Opd2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr,
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr,
const TargetLibraryInfo *TLibInfo = nullptr) const;
/// Returns the cost estimation for alternating opcode pattern that can be
@ -1303,11 +1302,12 @@ public:
/// passed through \p Args, which helps improve the cost estimation in some
/// cases, like in broadcast loads.
/// NOTE: For subvector extractions Tp represents the source type.
InstructionCost getShuffleCost(
ShuffleKind Kind, VectorType *Tp, ArrayRef<int> Mask = std::nullopt,
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput, int Index = 0,
VectorType *SubTp = nullptr, ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr) const;
InstructionCost
getShuffleCost(ShuffleKind Kind, VectorType *Tp, ArrayRef<int> Mask = {},
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
int Index = 0, VectorType *SubTp = nullptr,
ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr) const;
/// Represents a hint about the context in which a cast is used.
///

View File

@ -605,7 +605,7 @@ public:
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
VectorType *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr) const {
return 1;
}
@ -1176,7 +1176,7 @@ public:
Cost += static_cast<T *>(this)->getArithmeticInstrCost(
Instruction::Add, GEP->getType(), CostKind,
{TTI::OK_AnyValue, TTI::OP_None}, {TTI::OK_AnyValue, TTI::OP_None},
std::nullopt);
{});
} else {
SmallVector<const Value *> Indices(GEP->indices());
Cost += static_cast<T *>(this)->getGEPCost(GEP->getSourceElementType(),

View File

@ -897,8 +897,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Opd1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Opd2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr) {
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr) {
// Check if any of the operands are vector operands.
const TargetLoweringBase *TLI = getTLI();
int ISD = TLI->InstructionOpcodeToISD(Opcode);
@ -1023,7 +1022,7 @@ public:
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
VectorType *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr) {
switch (improveShuffleKindFromMask(Kind, Mask, Tp, Index, SubTp)) {
case TTI::SK_Broadcast:
@ -1657,9 +1656,9 @@ public:
if (isa<ScalableVectorType>(RetTy))
return BaseT::getIntrinsicInstrCost(ICA, CostKind);
unsigned Index = cast<ConstantInt>(Args[1])->getZExtValue();
return thisT()->getShuffleCost(
TTI::SK_ExtractSubvector, cast<VectorType>(Args[0]->getType()),
std::nullopt, CostKind, Index, cast<VectorType>(RetTy));
return thisT()->getShuffleCost(TTI::SK_ExtractSubvector,
cast<VectorType>(Args[0]->getType()), {},
CostKind, Index, cast<VectorType>(RetTy));
}
case Intrinsic::vector_insert: {
// FIXME: Handle case where a scalable vector is inserted into a scalable
@ -1668,19 +1667,19 @@ public:
return BaseT::getIntrinsicInstrCost(ICA, CostKind);
unsigned Index = cast<ConstantInt>(Args[2])->getZExtValue();
return thisT()->getShuffleCost(
TTI::SK_InsertSubvector, cast<VectorType>(Args[0]->getType()),
std::nullopt, CostKind, Index, cast<VectorType>(Args[1]->getType()));
TTI::SK_InsertSubvector, cast<VectorType>(Args[0]->getType()), {},
CostKind, Index, cast<VectorType>(Args[1]->getType()));
}
case Intrinsic::vector_reverse: {
return thisT()->getShuffleCost(
TTI::SK_Reverse, cast<VectorType>(Args[0]->getType()), std::nullopt,
CostKind, 0, cast<VectorType>(RetTy));
return thisT()->getShuffleCost(TTI::SK_Reverse,
cast<VectorType>(Args[0]->getType()), {},
CostKind, 0, cast<VectorType>(RetTy));
}
case Intrinsic::vector_splice: {
unsigned Index = cast<ConstantInt>(Args[2])->getZExtValue();
return thisT()->getShuffleCost(
TTI::SK_Splice, cast<VectorType>(Args[0]->getType()), std::nullopt,
CostKind, Index, cast<VectorType>(RetTy));
return thisT()->getShuffleCost(TTI::SK_Splice,
cast<VectorType>(Args[0]->getType()), {},
CostKind, Index, cast<VectorType>(RetTy));
}
case Intrinsic::vector_reduce_add:
case Intrinsic::vector_reduce_mul:
@ -2600,9 +2599,8 @@ public:
while (NumVecElts > MVTLen) {
NumVecElts /= 2;
VectorType *SubTy = FixedVectorType::get(ScalarTy, NumVecElts);
ShuffleCost +=
thisT()->getShuffleCost(TTI::SK_ExtractSubvector, Ty, std::nullopt,
CostKind, NumVecElts, SubTy);
ShuffleCost += thisT()->getShuffleCost(TTI::SK_ExtractSubvector, Ty, {},
CostKind, NumVecElts, SubTy);
ArithCost += thisT()->getArithmeticInstrCost(Opcode, SubTy, CostKind);
Ty = SubTy;
++LongVectorCount;
@ -2618,7 +2616,7 @@ public:
// By default reductions need one shuffle per reduction level.
ShuffleCost +=
NumReduxLevels * thisT()->getShuffleCost(TTI::SK_PermuteSingleSrc, Ty,
std::nullopt, CostKind, 0, Ty);
{}, CostKind, 0, Ty);
ArithCost +=
NumReduxLevels * thisT()->getArithmeticInstrCost(Opcode, Ty, CostKind);
return ShuffleCost + ArithCost +
@ -2691,9 +2689,8 @@ public:
NumVecElts /= 2;
auto *SubTy = FixedVectorType::get(ScalarTy, NumVecElts);
ShuffleCost +=
thisT()->getShuffleCost(TTI::SK_ExtractSubvector, Ty, std::nullopt,
CostKind, NumVecElts, SubTy);
ShuffleCost += thisT()->getShuffleCost(TTI::SK_ExtractSubvector, Ty, {},
CostKind, NumVecElts, SubTy);
IntrinsicCostAttributes Attrs(IID, SubTy, {SubTy, SubTy}, FMF);
MinMaxCost += getIntrinsicInstrCost(Attrs, CostKind);
@ -2709,7 +2706,7 @@ public:
// architecture-dependent length.
ShuffleCost +=
NumReduxLevels * thisT()->getShuffleCost(TTI::SK_PermuteSingleSrc, Ty,
std::nullopt, CostKind, 0, Ty);
{}, CostKind, 0, Ty);
IntrinsicCostAttributes Attrs(IID, Ty, {Ty, Ty}, FMF);
MinMaxCost += NumReduxLevels * getIntrinsicInstrCost(Attrs, CostKind);
// The last min/max should be in vector registers and we counted it above.

View File

@ -409,20 +409,21 @@ protected:
/// \p Handler to move them to the assigned locations.
///
/// \return True if everything has succeeded, false otherwise.
bool determineAndHandleAssignments(
ValueHandler &Handler, ValueAssigner &Assigner,
SmallVectorImpl<ArgInfo> &Args, MachineIRBuilder &MIRBuilder,
CallingConv::ID CallConv, bool IsVarArg,
ArrayRef<Register> ThisReturnRegs = std::nullopt) const;
bool
determineAndHandleAssignments(ValueHandler &Handler, ValueAssigner &Assigner,
SmallVectorImpl<ArgInfo> &Args,
MachineIRBuilder &MIRBuilder,
CallingConv::ID CallConv, bool IsVarArg,
ArrayRef<Register> ThisReturnRegs = {}) const;
/// Use \p Handler to insert code to handle the argument/return values
/// represented by \p Args. It's expected determineAssignments previously
/// processed these arguments to populate \p CCState and \p ArgLocs.
bool
handleAssignments(ValueHandler &Handler, SmallVectorImpl<ArgInfo> &Args,
CCState &CCState, SmallVectorImpl<CCValAssign> &ArgLocs,
MachineIRBuilder &MIRBuilder,
ArrayRef<Register> ThisReturnRegs = std::nullopt) const;
bool handleAssignments(ValueHandler &Handler, SmallVectorImpl<ArgInfo> &Args,
CCState &CCState,
SmallVectorImpl<CCValAssign> &ArgLocs,
MachineIRBuilder &MIRBuilder,
ArrayRef<Register> ThisReturnRegs = {}) const;
/// Check whether parameters to a call that are passed in callee saved
/// registers are the same as from the calling function. This needs to be

View File

@ -237,7 +237,7 @@ public:
/// allocator. These registers should not be split into new intervals
/// as currently those new intervals are not guaranteed to spill.
void eliminateDeadDefs(SmallVectorImpl<MachineInstr *> &Dead,
ArrayRef<Register> RegsBeingSpilled = std::nullopt);
ArrayRef<Register> RegsBeingSpilled = {});
/// calculateRegClassAndHint - Recompute register class and hint for each new
/// register.

View File

@ -295,9 +295,9 @@ public:
/// classes are included. For the caller to account for extra machine
/// instructions, it must first resolve each instruction's scheduling class.
unsigned getResourceLength(
ArrayRef<const MachineBasicBlock *> Extrablocks = std::nullopt,
ArrayRef<const MCSchedClassDesc *> ExtraInstrs = std::nullopt,
ArrayRef<const MCSchedClassDesc *> RemoveInstrs = std::nullopt) const;
ArrayRef<const MachineBasicBlock *> Extrablocks = {},
ArrayRef<const MCSchedClassDesc *> ExtraInstrs = {},
ArrayRef<const MCSchedClassDesc *> RemoveInstrs = {}) const;
/// Return the length of the (data dependency) critical path through the
/// trace.

View File

@ -2007,7 +2007,7 @@ public:
/// defined by this method.
virtual ArrayRef<std::pair<int, const char *>>
getSerializableTargetIndices() const {
return std::nullopt;
return {};
}
/// Decompose the machine operand's target flags into two values - the direct
@ -2024,7 +2024,7 @@ public:
/// defined by this method.
virtual ArrayRef<std::pair<unsigned, const char *>>
getSerializableDirectMachineOperandTargetFlags() const {
return std::nullopt;
return {};
}
/// Return an array that contains the bitmask target flag values and their
@ -2034,7 +2034,7 @@ public:
/// defined by this method.
virtual ArrayRef<std::pair<unsigned, const char *>>
getSerializableBitmaskMachineOperandTargetFlags() const {
return std::nullopt;
return {};
}
/// Return an array that contains the MMO target flag values and their
@ -2044,7 +2044,7 @@ public:
/// defined by this method.
virtual ArrayRef<std::pair<MachineMemOperand::Flags, const char *>>
getSerializableMachineMemOperandTargetFlags() const {
return std::nullopt;
return {};
}
/// Determines whether \p Inst is a tail call instruction. Override this

View File

@ -772,7 +772,7 @@ namespace llvm {
/// Create a new descriptor for the specified
/// variable which has a complex address expression for its address.
/// \param Addr An array of complex address operations.
DIExpression *createExpression(ArrayRef<uint64_t> Addr = std::nullopt);
DIExpression *createExpression(ArrayRef<uint64_t> Addr = {});
/// Create an expression for a variable that does not have an address, but
/// does have a constant value.

View File

@ -138,7 +138,7 @@ class DINode : public MDNode {
protected:
DINode(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag,
ArrayRef<Metadata *> Ops1, ArrayRef<Metadata *> Ops2 = std::nullopt)
ArrayRef<Metadata *> Ops1, ArrayRef<Metadata *> Ops2 = {})
: MDNode(C, ID, Storage, Ops1, Ops2) {
assert(Tag < 1u << 16);
SubclassData16 = Tag;
@ -311,7 +311,7 @@ class DIAssignID : public MDNode {
friend class MDNode;
DIAssignID(LLVMContext &C, StorageType Storage)
: MDNode(C, DIAssignIDKind, Storage, std::nullopt) {}
: MDNode(C, DIAssignIDKind, Storage, {}) {}
~DIAssignID() { dropAllReferences(); }
@ -2730,7 +2730,7 @@ class DIExpression : public MDNode {
std::vector<uint64_t> Elements;
DIExpression(LLVMContext &C, StorageType Storage, ArrayRef<uint64_t> Elements)
: MDNode(C, DIExpressionKind, Storage, std::nullopt),
: MDNode(C, DIExpressionKind, Storage, {}),
Elements(Elements.begin(), Elements.end()) {}
~DIExpression() = default;
@ -3776,8 +3776,7 @@ class DIMacroNode : public MDNode {
protected:
DIMacroNode(LLVMContext &C, unsigned ID, StorageType Storage, unsigned MIType,
ArrayRef<Metadata *> Ops1,
ArrayRef<Metadata *> Ops2 = std::nullopt)
ArrayRef<Metadata *> Ops1, ArrayRef<Metadata *> Ops2 = {})
: MDNode(C, ID, Storage, Ops1, Ops2) {
assert(MIType < 1u << 16);
SubclassData16 = MIType;

View File

@ -733,16 +733,16 @@ public:
/// Return a target extension type having the specified name and optional
/// type and integer parameters.
static TargetExtType *get(LLVMContext &Context, StringRef Name,
ArrayRef<Type *> Types = std::nullopt,
ArrayRef<unsigned> Ints = std::nullopt);
ArrayRef<Type *> Types = {},
ArrayRef<unsigned> Ints = {});
/// Return a target extension type having the specified name and optional
/// type and integer parameters, or an appropriate Error if it fails the
/// parameters check.
static Expected<TargetExtType *>
getOrError(LLVMContext &Context, StringRef Name,
ArrayRef<Type *> Types = std::nullopt,
ArrayRef<unsigned> Ints = std::nullopt);
static Expected<TargetExtType *> getOrError(LLVMContext &Context,
StringRef Name,
ArrayRef<Type *> Types = {},
ArrayRef<unsigned> Ints = {});
/// Check that a newly created target extension type has the expected number
/// of type parameters and integer parameters, returning the type itself if OK

View File

@ -221,7 +221,7 @@ public:
/// Set nosanitize metadata.
void SetNoSanitizeMetadata() {
AddOrRemoveMetadataToCopy(llvm::LLVMContext::MD_nosanitize,
llvm::MDNode::get(getContext(), std::nullopt));
llvm::MDNode::get(getContext(), {}));
}
/// Collect metadata with IDs \p MetadataKinds from \p Src which should be
@ -638,8 +638,7 @@ public:
Value *ArraySize, Function *MallocF = nullptr,
const Twine &Name = "");
/// Generate the IR for a call to the builtin free function.
CallInst *CreateFree(Value *Source,
ArrayRef<OperandBundleDef> Bundles = std::nullopt);
CallInst *CreateFree(Value *Source, ArrayRef<OperandBundleDef> Bundles = {});
CallInst *CreateElementUnorderedAtomicMemSet(Value *Ptr, Value *Val,
Value *Size, Align Alignment,
@ -852,9 +851,8 @@ public:
///
/// The optional argument \p OpBundles specifies operand bundles that are
/// added to the call instruction.
CallInst *
CreateAssumption(Value *Cond,
ArrayRef<OperandBundleDef> OpBundles = std::nullopt);
CallInst *CreateAssumption(Value *Cond,
ArrayRef<OperandBundleDef> OpBundles = {});
/// Create a llvm.experimental.noalias.scope.decl intrinsic call.
Instruction *CreateNoAliasScopeDeclaration(Value *Scope);
@ -1194,7 +1192,7 @@ public:
}
InvokeInst *CreateInvoke(FunctionType *Ty, Value *Callee,
BasicBlock *NormalDest, BasicBlock *UnwindDest,
ArrayRef<Value *> Args = std::nullopt,
ArrayRef<Value *> Args = {},
const Twine &Name = "") {
InvokeInst *II =
InvokeInst::Create(Ty, Callee, NormalDest, UnwindDest, Args);
@ -1212,8 +1210,7 @@ public:
}
InvokeInst *CreateInvoke(FunctionCallee Callee, BasicBlock *NormalDest,
BasicBlock *UnwindDest,
ArrayRef<Value *> Args = std::nullopt,
BasicBlock *UnwindDest, ArrayRef<Value *> Args = {},
const Twine &Name = "") {
return CreateInvoke(Callee.getFunctionType(), Callee.getCallee(),
NormalDest, UnwindDest, Args, Name);
@ -1223,7 +1220,7 @@ public:
CallBrInst *CreateCallBr(FunctionType *Ty, Value *Callee,
BasicBlock *DefaultDest,
ArrayRef<BasicBlock *> IndirectDests,
ArrayRef<Value *> Args = std::nullopt,
ArrayRef<Value *> Args = {},
const Twine &Name = "") {
return Insert(CallBrInst::Create(Ty, Callee, DefaultDest, IndirectDests,
Args), Name);
@ -1241,7 +1238,7 @@ public:
CallBrInst *CreateCallBr(FunctionCallee Callee, BasicBlock *DefaultDest,
ArrayRef<BasicBlock *> IndirectDests,
ArrayRef<Value *> Args = std::nullopt,
ArrayRef<Value *> Args = {},
const Twine &Name = "") {
return CreateCallBr(Callee.getFunctionType(), Callee.getCallee(),
DefaultDest, IndirectDests, Args, Name);
@ -1277,7 +1274,7 @@ public:
}
CleanupPadInst *CreateCleanupPad(Value *ParentPad,
ArrayRef<Value *> Args = std::nullopt,
ArrayRef<Value *> Args = {},
const Twine &Name = "") {
return Insert(CleanupPadInst::Create(ParentPad, Args), Name);
}
@ -2439,8 +2436,8 @@ private:
public:
CallInst *CreateCall(FunctionType *FTy, Value *Callee,
ArrayRef<Value *> Args = std::nullopt,
const Twine &Name = "", MDNode *FPMathTag = nullptr) {
ArrayRef<Value *> Args = {}, const Twine &Name = "",
MDNode *FPMathTag = nullptr) {
CallInst *CI = CallInst::Create(FTy, Callee, Args, DefaultOperandBundles);
if (IsFPConstrained)
setConstrainedFPCallAttr(CI);
@ -2460,8 +2457,7 @@ public:
return Insert(CI, Name);
}
CallInst *CreateCall(FunctionCallee Callee,
ArrayRef<Value *> Args = std::nullopt,
CallInst *CreateCall(FunctionCallee Callee, ArrayRef<Value *> Args = {},
const Twine &Name = "", MDNode *FPMathTag = nullptr) {
return CreateCall(Callee.getFunctionType(), Callee.getCallee(), Args, Name,
FPMathTag);
@ -2700,17 +2696,17 @@ private:
public:
IRBuilder(LLVMContext &C, FolderTy Folder, InserterTy Inserter = InserterTy(),
MDNode *FPMathTag = nullptr,
ArrayRef<OperandBundleDef> OpBundles = std::nullopt)
ArrayRef<OperandBundleDef> OpBundles = {})
: IRBuilderBase(C, this->Folder, this->Inserter, FPMathTag, OpBundles),
Folder(Folder), Inserter(Inserter) {}
explicit IRBuilder(LLVMContext &C, MDNode *FPMathTag = nullptr,
ArrayRef<OperandBundleDef> OpBundles = std::nullopt)
ArrayRef<OperandBundleDef> OpBundles = {})
: IRBuilderBase(C, this->Folder, this->Inserter, FPMathTag, OpBundles) {}
explicit IRBuilder(BasicBlock *TheBB, FolderTy Folder,
MDNode *FPMathTag = nullptr,
ArrayRef<OperandBundleDef> OpBundles = std::nullopt)
ArrayRef<OperandBundleDef> OpBundles = {})
: IRBuilderBase(TheBB->getContext(), this->Folder, this->Inserter,
FPMathTag, OpBundles),
Folder(Folder) {
@ -2718,14 +2714,14 @@ public:
}
explicit IRBuilder(BasicBlock *TheBB, MDNode *FPMathTag = nullptr,
ArrayRef<OperandBundleDef> OpBundles = std::nullopt)
ArrayRef<OperandBundleDef> OpBundles = {})
: IRBuilderBase(TheBB->getContext(), this->Folder, this->Inserter,
FPMathTag, OpBundles) {
SetInsertPoint(TheBB);
}
explicit IRBuilder(Instruction *IP, MDNode *FPMathTag = nullptr,
ArrayRef<OperandBundleDef> OpBundles = std::nullopt)
ArrayRef<OperandBundleDef> OpBundles = {})
: IRBuilderBase(IP->getContext(), this->Folder, this->Inserter, FPMathTag,
OpBundles) {
SetInsertPoint(IP);
@ -2733,7 +2729,7 @@ public:
IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, FolderTy Folder,
MDNode *FPMathTag = nullptr,
ArrayRef<OperandBundleDef> OpBundles = std::nullopt)
ArrayRef<OperandBundleDef> OpBundles = {})
: IRBuilderBase(TheBB->getContext(), this->Folder, this->Inserter,
FPMathTag, OpBundles),
Folder(Folder) {
@ -2742,7 +2738,7 @@ public:
IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP,
MDNode *FPMathTag = nullptr,
ArrayRef<OperandBundleDef> OpBundles = std::nullopt)
ArrayRef<OperandBundleDef> OpBundles = {})
: IRBuilderBase(TheBB->getContext(), this->Folder, this->Inserter,
FPMathTag, OpBundles) {
SetInsertPoint(TheBB, IP);

View File

@ -433,7 +433,7 @@ public:
/// convenience method for passes to do so.
/// dropUBImplyingAttrsAndUnknownMetadata should be used instead of
/// this API if the Instruction being modified is a call.
void dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs = std::nullopt);
void dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs = {});
/// @}
/// Adds an !annotation metadata node with \p Annotation to this instruction.

View File

@ -1421,8 +1421,7 @@ class CallInst : public CallBase {
inline CallInst(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args,
const Twine &NameStr, AllocInfo AllocInfo,
InsertPosition InsertBefore)
: CallInst(Ty, Func, Args, std::nullopt, NameStr, AllocInfo,
InsertBefore) {}
: CallInst(Ty, Func, Args, {}, NameStr, AllocInfo, InsertBefore) {}
explicit CallInst(FunctionType *Ty, Value *F, const Twine &NameStr,
AllocInfo AllocInfo, InsertPosition InsertBefore);
@ -1457,12 +1456,12 @@ public:
const Twine &NameStr,
InsertPosition InsertBefore = nullptr) {
IntrusiveOperandsAllocMarker AllocMarker{ComputeNumOperands(Args.size())};
return new (AllocMarker) CallInst(Ty, Func, Args, std::nullopt, NameStr,
AllocMarker, InsertBefore);
return new (AllocMarker)
CallInst(Ty, Func, Args, {}, NameStr, AllocMarker, InsertBefore);
}
static CallInst *Create(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args,
ArrayRef<OperandBundleDef> Bundles = std::nullopt,
ArrayRef<OperandBundleDef> Bundles = {},
const Twine &NameStr = "",
InsertPosition InsertBefore = nullptr) {
IntrusiveOperandsAndDescriptorAllocMarker AllocMarker{
@ -1480,7 +1479,7 @@ public:
}
static CallInst *Create(FunctionCallee Func, ArrayRef<Value *> Args,
ArrayRef<OperandBundleDef> Bundles = std::nullopt,
ArrayRef<OperandBundleDef> Bundles = {},
const Twine &NameStr = "",
InsertPosition InsertBefore = nullptr) {
return Create(Func.getFunctionType(), Func.getCallee(), Args, Bundles,
@ -3648,14 +3647,13 @@ public:
InsertPosition InsertBefore = nullptr) {
IntrusiveOperandsAllocMarker AllocMarker{
ComputeNumOperands(unsigned(Args.size()))};
return new (AllocMarker)
InvokeInst(Ty, Func, IfNormal, IfException, Args, std::nullopt,
AllocMarker, NameStr, InsertBefore);
return new (AllocMarker) InvokeInst(Ty, Func, IfNormal, IfException, Args,
{}, AllocMarker, NameStr, InsertBefore);
}
static InvokeInst *Create(FunctionType *Ty, Value *Func, BasicBlock *IfNormal,
BasicBlock *IfException, ArrayRef<Value *> Args,
ArrayRef<OperandBundleDef> Bundles = std::nullopt,
ArrayRef<OperandBundleDef> Bundles = {},
const Twine &NameStr = "",
InsertPosition InsertBefore = nullptr) {
IntrusiveOperandsAndDescriptorAllocMarker AllocMarker{
@ -3672,12 +3670,12 @@ public:
const Twine &NameStr,
InsertPosition InsertBefore = nullptr) {
return Create(Func.getFunctionType(), Func.getCallee(), IfNormal,
IfException, Args, std::nullopt, NameStr, InsertBefore);
IfException, Args, {}, NameStr, InsertBefore);
}
static InvokeInst *Create(FunctionCallee Func, BasicBlock *IfNormal,
BasicBlock *IfException, ArrayRef<Value *> Args,
ArrayRef<OperandBundleDef> Bundles = std::nullopt,
ArrayRef<OperandBundleDef> Bundles = {},
const Twine &NameStr = "",
InsertPosition InsertBefore = nullptr) {
return Create(Func.getFunctionType(), Func.getCallee(), IfNormal,
@ -3805,15 +3803,15 @@ public:
IntrusiveOperandsAllocMarker AllocMarker{
ComputeNumOperands(Args.size(), IndirectDests.size())};
return new (AllocMarker)
CallBrInst(Ty, Func, DefaultDest, IndirectDests, Args, std::nullopt,
AllocMarker, NameStr, InsertBefore);
CallBrInst(Ty, Func, DefaultDest, IndirectDests, Args, {}, AllocMarker,
NameStr, InsertBefore);
}
static CallBrInst *
Create(FunctionType *Ty, Value *Func, BasicBlock *DefaultDest,
ArrayRef<BasicBlock *> IndirectDests, ArrayRef<Value *> Args,
ArrayRef<OperandBundleDef> Bundles = std::nullopt,
const Twine &NameStr = "", InsertPosition InsertBefore = nullptr) {
ArrayRef<OperandBundleDef> Bundles = {}, const Twine &NameStr = "",
InsertPosition InsertBefore = nullptr) {
IntrusiveOperandsAndDescriptorAllocMarker AllocMarker{
ComputeNumOperands(Args.size(), IndirectDests.size(),
CountBundleInputs(Bundles)),
@ -3835,7 +3833,7 @@ public:
static CallBrInst *Create(FunctionCallee Func, BasicBlock *DefaultDest,
ArrayRef<BasicBlock *> IndirectDests,
ArrayRef<Value *> Args,
ArrayRef<OperandBundleDef> Bundles = std::nullopt,
ArrayRef<OperandBundleDef> Bundles = {},
const Twine &NameStr = "",
InsertPosition InsertBefore = nullptr) {
return Create(Func.getFunctionType(), Func.getCallee(), DefaultDest,
@ -4163,8 +4161,7 @@ private:
NameStr, InsertBefore) {}
public:
static CleanupPadInst *Create(Value *ParentPad,
ArrayRef<Value *> Args = std::nullopt,
static CleanupPadInst *Create(Value *ParentPad, ArrayRef<Value *> Args = {},
const Twine &NameStr = "",
InsertPosition InsertBefore = nullptr) {
IntrusiveOperandsAllocMarker AllocMarker{unsigned(1 + Args.size())};

View File

@ -73,8 +73,7 @@ namespace Intrinsic {
std::string getNameNoUnnamedTypes(ID Id, ArrayRef<Type *> Tys);
/// Return the function type for an intrinsic.
FunctionType *getType(LLVMContext &Context, ID id,
ArrayRef<Type *> Tys = std::nullopt);
FunctionType *getType(LLVMContext &Context, ID id, ArrayRef<Type *> Tys = {});
/// Returns true if the intrinsic can be overloaded.
bool isOverloaded(ID id);
@ -89,8 +88,7 @@ namespace Intrinsic {
/// using iAny, fAny, vAny, or iPTRAny). For a declaration of an overloaded
/// intrinsic, Tys must provide exactly one type for each overloaded type in
/// the intrinsic.
Function *getDeclaration(Module *M, ID id,
ArrayRef<Type *> Tys = std::nullopt);
Function *getDeclaration(Module *M, ID id, ArrayRef<Type *> Tys = {});
/// Looks up Name in NameTable via binary search. NameTable must be sorted
/// and all entries must start with "llvm.". If NameTable contains an exact

View File

@ -1181,7 +1181,7 @@ class MDNode : public Metadata {
protected:
MDNode(LLVMContext &Context, unsigned ID, StorageType Storage,
ArrayRef<Metadata *> Ops1, ArrayRef<Metadata *> Ops2 = std::nullopt);
ArrayRef<Metadata *> Ops1, ArrayRef<Metadata *> Ops2 = {});
~MDNode() = default;
void *operator new(size_t Size, size_t NumOps, StorageType Storage);

View File

@ -135,10 +135,10 @@ struct COFFShortExport {
/// linking both ARM64EC and pure ARM64 objects, and the linker will pick only
/// the exports relevant to the target platform. For non-hybrid targets,
/// the NativeExports parameter should not be used.
Error writeImportLibrary(
StringRef ImportName, StringRef Path, ArrayRef<COFFShortExport> Exports,
COFF::MachineTypes Machine, bool MinGW,
ArrayRef<COFFShortExport> NativeExports = std::nullopt);
Error writeImportLibrary(StringRef ImportName, StringRef Path,
ArrayRef<COFFShortExport> Exports,
COFF::MachineTypes Machine, bool MinGW,
ArrayRef<COFFShortExport> NativeExports = {});
} // namespace object
} // namespace llvm

View File

@ -660,7 +660,7 @@ class CounterMappingContext {
public:
CounterMappingContext(ArrayRef<CounterExpression> Expressions,
ArrayRef<uint64_t> CounterValues = std::nullopt)
ArrayRef<uint64_t> CounterValues = {})
: Expressions(Expressions), CounterValues(CounterValues) {}
void setCounts(ArrayRef<uint64_t> Counts) { CounterValues = Counts; }
@ -970,7 +970,7 @@ public:
/// Ignores non-instrumented object files unless all are not instrumented.
static Expected<std::unique_ptr<CoverageMapping>>
load(ArrayRef<StringRef> ObjectFilenames, StringRef ProfileFilename,
vfs::FileSystem &FS, ArrayRef<StringRef> Arches = std::nullopt,
vfs::FileSystem &FS, ArrayRef<StringRef> Arches = {},
StringRef CompilationDir = "",
const object::BuildIDFetcher *BIDFetcher = nullptr,
bool CheckBinaryIDs = false);

View File

@ -959,7 +959,7 @@ private:
ArrayRef<InstrProfValueSiteRecord>
getValueSitesForKind(uint32_t ValueKind) const {
if (!ValueData)
return std::nullopt;
return {};
assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
"Unknown value kind!");
return (*ValueData)[ValueKind - IPVK_First];

View File

@ -40,7 +40,7 @@ public:
static llvm::Expected<std::unique_ptr<InstrProfCorrelator>>
get(StringRef Filename, ProfCorrelatorKind FileKind,
const object::BuildIDFetcher *BIDFetcher = nullptr,
const ArrayRef<llvm::object::BuildID> BIs = std::nullopt);
const ArrayRef<llvm::object::BuildID> BIs = {});
/// Construct a ProfileData vector used to correlate raw instrumentation data
/// to their functions.

View File

@ -4519,7 +4519,7 @@ bool ScalarEvolution::containsAddRecurrence(const SCEV *S) {
ArrayRef<Value *> ScalarEvolution::getSCEVValues(const SCEV *S) {
ExprValueMapType::iterator SI = ExprValueMap.find_as(S);
if (SI == ExprValueMap.end())
return std::nullopt;
return {};
return SI->second.getArrayRef();
}
@ -8681,7 +8681,7 @@ bool ScalarEvolution::BackedgeTakenInfo::isConstantMaxOrZero(
}
ScalarEvolution::ExitLimit::ExitLimit(const SCEV *E)
: ExitLimit(E, E, E, false, std::nullopt) {}
: ExitLimit(E, E, E, false, {}) {}
ScalarEvolution::ExitLimit::ExitLimit(
const SCEV *E, const SCEV *ConstantMaxNotTaken,

View File

@ -948,7 +948,7 @@ bool LLParser::parseMDNodeID(MDNode *&Result) {
// Otherwise, create MDNode forward reference.
auto &FwdRef = ForwardRefMDNodes[MID];
FwdRef = std::make_pair(MDTuple::getTemporary(Context, std::nullopt), IDLoc);
FwdRef = std::make_pair(MDTuple::getTemporary(Context, {}), IDLoc);
Result = FwdRef.first.get();
NumberedMetadata[MID].reset(Result);

View File

@ -222,7 +222,7 @@ Metadata *BitcodeReaderMetadataList::getMetadataFwdRef(unsigned Idx) {
// Create and return a placeholder, which will later be RAUW'd.
++NumMDNodeTemporary;
Metadata *MD = MDNode::getTemporary(Context, std::nullopt).release();
Metadata *MD = MDNode::getTemporary(Context, {}).release();
MetadataPtrs[Idx].reset(MD);
return MD;
}
@ -304,7 +304,7 @@ Metadata *BitcodeReaderMetadataList::upgradeTypeRef(Metadata *MaybeUUID) {
auto &Ref = OldTypeRefs.Unknown[UUID];
if (!Ref)
Ref = MDNode::getTemporary(Context, std::nullopt);
Ref = MDNode::getTemporary(Context, {});
return Ref.get();
}
@ -321,7 +321,7 @@ Metadata *BitcodeReaderMetadataList::upgradeTypeRefArray(Metadata *MaybeTuple) {
// resolveTypeRefArrays() will be resolve this forward reference.
OldTypeRefs.Arrays.emplace_back(
std::piecewise_construct, std::forward_as_tuple(Tuple),
std::forward_as_tuple(MDTuple::getTemporary(Context, std::nullopt)));
std::forward_as_tuple(MDTuple::getTemporary(Context, {})));
return OldTypeRefs.Arrays.back().second.get();
}
@ -1331,8 +1331,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
// If this isn't a LocalAsMetadata record, we're dropping it. This used
// to be legal, but there's no upgrade path.
auto dropRecord = [&] {
MetadataList.assignValue(MDNode::get(Context, std::nullopt),
NextMetadataNo);
MetadataList.assignValue(MDNode::get(Context, {}), NextMetadataNo);
NextMetadataNo++;
};
if (Record.size() != 2) {

View File

@ -2042,7 +2042,7 @@ TypeIndex CodeViewDebug::lowerTypeFunction(const DISubroutineType *Ty) {
ReturnAndArgTypeIndices.back() = TypeIndex::None();
}
TypeIndex ReturnTypeIndex = TypeIndex::Void();
ArrayRef<TypeIndex> ArgTypeIndices = std::nullopt;
ArrayRef<TypeIndex> ArgTypeIndices = {};
if (!ReturnAndArgTypeIndices.empty()) {
auto ReturnAndArgTypesRef = ArrayRef(ReturnAndArgTypeIndices);
ReturnTypeIndex = ReturnAndArgTypesRef.front();

View File

@ -966,7 +966,7 @@ public:
auto &Ctx = Fn.getContext();
for (auto &FragMemLoc : FragMemLocs) {
DIExpression *Expr = DIExpression::get(Ctx, std::nullopt);
DIExpression *Expr = DIExpression::get(Ctx, {});
if (FragMemLoc.SizeInBits !=
*Aggregates[FragMemLoc.Var].first->getSizeInBits())
Expr = *DIExpression::createFragmentExpression(
@ -1398,7 +1398,7 @@ ArrayRef<VariableID>
AssignmentTrackingLowering::getContainedFragments(VariableID Var) const {
auto R = VarContains.find(Var);
if (R == VarContains.end())
return std::nullopt;
return {};
return R->second;
}
@ -1638,7 +1638,7 @@ void AssignmentTrackingLowering::processUntaggedInstruction(
//
// DIExpression: Add fragment and offset.
DebugVariable V = FnVarLocs->getVariable(Var);
DIExpression *DIE = DIExpression::get(I.getContext(), std::nullopt);
DIExpression *DIE = DIExpression::get(I.getContext(), {});
if (auto Frag = V.getFragment()) {
auto R = DIExpression::createFragmentExpression(DIE, Frag->OffsetInBits,
Frag->SizeInBits);
@ -2419,7 +2419,7 @@ bool AssignmentTrackingLowering::run(FunctionVarLocsBuilder *FnVarLocsBuilder) {
// built appropriately rather than always using an empty DIExpression.
// The assert below is a reminder.
assert(Simple);
VarLoc.Expr = DIExpression::get(Fn.getContext(), std::nullopt);
VarLoc.Expr = DIExpression::get(Fn.getContext(), {});
DebugVariable Var = FnVarLocs->getVariable(VarLoc.VariableID);
FnVarLocs->addSingleLocVar(Var, VarLoc.Expr, VarLoc.DL, VarLoc.Values);
InsertedAnyIntrinsics = true;

View File

@ -2198,7 +2198,7 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID,
for (const auto &Arg : CI.args())
for (auto VReg : getOrCreateVRegs(*Arg))
VRegs.push_back(VReg);
MIRBuilder.buildInstr(TargetOpcode::FAKE_USE, std::nullopt, VRegs);
MIRBuilder.buildInstr(TargetOpcode::FAKE_USE, {}, VRegs);
return true;
}
case Intrinsic::dbg_declare: {

View File

@ -801,7 +801,7 @@ void ImplicitNullChecks::rewriteNullChecks(
// Insert an *unconditional* branch to not-null successor - we expect
// block placement to remove fallthroughs later.
TII->insertBranch(*NC.getCheckBlock(), NC.getNotNullSucc(), nullptr,
/*Cond=*/std::nullopt, DL);
/*Cond=*/{}, DL);
NumImplicitNullChecks++;
}

View File

@ -1697,7 +1697,7 @@ void HoistSpillHelper::hoistAllSpills() {
RMEnt->removeOperand(i - 1);
}
}
Edit.eliminateDeadDefs(SpillsToRm, std::nullopt);
Edit.eliminateDeadDefs(SpillsToRm, {});
}
}

View File

@ -599,7 +599,7 @@ bool MIParser::error(StringRef::iterator Loc, const Twine &Msg) {
// Create a diagnostic for a YAML string literal.
Error = SMDiagnostic(SM, SMLoc(), Buffer.getBufferIdentifier(), 1,
Loc - Source.data(), SourceMgr::DK_Error, Msg.str(),
Source, std::nullopt, std::nullopt);
Source, {}, {});
return true;
}
@ -1399,7 +1399,7 @@ bool MIParser::parseMetadata(Metadata *&MD) {
// Forward reference.
auto &FwdRef = PFS.MachineForwardRefMDNodes[ID];
FwdRef = std::make_pair(
MDTuple::getTemporary(MF.getFunction().getContext(), std::nullopt), Loc);
MDTuple::getTemporary(MF.getFunction().getContext(), {}), Loc);
PFS.MachineMetadataNodes[ID].reset(FwdRef.first.get());
MD = FwdRef.first.get();

View File

@ -1072,7 +1072,7 @@ SMDiagnostic MIRParserImpl::diagFromMIStringDiag(const SMDiagnostic &Error,
(HasQuote ? 1 : 0));
// TODO: Translate any source ranges as well.
return SM.GetMessage(Loc, Error.getKind(), Error.getMessage(), std::nullopt,
return SM.GetMessage(Loc, Error.getKind(), Error.getMessage(), {},
Error.getFixIts());
}

View File

@ -1007,8 +1007,7 @@ MachineFunction *MachineOutliner::createOutlinedFunction(
DISubprogram *OutlinedSP = DB.createFunction(
Unit /* Context */, F->getName(), StringRef(Dummy), Unit /* File */,
0 /* Line 0 is reserved for compiler-generated code. */,
DB.createSubroutineType(
DB.getOrCreateTypeArray(std::nullopt)), /* void type */
DB.createSubroutineType(DB.getOrCreateTypeArray({})), /* void type */
0, /* Line 0 is reserved for compiler-generated code. */
DINode::DIFlags::FlagArtificial /* Compiler-generated code. */,
/* Outlined code is optimized code by definition. */

View File

@ -1739,7 +1739,7 @@ SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
unsigned Opc = isT ? ISD::TargetConstant : ISD::Constant;
SDVTList VTs = getVTList(EltVT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, Opc, VTs, std::nullopt);
AddNodeIDNode(ID, Opc, VTs, {});
ID.AddPointer(Elt);
ID.AddBoolean(isO);
void *IP = nullptr;
@ -1816,7 +1816,7 @@ SDValue SelectionDAG::getConstantFP(const ConstantFP &V, const SDLoc &DL,
unsigned Opc = isTarget ? ISD::TargetConstantFP : ISD::ConstantFP;
SDVTList VTs = getVTList(EltVT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, Opc, VTs, std::nullopt);
AddNodeIDNode(ID, Opc, VTs, {});
ID.AddPointer(&V);
void *IP = nullptr;
SDNode *N = nullptr;
@ -1874,7 +1874,7 @@ SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV, const SDLoc &DL,
SDVTList VTs = getVTList(VT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, Opc, VTs, std::nullopt);
AddNodeIDNode(ID, Opc, VTs, {});
ID.AddPointer(GV);
ID.AddInteger(Offset);
ID.AddInteger(TargetFlags);
@ -1893,7 +1893,7 @@ SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) {
unsigned Opc = isTarget ? ISD::TargetFrameIndex : ISD::FrameIndex;
SDVTList VTs = getVTList(VT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, Opc, VTs, std::nullopt);
AddNodeIDNode(ID, Opc, VTs, {});
ID.AddInteger(FI);
void *IP = nullptr;
if (SDNode *E = FindNodeOrInsertPos(ID, IP))
@ -1912,7 +1912,7 @@ SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget,
unsigned Opc = isTarget ? ISD::TargetJumpTable : ISD::JumpTable;
SDVTList VTs = getVTList(VT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, Opc, VTs, std::nullopt);
AddNodeIDNode(ID, Opc, VTs, {});
ID.AddInteger(JTI);
ID.AddInteger(TargetFlags);
void *IP = nullptr;
@ -1944,7 +1944,7 @@ SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT,
unsigned Opc = isTarget ? ISD::TargetConstantPool : ISD::ConstantPool;
SDVTList VTs = getVTList(VT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, Opc, VTs, std::nullopt);
AddNodeIDNode(ID, Opc, VTs, {});
ID.AddInteger(Alignment->value());
ID.AddInteger(Offset);
ID.AddPointer(C);
@ -1972,7 +1972,7 @@ SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
unsigned Opc = isTarget ? ISD::TargetConstantPool : ISD::ConstantPool;
SDVTList VTs = getVTList(VT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, Opc, VTs, std::nullopt);
AddNodeIDNode(ID, Opc, VTs, {});
ID.AddInteger(Alignment->value());
ID.AddInteger(Offset);
C->addSelectionDAGCSEId(ID);
@ -1990,7 +1990,7 @@ SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
SDValue SelectionDAG::getBasicBlock(MachineBasicBlock *MBB) {
FoldingSetNodeID ID;
AddNodeIDNode(ID, ISD::BasicBlock, getVTList(MVT::Other), std::nullopt);
AddNodeIDNode(ID, ISD::BasicBlock, getVTList(MVT::Other), {});
ID.AddPointer(MBB);
void *IP = nullptr;
if (SDNode *E = FindNodeOrInsertPos(ID, IP))
@ -2295,7 +2295,7 @@ SDValue SelectionDAG::getCommutedVectorShuffle(const ShuffleVectorSDNode &SV) {
SDValue SelectionDAG::getRegister(Register Reg, EVT VT) {
SDVTList VTs = getVTList(VT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, ISD::Register, VTs, std::nullopt);
AddNodeIDNode(ID, ISD::Register, VTs, {});
ID.AddInteger(Reg.id());
void *IP = nullptr;
if (SDNode *E = FindNodeOrInsertPos(ID, IP))
@ -2310,7 +2310,7 @@ SDValue SelectionDAG::getRegister(Register Reg, EVT VT) {
SDValue SelectionDAG::getRegisterMask(const uint32_t *RegMask) {
FoldingSetNodeID ID;
AddNodeIDNode(ID, ISD::RegisterMask, getVTList(MVT::Untyped), std::nullopt);
AddNodeIDNode(ID, ISD::RegisterMask, getVTList(MVT::Untyped), {});
ID.AddPointer(RegMask);
void *IP = nullptr;
if (SDNode *E = FindNodeOrInsertPos(ID, IP))
@ -2353,7 +2353,7 @@ SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT,
SDVTList VTs = getVTList(VT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, Opc, VTs, std::nullopt);
AddNodeIDNode(ID, Opc, VTs, {});
ID.AddPointer(BA);
ID.AddInteger(Offset);
ID.AddInteger(TargetFlags);
@ -2369,7 +2369,7 @@ SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT,
SDValue SelectionDAG::getSrcValue(const Value *V) {
FoldingSetNodeID ID;
AddNodeIDNode(ID, ISD::SRCVALUE, getVTList(MVT::Other), std::nullopt);
AddNodeIDNode(ID, ISD::SRCVALUE, getVTList(MVT::Other), {});
ID.AddPointer(V);
void *IP = nullptr;
@ -2384,7 +2384,7 @@ SDValue SelectionDAG::getSrcValue(const Value *V) {
SDValue SelectionDAG::getMDNode(const MDNode *MD) {
FoldingSetNodeID ID;
AddNodeIDNode(ID, ISD::MDNODE_SDNODE, getVTList(MVT::Other), std::nullopt);
AddNodeIDNode(ID, ISD::MDNODE_SDNODE, getVTList(MVT::Other), {});
ID.AddPointer(MD);
void *IP = nullptr;
@ -5944,7 +5944,7 @@ static SDValue foldCONCAT_VECTORS(const SDLoc &DL, EVT VT,
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT) {
SDVTList VTs = getVTList(VT);
FoldingSetNodeID ID;
AddNodeIDNode(ID, Opcode, VTs, std::nullopt);
AddNodeIDNode(ID, Opcode, VTs, {});
void *IP = nullptr;
if (SDNode *E = FindNodeOrInsertPos(ID, DL, IP))
return SDValue(E, 0);
@ -10428,7 +10428,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL,
SDVTList VTList) {
return getNode(Opcode, DL, VTList, std::nullopt);
return getNode(Opcode, DL, VTList, ArrayRef<SDValue>());
}
SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
@ -10695,7 +10695,7 @@ void SelectionDAG::setNodeMemRefs(MachineSDNode *N,
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT) {
SDVTList VTs = getVTList(VT);
return SelectNodeTo(N, MachineOpc, VTs, std::nullopt);
return SelectNodeTo(N, MachineOpc, VTs, {});
}
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
@ -10736,7 +10736,7 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
EVT VT1, EVT VT2) {
SDVTList VTs = getVTList(VT1, VT2);
return SelectNodeTo(N, MachineOpc, VTs, std::nullopt);
return SelectNodeTo(N, MachineOpc, VTs, {});
}
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
@ -10903,7 +10903,7 @@ SDNode* SelectionDAG::mutateStrictFPToFP(SDNode *Node) {
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,
EVT VT) {
SDVTList VTs = getVTList(VT);
return getMachineNode(Opcode, dl, VTs, std::nullopt);
return getMachineNode(Opcode, dl, VTs, {});
}
MachineSDNode *SelectionDAG::getMachineNode(unsigned Opcode, const SDLoc &dl,

View File

@ -3180,10 +3180,9 @@ SelectionDAGBuilder::visitSPDescriptorFailure(StackProtectorDescriptor &SPD) {
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
TargetLowering::MakeLibCallOptions CallOptions;
CallOptions.setDiscardResult(true);
SDValue Chain =
TLI.makeLibCall(DAG, RTLIB::STACKPROTECTOR_CHECK_FAIL, MVT::isVoid,
std::nullopt, CallOptions, getCurSDLoc())
.second;
SDValue Chain = TLI.makeLibCall(DAG, RTLIB::STACKPROTECTOR_CHECK_FAIL,
MVT::isVoid, {}, CallOptions, getCurSDLoc())
.second;
// On PS4/PS5, the "return address" must still be within the calling
// function, even if it's at the very end, so emit an explicit TRAP here.
// Passing 'true' for doesNotReturn above won't generate the trap for us.

View File

@ -1462,7 +1462,7 @@ void SplitEditor::deleteRematVictims() {
if (Dead.empty())
return;
Edit->eliminateDeadDefs(Dead, std::nullopt);
Edit->eliminateDeadDefs(Dead, {});
}
void SplitEditor::forceRecomputeVNI(const VNInfo &ParentVNI) {

View File

@ -395,7 +395,7 @@ void ExecutionEngine::runStaticConstructorsDestructors(Module &module,
// Execute the ctor/dtor function!
if (Function *F = dyn_cast<Function>(FP))
runFunction(F, std::nullopt);
runFunction(F, {});
// FIXME: It is marginally lame that we just do nothing here if we see an
// entry we don't recognize. It might not be unreasonable for the verifier

View File

@ -69,7 +69,7 @@ Interpreter::~Interpreter() {
void Interpreter::runAtExitHandlers () {
while (!AtExitHandlers.empty()) {
callFunction(AtExitHandlers.back(), std::nullopt);
callFunction(AtExitHandlers.back(), {});
AtExitHandlers.pop_back();
run();
}

View File

@ -83,7 +83,7 @@ namespace llvm::omp {
ArrayRef<Directive> getLeafConstructs(Directive D) {
auto Idx = static_cast<std::size_t>(D);
if (Idx >= Directive_enumSize)
return std::nullopt;
return {};
const auto *Row = LeafConstructTable[LeafConstructTableOrdering[Idx]];
return ArrayRef(&Row[2], static_cast<int>(Row[1]));
}

View File

@ -6606,7 +6606,7 @@ static Function *createOutlinedFunction(
// TODO: We are using nullopt for arguments at the moment. This will
// need to be updated when debug data is being generated for variables.
DISubroutineType *Ty =
DB.createSubroutineType(DB.getOrCreateTypeArray(std::nullopt));
DB.createSubroutineType(DB.getOrCreateTypeArray({}));
DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagDefinition |
DISubprogram::SPFlagOptimized |
DISubprogram::SPFlagLocalToUnit;

View File

@ -2521,7 +2521,7 @@ Constant *ConstantExpr::getGetElementPtr(Type *Ty, Constant *C,
}
const ConstantExprKeyType Key(Instruction::GetElementPtr, ArgVec, NW.getRaw(),
std::nullopt, Ty, InRange);
{}, Ty, InRange);
LLVMContextImpl *pImpl = C->getContext().pImpl;
return pImpl->ExprConstants.getOrCreate(ReqTy, Key);

View File

@ -398,7 +398,7 @@ private:
static ArrayRef<int> getShuffleMaskIfValid(const ConstantExpr *CE) {
if (CE->getOpcode() == Instruction::ShuffleVector)
return CE->getShuffleMask();
return std::nullopt;
return {};
}
static Type *getSourceElementTypeIfValid(const ConstantExpr *CE) {
@ -417,7 +417,7 @@ private:
public:
ConstantExprKeyType(unsigned Opcode, ArrayRef<Constant *> Ops,
unsigned short SubclassOptionalData = 0,
ArrayRef<int> ShuffleMask = std::nullopt,
ArrayRef<int> ShuffleMask = {},
Type *ExplicitTy = nullptr,
std::optional<ConstantRange> InRange = std::nullopt)
: Opcode(Opcode), SubclassOptionalData(SubclassOptionalData), Ops(Ops),

View File

@ -2039,16 +2039,14 @@ static void emitDbgAssign(AssignmentInfo Info, Value *Val, Value *Dest,
StoreToWholeVariable = FragStartBit <= VarStartBit && FragEndBit >= *Size;
}
DIExpression *Expr =
DIExpression::get(StoreLikeInst.getContext(), std::nullopt);
DIExpression *Expr = DIExpression::get(StoreLikeInst.getContext(), {});
if (!StoreToWholeVariable) {
auto R = DIExpression::createFragmentExpression(Expr, FragStartBit,
FragEndBit - FragStartBit);
assert(R.has_value() && "failed to create fragment expression");
Expr = *R;
}
DIExpression *AddrExpr =
DIExpression::get(StoreLikeInst.getContext(), std::nullopt);
DIExpression *AddrExpr = DIExpression::get(StoreLikeInst.getContext(), {});
if (StoreLikeInst.getParent()->IsNewDbgInfoFormat) {
auto *Assign = DbgVariableRecord::createLinkedDVRAssign(
&StoreLikeInst, Val, VarRec.Var, Expr, Dest, AddrExpr, VarRec.DL);

View File

@ -1954,7 +1954,7 @@ DIExpression *DIExpression::append(const DIExpression *Expr,
NewOps.append(Ops.begin(), Ops.end());
// Ensure that the new opcodes are only appended once.
Ops = std::nullopt;
Ops = {};
}
Op.appendToVector(NewOps);
}

View File

@ -346,8 +346,8 @@ CallInst *IRBuilderBase::CreateMalloc(Type *IntPtrTy, Type *AllocTy,
Value *AllocSize, Value *ArraySize,
Function *MallocF, const Twine &Name) {
return CreateMalloc(IntPtrTy, AllocTy, AllocSize, ArraySize, std::nullopt,
MallocF, Name);
return CreateMalloc(IntPtrTy, AllocTy, AllocSize, ArraySize, {}, MallocF,
Name);
}
/// CreateFree - Generate the IR for a call to the builtin free function.

View File

@ -66,9 +66,7 @@ MDNode *MDBuilder::createBranchWeights(ArrayRef<uint32_t> Weights,
return MDNode::get(Context, Vals);
}
MDNode *MDBuilder::createUnpredictable() {
return MDNode::get(Context, std::nullopt);
}
MDNode *MDBuilder::createUnpredictable() { return MDNode::get(Context, {}); }
MDNode *MDBuilder::createFunctionEntryCount(
uint64_t Count, bool Synthetic,

View File

@ -82,7 +82,7 @@ static Metadata *canonicalizeMetadataForValue(LLVMContext &Context,
Metadata *MD) {
if (!MD)
// !{}
return MDNode::get(Context, std::nullopt);
return MDNode::get(Context, {});
// Return early if this isn't a single-operand MDNode.
auto *N = dyn_cast<MDNode>(MD);
@ -91,7 +91,7 @@ static Metadata *canonicalizeMetadataForValue(LLVMContext &Context,
if (!N->getOperand(0))
// !{}
return MDNode::get(Context, std::nullopt);
return MDNode::get(Context, {});
if (auto *C = dyn_cast<ConstantAsMetadata>(N->getOperand(0)))
// Look through the MDNode.
@ -1733,7 +1733,7 @@ void Instruction::setAAMetadata(const AAMDNodes &N) {
void Instruction::setNoSanitizeMetadata() {
setMetadata(llvm::LLVMContext::MD_nosanitize,
llvm::MDNode::get(getContext(), std::nullopt));
llvm::MDNode::get(getContext(), {}));
}
void Instruction::getAllMetadataImpl(

View File

@ -349,7 +349,7 @@ FunctionType *FunctionType::get(Type *ReturnType,
}
FunctionType *FunctionType::get(Type *Result, bool isVarArg) {
return get(Result, std::nullopt, isVarArg);
return get(Result, {}, isVarArg);
}
bool FunctionType::isValidReturnType(Type *RetTy) {
@ -515,7 +515,7 @@ StructType *StructType::create(LLVMContext &Context, StringRef Name) {
}
StructType *StructType::get(LLVMContext &Context, bool isPacked) {
return get(Context, std::nullopt, isPacked);
return get(Context, {}, isPacked);
}
StructType *StructType::create(LLVMContext &Context, ArrayRef<Type*> Elements,

View File

@ -338,9 +338,9 @@ CodeViewContext::getLineExtentIncludingInlinees(unsigned FuncId) {
ArrayRef<MCCVLoc> CodeViewContext::getLinesForExtent(size_t L, size_t R) {
if (R <= L)
return std::nullopt;
return {};
if (L >= MCCVLines.size())
return std::nullopt;
return {};
return ArrayRef(&MCCVLines[L], R - L);
}

View File

@ -290,7 +290,7 @@ void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params,
return;
std::optional<MCDwarfLineStr> NoLineStr(std::nullopt);
MCOS.switchSection(Section);
MCOS.emitLabel(Header.Emit(&MCOS, Params, std::nullopt, NoLineStr).second);
MCOS.emitLabel(Header.Emit(&MCOS, Params, {}, NoLineStr).second);
}
std::pair<MCSymbol *, MCSymbol *>

View File

@ -5714,7 +5714,7 @@ bool AsmParser::parseDirectiveRept(SMLoc DirectiveLoc, StringRef Dir) {
raw_svector_ostream OS(Buf);
while (Count--) {
// Note that the AtPseudoVariable is disabled for instantiations of .rep(t).
if (expandMacro(OS, *M, std::nullopt, std::nullopt, false))
if (expandMacro(OS, *M, {}, {}, false))
return true;
}
instantiateMacroLikeBody(M, DirectiveLoc, OS);

View File

@ -6955,8 +6955,7 @@ bool MasmParser::parseDirectiveRepeat(SMLoc DirectiveLoc, StringRef Dir) {
SmallString<256> Buf;
raw_svector_ostream OS(Buf);
while (Count--) {
if (expandMacro(OS, M->Body, std::nullopt, std::nullopt, M->Locals,
getTok().getLoc()))
if (expandMacro(OS, M->Body, {}, {}, M->Locals, getTok().getLoc()))
return true;
}
instantiateMacroLikeBody(M, DirectiveLoc, OS);
@ -6989,8 +6988,7 @@ bool MasmParser::parseDirectiveWhile(SMLoc DirectiveLoc) {
if (Condition) {
// Instantiate the macro, then resume at this directive to recheck the
// condition.
if (expandMacro(OS, M->Body, std::nullopt, std::nullopt, M->Locals,
getTok().getLoc()))
if (expandMacro(OS, M->Body, {}, {}, M->Locals, getTok().getLoc()))
return true;
instantiateMacroLikeBody(M, DirectiveLoc, /*ExitLoc=*/DirectiveLoc, OS);
}

View File

@ -62,7 +62,7 @@ BuildIDRef llvm::object::getBuildID(const ObjectFile *Obj) {
return ::getBuildID(O->getELFFile());
if (auto *O = dyn_cast<ELFObjectFile<ELF64BE>>(Obj))
return ::getBuildID(O->getELFFile());
return std::nullopt;
return {};
}
std::optional<std::string> BuildIDFetcher::fetch(BuildIDRef BuildID) const {

View File

@ -4906,12 +4906,12 @@ MachOObjectFile::getLinkOptHintsLoadCommand() const {
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoRebaseOpcodes() const {
if (!DyldInfoLoadCmd)
return std::nullopt;
return {};
auto DyldInfoOrErr =
getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd);
if (!DyldInfoOrErr)
return std::nullopt;
return {};
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.rebase_off));
@ -4920,12 +4920,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoRebaseOpcodes() const {
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoBindOpcodes() const {
if (!DyldInfoLoadCmd)
return std::nullopt;
return {};
auto DyldInfoOrErr =
getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd);
if (!DyldInfoOrErr)
return std::nullopt;
return {};
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.bind_off));
@ -4934,12 +4934,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoBindOpcodes() const {
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoWeakBindOpcodes() const {
if (!DyldInfoLoadCmd)
return std::nullopt;
return {};
auto DyldInfoOrErr =
getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd);
if (!DyldInfoOrErr)
return std::nullopt;
return {};
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.weak_bind_off));
@ -4948,12 +4948,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoWeakBindOpcodes() const {
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoLazyBindOpcodes() const {
if (!DyldInfoLoadCmd)
return std::nullopt;
return {};
auto DyldInfoOrErr =
getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd);
if (!DyldInfoOrErr)
return std::nullopt;
return {};
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.lazy_bind_off));
@ -4962,12 +4962,12 @@ ArrayRef<uint8_t> MachOObjectFile::getDyldInfoLazyBindOpcodes() const {
ArrayRef<uint8_t> MachOObjectFile::getDyldInfoExportsTrie() const {
if (!DyldInfoLoadCmd)
return std::nullopt;
return {};
auto DyldInfoOrErr =
getStructOrErr<MachO::dyld_info_command>(*this, DyldInfoLoadCmd);
if (!DyldInfoOrErr)
return std::nullopt;
return {};
MachO::dyld_info_command DyldInfo = DyldInfoOrErr.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldInfo.export_off));
@ -5248,12 +5248,12 @@ MachOObjectFile::getDyldChainedFixupTargets() const {
ArrayRef<uint8_t> MachOObjectFile::getDyldExportsTrie() const {
if (!DyldExportsTrieLoadCmd)
return std::nullopt;
return {};
auto DyldExportsTrieOrError = getStructOrErr<MachO::linkedit_data_command>(
*this, DyldExportsTrieLoadCmd);
if (!DyldExportsTrieOrError)
return std::nullopt;
return {};
MachO::linkedit_data_command DyldExportsTrie = DyldExportsTrieOrError.get();
const uint8_t *Ptr =
reinterpret_cast<const uint8_t *>(getPtr(*this, DyldExportsTrie.dataoff));
@ -5277,7 +5277,7 @@ SmallVector<uint64_t> MachOObjectFile::getFunctionStarts() const {
ArrayRef<uint8_t> MachOObjectFile::getUuid() const {
if (!UuidLoadCmd)
return std::nullopt;
return {};
// Returning a pointer is fine as uuid doesn't need endian swapping.
const char *Ptr = UuidLoadCmd + offsetof(MachO::uuid_command, uuid);
return ArrayRef(reinterpret_cast<const uint8_t *>(Ptr), 16);

View File

@ -134,7 +134,7 @@ void ArgList::AddAllArgsExcept(ArgStringList &Output,
/// This is a nicer interface when you don't have a list of Ids to exclude.
void ArgList::addAllArgs(ArgStringList &Output,
ArrayRef<OptSpecifier> Ids) const {
ArrayRef<OptSpecifier> Exclude = std::nullopt;
ArrayRef<OptSpecifier> Exclude = {};
AddAllArgsExcept(Output, Ids, Exclude);
}

View File

@ -258,9 +258,8 @@ public:
Token getNext();
void printError(SMLoc Loc, SourceMgr::DiagKind Kind, const Twine &Message,
ArrayRef<SMRange> Ranges = std::nullopt) {
SM.PrintMessage(Loc, Kind, Message, Ranges, /* FixIts= */ std::nullopt,
ShowColors);
ArrayRef<SMRange> Ranges = {}) {
SM.PrintMessage(Loc, Kind, Message, Ranges, /* FixIts= */ {}, ShowColors);
}
void setError(const Twine &Message, StringRef::iterator Position) {

View File

@ -28,7 +28,7 @@ bool llvm::TableGenParseFile(SourceMgr &InputSrcMgr, RecordKeeper &Records) {
auto *MainFileBuffer = SrcMgr.getMemoryBuffer(SrcMgr.getMainFileID());
Records.saveInputFilename(MainFileBuffer->getBufferIdentifier().str());
TGParser Parser(SrcMgr, /*Macros=*/std::nullopt, Records,
TGParser Parser(SrcMgr, /*Macros=*/{}, Records,
/*NoWarnOnUnusedTemplateArgs=*/false,
/*TrackReferenceLocs=*/true);
bool ParseResult = Parser.ParseFile();

View File

@ -3294,7 +3294,7 @@ Init *TGParser::ParseDeclaration(Record *CurRec,
SMLoc ValLoc = Lex.getLoc();
Init *Val = ParseValue(CurRec, Type);
if (!Val ||
SetValue(CurRec, ValLoc, DeclName, std::nullopt, Val,
SetValue(CurRec, ValLoc, DeclName, {}, Val,
/*AllowSelfAssignment=*/false, /*OverrideDefLoc=*/false)) {
// Return the name, even if an error is thrown. This is so that we can
// continue to make some progress, even without the value having been

View File

@ -96,8 +96,8 @@ bool AArch64StorePairSuppress::shouldAddSTPToBlock(const MachineBasicBlock *BB)
SingleSCDesc->isValid() && !SingleSCDesc->isVariant()) {
// Compute the new critical resource length after replacing 2 separate
// STRDui with one STPDi.
unsigned ResLenWithSTP = BBTrace.getResourceLength(
std::nullopt, PairSCDesc, {SingleSCDesc, SingleSCDesc});
unsigned ResLenWithSTP =
BBTrace.getResourceLength({}, PairSCDesc, {SingleSCDesc, SingleSCDesc});
if (ResLenWithSTP > ResLength) {
LLVM_DEBUG(dbgs() << " Suppress STP in BB: " << BB->getNumber()
<< " resources " << ResLength << " -> " << ResLenWithSTP

View File

@ -203,8 +203,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
InstructionCost getAddressComputationCost(Type *Ty, ScalarEvolution *SE,
const SCEV *Ptr);
@ -399,7 +398,7 @@ public:
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
VectorType *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr);
InstructionCost getScalarizationOverhead(VectorType *Ty,

View File

@ -1450,7 +1450,8 @@ bool AArch64CallLowering::lowerCall(MachineIRBuilder &MIRBuilder,
if (!determineAndHandleAssignments(
UsingReturnedArg ? ReturnedArgHandler : Handler, Assigner, InArgs,
MIRBuilder, Info.CallConv, Info.IsVarArg,
UsingReturnedArg ? ArrayRef(OutArgs[0].Regs) : std::nullopt))
UsingReturnedArg ? ArrayRef(OutArgs[0].Regs)
: ArrayRef<Register>()))
return false;
}

View File

@ -1043,7 +1043,7 @@ AMDGPUPromoteAllocaImpl::getLocalSizeYZ(IRBuilder<> &Builder) {
Value *GEPZU = Builder.CreateConstInBoundsGEP1_64(I32Ty, DispatchPtr, 2);
LoadInst *LoadZU = Builder.CreateAlignedLoad(I32Ty, GEPZU, Align(4));
MDNode *MD = MDNode::get(Mod->getContext(), std::nullopt);
MDNode *MD = MDNode::get(Mod->getContext(), {});
LoadXY->setMetadata(LLVMContext::MD_invariant_load, MD);
LoadZU->setMetadata(LLVMContext::MD_invariant_load, MD);
ST.makeLIDRangeMetadata(LoadZU);

View File

@ -1603,7 +1603,7 @@ bool GCNTargetMachine::parseMachineFunctionInfo(
Error = SMDiagnostic(*PFS.SM, SMLoc(), Buffer.getBufferIdentifier(), 1,
RegName.Value.size(), SourceMgr::DK_Error,
"incorrect register class for field", RegName.Value,
std::nullopt, std::nullopt);
{}, {});
SourceRange = RegName.SourceRange;
return true;
};

View File

@ -156,8 +156,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
InstructionCost getCFInstrCost(unsigned Opcode, TTI::TargetCostKind CostKind,
const Instruction *I = nullptr);
@ -235,7 +234,7 @@ public:
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
VectorType *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr);
bool areInlineCompatible(const Function *Caller,

View File

@ -739,7 +739,7 @@ bool SIMachineFunctionInfo::initializeBaseYamlFields(
Error = SMDiagnostic(*PFS.SM, SMLoc(), Buffer.getBufferIdentifier(), 1, 1,
SourceMgr::DK_Error, toString(FIOrErr.takeError()),
"", std::nullopt, std::nullopt);
"", {}, {});
SourceRange = YamlMFI.ScavengeFI->SourceRange;
return true;
}

View File

@ -220,7 +220,7 @@ public:
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
VectorType *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr);
bool preferInLoopReduction(unsigned Opcode, Type *Ty,
@ -256,8 +256,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
InstructionCost
getMemoryOpCost(unsigned Opcode, Type *Src, MaybeAlign Alignment,

View File

@ -59,8 +59,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr) {
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr) {
int ISD = TLI->InstructionOpcodeToISD(Opcode);
if (ISD == ISD::ADD && CostKind == TTI::TCK_RecipThroughput)
return SCEVCheapExpansionBudget.getValue() + 1;

View File

@ -121,8 +121,7 @@ public:
InstructionCost getShuffleCost(TTI::ShuffleKind Kind, Type *Tp,
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
Type *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
Type *SubTp, ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr);
InstructionCost getGatherScatterOpCost(unsigned Opcode, Type *DataTy,
const Value *Ptr, bool VariableMask,
@ -141,8 +140,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
TTI::CastContextHint CCH,
TTI::TargetCostKind CostKind,

View File

@ -142,8 +142,8 @@ public:
Value *createHvxIntrinsic(IRBuilderBase &Builder, Intrinsic::ID IntID,
Type *RetTy, ArrayRef<Value *> Args,
ArrayRef<Type *> ArgTys = std::nullopt,
ArrayRef<Value *> MDSources = std::nullopt) const;
ArrayRef<Type *> ArgTys = {},
ArrayRef<Value *> MDSources = {}) const;
SmallVector<Value *> splitVectorElements(IRBuilderBase &Builder, Value *Vec,
unsigned ToWidth) const;
Value *joinVectorElements(IRBuilderBase &Builder, ArrayRef<Value *> Values,
@ -318,26 +318,24 @@ private:
Value *createLoad(IRBuilderBase &Builder, Type *ValTy, Value *Ptr,
Value *Predicate, int Alignment, Value *Mask,
Value *PassThru,
ArrayRef<Value *> MDSources = std::nullopt) const;
Value *PassThru, ArrayRef<Value *> MDSources = {}) const;
Value *createSimpleLoad(IRBuilderBase &Builder, Type *ValTy, Value *Ptr,
int Alignment,
ArrayRef<Value *> MDSources = std::nullopt) const;
ArrayRef<Value *> MDSources = {}) const;
Value *createStore(IRBuilderBase &Builder, Value *Val, Value *Ptr,
Value *Predicate, int Alignment, Value *Mask,
ArrayRef<Value *> MDSources = std ::nullopt) const;
ArrayRef<Value *> MDSources = {}) const;
Value *createSimpleStore(IRBuilderBase &Builder, Value *Val, Value *Ptr,
int Alignment,
ArrayRef<Value *> MDSources = std ::nullopt) const;
ArrayRef<Value *> MDSources = {}) const;
Value *createPredicatedLoad(IRBuilderBase &Builder, Type *ValTy, Value *Ptr,
Value *Predicate, int Alignment,
ArrayRef<Value *> MDSources = std::nullopt) const;
Value *
createPredicatedStore(IRBuilderBase &Builder, Value *Val, Value *Ptr,
Value *Predicate, int Alignment,
ArrayRef<Value *> MDSources = std::nullopt) const;
ArrayRef<Value *> MDSources = {}) const;
Value *createPredicatedStore(IRBuilderBase &Builder, Value *Val, Value *Ptr,
Value *Predicate, int Alignment,
ArrayRef<Value *> MDSources = {}) const;
DepList getUpwardDeps(Instruction *In, Instruction *Base) const;
bool createAddressGroups();
@ -767,8 +765,8 @@ auto AlignVectors::createPredicatedLoad(IRBuilderBase &Builder, Type *ValTy,
auto V6_vL32b_pred_ai = HVC.HST.getIntrinsicId(Hexagon::V6_vL32b_pred_ai);
// FIXME: This may not put the offset from Ptr into the vmem offset.
return HVC.createHvxIntrinsic(Builder, V6_vL32b_pred_ai, ValTy,
{Predicate, Ptr, HVC.getConstInt(0)},
std::nullopt, MDSources);
{Predicate, Ptr, HVC.getConstInt(0)}, {},
MDSources);
}
auto AlignVectors::createStore(IRBuilderBase &Builder, Value *Val, Value *Ptr,
@ -838,8 +836,8 @@ auto AlignVectors::createPredicatedStore(IRBuilderBase &Builder, Value *Val,
auto V6_vS32b_pred_ai = HVC.HST.getIntrinsicId(Hexagon::V6_vS32b_pred_ai);
// FIXME: This may not put the offset from Ptr into the vmem offset.
return HVC.createHvxIntrinsic(Builder, V6_vS32b_pred_ai, nullptr,
{Predicate, Ptr, HVC.getConstInt(0), Val},
std::nullopt, MDSources);
{Predicate, Ptr, HVC.getConstInt(0), Val}, {},
MDSources);
}
auto AlignVectors::getUpwardDeps(Instruction *In, Instruction *Base) const

View File

@ -94,8 +94,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr) {
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr) {
int ISD = TLI->InstructionOpcodeToISD(Opcode);
switch (ISD) {

View File

@ -98,8 +98,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
TTI::UnrollingPreferences &UP,

View File

@ -106,13 +106,11 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
InstructionCost getShuffleCost(TTI::ShuffleKind Kind, Type *Tp,
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
Type *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
Type *SubTp, ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr);
InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
TTI::CastContextHint CCH,

View File

@ -1961,8 +1961,7 @@ InstructionCost RISCVTTIImpl::getPointersChainCost(
continue;
Cost += getArithmeticInstrCost(Instruction::Add, GEP->getType(), CostKind,
{TTI::OK_AnyValue, TTI::OP_None},
{TTI::OK_AnyValue, TTI::OP_None},
std::nullopt);
{TTI::OK_AnyValue, TTI::OP_None}, {});
} else {
SmallVector<const Value *> Indices(GEP->indices());
Cost += getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(),

View File

@ -146,7 +146,7 @@ public:
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
VectorType *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr);
InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
@ -210,8 +210,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
bool isElementTypeLegalForScalableVector(Type *Ty) const {
return TLI->isLegalElementTypeForRVV(TLI->getValueType(DL, Ty));

View File

@ -89,13 +89,12 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
InstructionCost getShuffleCost(TTI::ShuffleKind Kind, VectorType *Tp,
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
VectorType *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr);
unsigned getVectorTruncCost(Type *SrcTy, Type *DstTy);
unsigned getVectorBitmaskConversionCost(Type *SrcTy, Type *DstTy);

View File

@ -767,7 +767,7 @@ void WebAssemblyLowerEmscriptenEHSjLj::wrapTestSetjmp(
// Output parameter assignment
Label = LabelPHI;
EndBB = EndBB1;
LongjmpResult = IRB.CreateCall(GetTempRet0F, std::nullopt, "longjmp_result");
LongjmpResult = IRB.CreateCall(GetTempRet0F, {}, "longjmp_result");
}
void WebAssemblyLowerEmscriptenEHSjLj::rebuildSSA(Function &F) {
@ -1222,7 +1222,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runEHOnFunction(Function &F) {
CallInst *FMCI = IRB.CreateCall(FMCF, FMCArgs, "fmc");
Value *Poison = PoisonValue::get(LPI->getType());
Value *Pair0 = IRB.CreateInsertValue(Poison, FMCI, 0, "pair0");
Value *TempRet0 = IRB.CreateCall(GetTempRet0F, std::nullopt, "tempret0");
Value *TempRet0 = IRB.CreateCall(GetTempRet0F, {}, "tempret0");
Value *Pair1 = IRB.CreateInsertValue(Pair0, TempRet0, 1, "pair1");
LPI->replaceAllUsesWith(Pair1);

View File

@ -63,8 +63,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
using BaseT::getVectorInstrCost;
InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val,
TTI::TargetCostKind CostKind,

View File

@ -453,8 +453,8 @@ namespace {
// Create zero.
SDVTList VTs = CurDAG->getVTList(MVT::i32, MVT::i32);
SDValue Zero = SDValue(
CurDAG->getMachineNode(X86::MOV32r0, dl, VTs, std::nullopt), 0);
SDValue Zero =
SDValue(CurDAG->getMachineNode(X86::MOV32r0, dl, VTs, {}), 0);
if (VT == MVT::i64) {
Zero = SDValue(
CurDAG->getMachineNode(
@ -5826,8 +5826,8 @@ void X86DAGToDAGISel::Select(SDNode *Node) {
} else {
// Zero out the high part, effectively zero extending the input.
SDVTList VTs = CurDAG->getVTList(MVT::i32, MVT::i32);
SDValue ClrNode = SDValue(
CurDAG->getMachineNode(X86::MOV32r0, dl, VTs, std::nullopt), 0);
SDValue ClrNode =
SDValue(CurDAG->getMachineNode(X86::MOV32r0, dl, VTs, {}), 0);
switch (NVT.SimpleTy) {
case MVT::i16:
ClrNode =

View File

@ -1435,14 +1435,14 @@ static ArrayRef<MCPhysReg> get64BitArgumentXMMs(MachineFunction &MF,
// in their paired GPR. So we only need to save the GPR to their home
// slots.
// TODO: __vectorcall will change this.
return std::nullopt;
return {};
}
bool isSoftFloat = Subtarget.useSoftFloat();
if (isSoftFloat || !Subtarget.hasSSE1())
// Kernel mode asks for SSE to be disabled, so there are no XMM argument
// registers.
return std::nullopt;
return {};
static const MCPhysReg XMMArgRegs64Bit[] = {
X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3,

View File

@ -254,8 +254,8 @@ void X86LowerAMXType::combineLoadBitcast(LoadInst *LD, BitCastInst *Bitcast) {
Value *I8Ptr = LD->getOperand(0);
std::array<Value *, 4> Args = {Row, Col, I8Ptr, Stride};
Value *NewInst = Builder.CreateIntrinsic(Intrinsic::x86_tileloadd64_internal,
std::nullopt, Args);
Value *NewInst =
Builder.CreateIntrinsic(Intrinsic::x86_tileloadd64_internal, {}, Args);
Bitcast->replaceAllUsesWith(NewInst);
}
@ -280,8 +280,7 @@ void X86LowerAMXType::combineBitcastStore(BitCastInst *Bitcast, StoreInst *ST) {
Value *Stride = Builder.getInt64(64);
Value *I8Ptr = ST->getOperand(1);
std::array<Value *, 5> Args = {Row, Col, I8Ptr, Stride, Tile};
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, std::nullopt,
Args);
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, {}, Args);
if (Bitcast->hasOneUse())
return;
// %13 = bitcast x86_amx %src to <256 x i32>
@ -330,8 +329,8 @@ bool X86LowerAMXType::transformBitcast(BitCastInst *Bitcast) {
Value *Row = nullptr, *Col = nullptr;
std::tie(Row, Col) = getShape(II, OpNo);
std::array<Value *, 4> Args = {Row, Col, I8Ptr, Stride};
Value *NewInst = Builder.CreateIntrinsic(
Intrinsic::x86_tileloadd64_internal, std::nullopt, Args);
Value *NewInst =
Builder.CreateIntrinsic(Intrinsic::x86_tileloadd64_internal, {}, Args);
Bitcast->replaceAllUsesWith(NewInst);
} else {
// %2 = bitcast x86_amx %src to <256 x i32>
@ -348,8 +347,7 @@ bool X86LowerAMXType::transformBitcast(BitCastInst *Bitcast) {
Value *Row = II->getOperand(0);
Value *Col = II->getOperand(1);
std::array<Value *, 5> Args = {Row, Col, I8Ptr, Stride, Src};
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, std::nullopt,
Args);
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, {}, Args);
Value *NewInst = Builder.CreateLoad(Bitcast->getType(), AllocaAddr);
Bitcast->replaceAllUsesWith(NewInst);
}
@ -480,8 +478,8 @@ static Instruction *createTileStore(Instruction *TileDef, Value *Ptr) {
Value *Stride = Builder.getInt64(64);
std::array<Value *, 5> Args = {Row, Col, Ptr, Stride, TileDef};
Instruction *TileStore = Builder.CreateIntrinsic(
Intrinsic::x86_tilestored64_internal, std::nullopt, Args);
Instruction *TileStore =
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, {}, Args);
return TileStore;
}
@ -505,8 +503,8 @@ static void replaceWithTileLoad(Use &U, Value *Ptr, bool IsPHI = false) {
Value *Stride = Builder.getInt64(64);
std::array<Value *, 4> Args = {Row, Col, Ptr, Stride};
Value *TileLoad = Builder.CreateIntrinsic(Intrinsic::x86_tileloadd64_internal,
std::nullopt, Args);
Value *TileLoad =
Builder.CreateIntrinsic(Intrinsic::x86_tileloadd64_internal, {}, Args);
UserI->replaceUsesOfWith(V, TileLoad);
}
@ -799,7 +797,7 @@ bool X86LowerAMXCast::optimizeAMXCastFromPhi(
auto *Block = OldPN->getIncomingBlock(I);
BasicBlock::iterator Iter = Block->getTerminator()->getIterator();
Instruction *NewInst = Builder.CreateIntrinsic(
Intrinsic::x86_tilezero_internal, std::nullopt, {Row, Col});
Intrinsic::x86_tilezero_internal, {}, {Row, Col});
NewInst->moveBefore(&*Iter);
NewInst = Builder.CreateIntrinsic(Intrinsic::x86_cast_tile_to_vector,
{IncValue->getType()}, {NewInst});
@ -942,8 +940,7 @@ bool X86LowerAMXCast::combineCastStore(IntrinsicInst *Cast, StoreInst *ST) {
Value *Stride = Builder.CreateSExt(Col, Builder.getInt64Ty());
Value *I8Ptr = Builder.CreateBitCast(ST->getOperand(1), Builder.getPtrTy());
std::array<Value *, 5> Args = {Row, Col, I8Ptr, Stride, Tile};
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, std::nullopt,
Args);
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, {}, Args);
return true;
}
@ -987,8 +984,8 @@ bool X86LowerAMXCast::combineLoadCast(IntrinsicInst *Cast, LoadInst *LD) {
}
std::array<Value *, 4> Args = {Row, Col, I8Ptr, Stride};
Value *NewInst = Builder.CreateIntrinsic(Intrinsic::x86_tileloadd64_internal,
std::nullopt, Args);
Value *NewInst =
Builder.CreateIntrinsic(Intrinsic::x86_tileloadd64_internal, {}, Args);
Cast->replaceAllUsesWith(NewInst);
return EraseLoad;
@ -1175,8 +1172,8 @@ bool X86LowerAMXCast::transformAMXCast(IntrinsicInst *AMXCast) {
std::tie(Row, Col) = getShape(II, OpNo);
std::array<Value *, 4> Args = {
Row, Col, I8Ptr, Builder.CreateSExt(Col, Builder.getInt64Ty())};
Value *NewInst = Builder.CreateIntrinsic(
Intrinsic::x86_tileloadd64_internal, std::nullopt, Args);
Value *NewInst =
Builder.CreateIntrinsic(Intrinsic::x86_tileloadd64_internal, {}, Args);
AMXCast->replaceAllUsesWith(NewInst);
AMXCast->eraseFromParent();
} else {
@ -1195,8 +1192,7 @@ bool X86LowerAMXCast::transformAMXCast(IntrinsicInst *AMXCast) {
Value *Col = II->getOperand(1);
std::array<Value *, 5> Args = {
Row, Col, I8Ptr, Builder.CreateSExt(Col, Builder.getInt64Ty()), Src};
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, std::nullopt,
Args);
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, {}, Args);
Value *NewInst = Builder.CreateLoad(AMXCast->getType(), AllocaAddr);
AMXCast->replaceAllUsesWith(NewInst);
AMXCast->eraseFromParent();

View File

@ -1594,9 +1594,8 @@ InstructionCost X86TTIImpl::getShuffleCost(
auto *SubTy = FixedVectorType::get(BaseTp->getElementType(),
SubLT.second.getVectorNumElements());
int ExtractIndex = alignDown((Index % NumElts), NumSubElts);
InstructionCost ExtractCost =
getShuffleCost(TTI::SK_ExtractSubvector, VecTy, std::nullopt,
CostKind, ExtractIndex, SubTy);
InstructionCost ExtractCost = getShuffleCost(
TTI::SK_ExtractSubvector, VecTy, {}, CostKind, ExtractIndex, SubTy);
// If the original size is 32-bits or more, we can use pshufd. Otherwise
// if we have SSSE3 we can use pshufb.
@ -1753,7 +1752,7 @@ InstructionCost X86TTIImpl::getShuffleCost(
InstructionCost NumOfShuffles = (NumOfSrcs - 1) * NumOfDests;
return NumOfShuffles * getShuffleCost(TTI::SK_PermuteTwoSrc, SingleOpTy,
std::nullopt, CostKind, 0, nullptr);
{}, CostKind, 0, nullptr);
}
return BaseT::getShuffleCost(Kind, BaseTp, Mask, CostKind, Index, SubTp);
@ -4742,8 +4741,8 @@ InstructionCost X86TTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
EVT VT = TLI->getValueType(DL, Val);
if (VT.getScalarType() != MScalarTy || VT.getSizeInBits() >= 128)
SubTy = FixedVectorType::get(ScalarType, SubNumElts);
ShuffleCost = getShuffleCost(TTI::SK_PermuteTwoSrc, SubTy, std::nullopt,
CostKind, 0, SubTy);
ShuffleCost =
getShuffleCost(TTI::SK_PermuteTwoSrc, SubTy, {}, CostKind, 0, SubTy);
}
int IntOrFpCost = ScalarType->isFloatingPointTy() ? 0 : 1;
return ShuffleCost + IntOrFpCost + RegisterFileMoveCost;
@ -4821,8 +4820,8 @@ X86TTIImpl::getScalarizationOverhead(VectorType *Ty, const APInt &DemandedElts,
// FIXME: we don't need to extract if all non-demanded elements
// are legalization-inserted padding.
if (!LaneEltMask.isAllOnes())
Cost += getShuffleCost(TTI::SK_ExtractSubvector, Ty, std::nullopt,
CostKind, I * NumEltsPerLane, LaneTy);
Cost += getShuffleCost(TTI::SK_ExtractSubvector, Ty, {}, CostKind,
I * NumEltsPerLane, LaneTy);
Cost += BaseT::getScalarizationOverhead(LaneTy, LaneEltMask, Insert,
/*Extract*/ false, CostKind);
}
@ -4839,8 +4838,8 @@ X86TTIImpl::getScalarizationOverhead(VectorType *Ty, const APInt &DemandedElts,
if (!AffectedLanes[I] ||
(Lane == 0 && FullyAffectedLegalVectors[LegalVec]))
continue;
Cost += getShuffleCost(TTI::SK_InsertSubvector, Ty, std::nullopt,
CostKind, I * NumEltsPerLane, LaneTy);
Cost += getShuffleCost(TTI::SK_InsertSubvector, Ty, {}, CostKind,
I * NumEltsPerLane, LaneTy);
}
}
}
@ -4899,8 +4898,8 @@ X86TTIImpl::getScalarizationOverhead(VectorType *Ty, const APInt &DemandedElts,
NumEltsPerLane, I * NumEltsPerLane);
if (LaneEltMask.isZero())
continue;
Cost += getShuffleCost(TTI::SK_ExtractSubvector, Ty, std::nullopt,
CostKind, I * NumEltsPerLane, LaneTy);
Cost += getShuffleCost(TTI::SK_ExtractSubvector, Ty, {}, CostKind,
I * NumEltsPerLane, LaneTy);
Cost += BaseT::getScalarizationOverhead(
LaneTy, LaneEltMask, /*Insert*/ false, Extract, CostKind);
}
@ -5018,7 +5017,7 @@ X86TTIImpl::getReplicationShuffleCost(Type *EltTy, int ReplicationFactor,
unsigned NumDstVectorsDemanded = DemandedDstVectors.popcount();
InstructionCost SingleShuffleCost = getShuffleCost(
TTI::SK_PermuteSingleSrc, SingleDstVecTy, /*Mask=*/std::nullopt, CostKind,
TTI::SK_PermuteSingleSrc, SingleDstVecTy, /*Mask=*/{}, CostKind,
/*Index=*/0, /*SubTp=*/nullptr);
return NumDstVectorsDemanded * SingleShuffleCost;
}
@ -5146,8 +5145,7 @@ InstructionCost X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
if (!Is0thSubVec)
Cost += getShuffleCost(IsLoad ? TTI::ShuffleKind::SK_InsertSubvector
: TTI::ShuffleKind::SK_ExtractSubvector,
VTy, std::nullopt, CostKind, NumEltDone(),
CurrVecTy);
VTy, {}, CostKind, NumEltDone(), CurrVecTy);
}
// While we can directly load/store ZMM, YMM, and 64-bit halves of XMM,
@ -5235,17 +5233,17 @@ X86TTIImpl::getMaskedMemoryOpCost(unsigned Opcode, Type *SrcTy, Align Alignment,
if (VT.isSimple() && Ty != VT.getSimpleVT() &&
LT.second.getVectorNumElements() == NumElem)
// Promotion requires extend/truncate for data and a shuffle for mask.
Cost += getShuffleCost(TTI::SK_PermuteTwoSrc, SrcVTy, std::nullopt,
CostKind, 0, nullptr) +
getShuffleCost(TTI::SK_PermuteTwoSrc, MaskTy, std::nullopt,
CostKind, 0, nullptr);
Cost +=
getShuffleCost(TTI::SK_PermuteTwoSrc, SrcVTy, {}, CostKind, 0,
nullptr) +
getShuffleCost(TTI::SK_PermuteTwoSrc, MaskTy, {}, CostKind, 0, nullptr);
else if (LT.first * Ty.getVectorNumElements() > NumElem) {
auto *NewMaskTy = FixedVectorType::get(MaskTy->getElementType(),
Ty.getVectorNumElements());
// Expanding requires fill mask with zeroes
Cost += getShuffleCost(TTI::SK_InsertSubvector, NewMaskTy, std::nullopt,
CostKind, 0, MaskTy);
Cost += getShuffleCost(TTI::SK_InsertSubvector, NewMaskTy, {}, CostKind, 0,
MaskTy);
}
// Pre-AVX512 - each maskmov load costs 2 + store costs ~8.
@ -5510,9 +5508,8 @@ X86TTIImpl::getArithmeticReductionCost(unsigned Opcode, VectorType *ValTy,
// If we're reducing from 256/512 bits, use an extract_subvector.
if (Size > 128) {
auto *SubTy = FixedVectorType::get(ValVTy->getElementType(), NumVecElts);
ReductionCost +=
getShuffleCost(TTI::SK_ExtractSubvector, Ty, std::nullopt, CostKind,
NumVecElts, SubTy);
ReductionCost += getShuffleCost(TTI::SK_ExtractSubvector, Ty, {},
CostKind, NumVecElts, SubTy);
Ty = SubTy;
} else if (Size == 128) {
// Reducing from 128 bits is a permute of v2f64/v2i64.
@ -5523,8 +5520,8 @@ X86TTIImpl::getArithmeticReductionCost(unsigned Opcode, VectorType *ValTy,
else
ShufTy =
FixedVectorType::get(Type::getInt64Ty(ValVTy->getContext()), 2);
ReductionCost += getShuffleCost(TTI::SK_PermuteSingleSrc, ShufTy,
std::nullopt, CostKind, 0, nullptr);
ReductionCost += getShuffleCost(TTI::SK_PermuteSingleSrc, ShufTy, {},
CostKind, 0, nullptr);
} else if (Size == 64) {
// Reducing from 64 bits is a shuffle of v4f32/v4i32.
FixedVectorType *ShufTy;
@ -5534,8 +5531,8 @@ X86TTIImpl::getArithmeticReductionCost(unsigned Opcode, VectorType *ValTy,
else
ShufTy =
FixedVectorType::get(Type::getInt32Ty(ValVTy->getContext()), 4);
ReductionCost += getShuffleCost(TTI::SK_PermuteSingleSrc, ShufTy,
std::nullopt, CostKind, 0, nullptr);
ReductionCost += getShuffleCost(TTI::SK_PermuteSingleSrc, ShufTy, {},
CostKind, 0, nullptr);
} else {
// Reducing from smaller size is a shift by immediate.
auto *ShiftTy = FixedVectorType::get(
@ -5693,8 +5690,8 @@ X86TTIImpl::getMinMaxReductionCost(Intrinsic::ID IID, VectorType *ValTy,
// If we're reducing from 256/512 bits, use an extract_subvector.
if (Size > 128) {
auto *SubTy = FixedVectorType::get(ValVTy->getElementType(), NumVecElts);
MinMaxCost += getShuffleCost(TTI::SK_ExtractSubvector, Ty, std::nullopt,
CostKind, NumVecElts, SubTy);
MinMaxCost += getShuffleCost(TTI::SK_ExtractSubvector, Ty, {}, CostKind,
NumVecElts, SubTy);
Ty = SubTy;
} else if (Size == 128) {
// Reducing from 128 bits is a permute of v2f64/v2i64.
@ -5704,8 +5701,8 @@ X86TTIImpl::getMinMaxReductionCost(Intrinsic::ID IID, VectorType *ValTy,
FixedVectorType::get(Type::getDoubleTy(ValTy->getContext()), 2);
else
ShufTy = FixedVectorType::get(Type::getInt64Ty(ValTy->getContext()), 2);
MinMaxCost += getShuffleCost(TTI::SK_PermuteSingleSrc, ShufTy,
std::nullopt, CostKind, 0, nullptr);
MinMaxCost += getShuffleCost(TTI::SK_PermuteSingleSrc, ShufTy, {},
CostKind, 0, nullptr);
} else if (Size == 64) {
// Reducing from 64 bits is a shuffle of v4f32/v4i32.
FixedVectorType *ShufTy;
@ -5713,8 +5710,8 @@ X86TTIImpl::getMinMaxReductionCost(Intrinsic::ID IID, VectorType *ValTy,
ShufTy = FixedVectorType::get(Type::getFloatTy(ValTy->getContext()), 4);
else
ShufTy = FixedVectorType::get(Type::getInt32Ty(ValTy->getContext()), 4);
MinMaxCost += getShuffleCost(TTI::SK_PermuteSingleSrc, ShufTy,
std::nullopt, CostKind, 0, nullptr);
MinMaxCost += getShuffleCost(TTI::SK_PermuteSingleSrc, ShufTy, {},
CostKind, 0, nullptr);
} else {
// Reducing from smaller size is a shift by immediate.
auto *ShiftTy = FixedVectorType::get(
@ -6470,8 +6467,8 @@ InstructionCost X86TTIImpl::getInterleavedMemoryOpCostAVX512(
TTI::ShuffleKind ShuffleKind =
(NumOfMemOps > 1) ? TTI::SK_PermuteTwoSrc : TTI::SK_PermuteSingleSrc;
InstructionCost ShuffleCost = getShuffleCost(
ShuffleKind, SingleMemOpTy, std::nullopt, CostKind, 0, nullptr);
InstructionCost ShuffleCost =
getShuffleCost(ShuffleKind, SingleMemOpTy, {}, CostKind, 0, nullptr);
unsigned NumOfLoadsInInterleaveGrp =
Indices.size() ? Indices.size() : Factor;
@ -6528,7 +6525,7 @@ InstructionCost X86TTIImpl::getInterleavedMemoryOpCostAVX512(
// shuffle.
unsigned NumOfSources = Factor; // The number of values to be merged.
InstructionCost ShuffleCost = getShuffleCost(
TTI::SK_PermuteTwoSrc, SingleMemOpTy, std::nullopt, CostKind, 0, nullptr);
TTI::SK_PermuteTwoSrc, SingleMemOpTy, {}, CostKind, 0, nullptr);
unsigned NumOfShufflesPerStore = NumOfSources - 1;
// The SK_MergeTwoSrc shuffle clobbers one of src operands.

View File

@ -140,8 +140,7 @@ public:
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
TTI::OperandValueInfo Op1Info = {TTI::OK_AnyValue, TTI::OP_None},
TTI::OperandValueInfo Op2Info = {TTI::OK_AnyValue, TTI::OP_None},
ArrayRef<const Value *> Args = std::nullopt,
const Instruction *CxtI = nullptr);
ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr);
InstructionCost getAltInstrCost(VectorType *VecTy, unsigned Opcode0,
unsigned Opcode1,
const SmallBitVector &OpcodeMask,
@ -151,7 +150,7 @@ public:
ArrayRef<int> Mask,
TTI::TargetCostKind CostKind, int Index,
VectorType *SubTp,
ArrayRef<const Value *> Args = std::nullopt,
ArrayRef<const Value *> Args = {},
const Instruction *CxtI = nullptr);
InstructionCost getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
TTI::CastContextHint CCH,

View File

@ -78,7 +78,7 @@ static void processCall(CallBase *CB, Function *Caller, Function *NewCallee,
} else if (auto *II = dyn_cast<InvokeInst>(CB)) {
NewCB = InvokeInst::Create(NewCallee->getFunctionType(), NewCallee,
II->getNormalDest(), II->getUnwindDest(),
NewArgs, std::nullopt, "", NewCBInsertPt);
NewArgs, {}, "", NewCBInsertPt);
} else {
llvm_unreachable("CallBase should either be Call or Invoke!");
}

View File

@ -678,11 +678,9 @@ Function *IROutliner::createFunction(Module &M, OutlinableGroup &Group,
Mg.getNameWithPrefix(MangledNameStream, F, false);
DISubprogram *OutlinedSP = DB.createFunction(
Unit /* Context */, F->getName(), Dummy,
Unit /* File */,
Unit /* Context */, F->getName(), Dummy, Unit /* File */,
0 /* Line 0 is reserved for compiler-generated code. */,
DB.createSubroutineType(
DB.getOrCreateTypeArray(std::nullopt)), /* void type */
DB.createSubroutineType(DB.getOrCreateTypeArray({})), /* void type */
0, /* Line 0 is reserved for compiler-generated code. */
DINode::DIFlags::FlagArtificial /* Compiler-generated code. */,
/* Outlined code is optimized code by definition. */

View File

@ -860,8 +860,8 @@ void llvm::updatePublicTypeTestCalls(Module &M,
for (Use &U : make_early_inc_range(PublicTypeTestFunc->uses())) {
auto *CI = cast<CallInst>(U.getUser());
auto *NewCI = CallInst::Create(
TypeTestFunc, {CI->getArgOperand(0), CI->getArgOperand(1)},
std::nullopt, "", CI->getIterator());
TypeTestFunc, {CI->getArgOperand(0), CI->getArgOperand(1)}, {}, "",
CI->getIterator());
CI->replaceAllUsesWith(NewCI);
CI->eraseFromParent();
}

View File

@ -3067,7 +3067,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
LHS->getOpcode() == Instruction::Load &&
LHS->getType()->isPointerTy() &&
isValidAssumeForContext(II, LHS, &DT)) {
MDNode *MD = MDNode::get(II->getContext(), std::nullopt);
MDNode *MD = MDNode::get(II->getContext(), {});
LHS->setMetadata(LLVMContext::MD_nonnull, MD);
LHS->setMetadata(LLVMContext::MD_noundef, MD);
return RemoveConditionFromAssume(II);

View File

@ -3336,8 +3336,8 @@ Instruction *InstCombinerImpl::visitAllocSite(Instruction &MI) {
// Replace invoke with a NOP intrinsic to maintain the original CFG
Module *M = II->getModule();
Function *F = Intrinsic::getDeclaration(M, Intrinsic::donothing);
InvokeInst::Create(F, II->getNormalDest(), II->getUnwindDest(),
std::nullopt, "", II->getParent());
InvokeInst::Create(F, II->getNormalDest(), II->getUnwindDest(), {}, "",
II->getParent());
}
// Remove debug intrinsics which describe the value contained within the

View File

@ -1175,7 +1175,7 @@ bool DataFlowSanitizer::initializeModule(Module &M) {
PointerType::getUnqual(*Ctx), IntptrTy};
DFSanSetLabelFnTy = FunctionType::get(Type::getVoidTy(*Ctx),
DFSanSetLabelArgs, /*isVarArg=*/false);
DFSanNonzeroLabelFnTy = FunctionType::get(Type::getVoidTy(*Ctx), std::nullopt,
DFSanNonzeroLabelFnTy = FunctionType::get(Type::getVoidTy(*Ctx), {},
/*isVarArg=*/false);
DFSanVarargWrapperFnTy = FunctionType::get(
Type::getVoidTy(*Ctx), PointerType::getUnqual(*Ctx), /*isVarArg=*/false);

View File

@ -1131,7 +1131,7 @@ Value *InstrLowerer::getCounterAddress(InstrProfCntrInstBase *I) {
BiasLI = EntryBuilder.CreateLoad(Int64Ty, Bias, "profc_bias");
// Bias doesn't change after startup.
BiasLI->setMetadata(LLVMContext::MD_invariant_load,
MDNode::get(M.getContext(), std::nullopt));
MDNode::get(M.getContext(), {}));
}
auto *Add = Builder.CreateAdd(Builder.CreatePtrToInt(Addr, Int64Ty), BiasLI);
return Builder.CreateIntToPtr(Add, Addr->getType());
@ -1212,7 +1212,7 @@ Value *InstrLowerer::getBitmapAddress(InstrProfMCDCTVBitmapUpdate *I) {
auto *BiasLI = EntryBuilder.CreateLoad(Int64Ty, Bias, "profbm_bias");
// Assume BiasLI invariant (in the function at least)
BiasLI->setMetadata(LLVMContext::MD_invariant_load,
MDNode::get(M.getContext(), std::nullopt));
MDNode::get(M.getContext(), {}));
// Add Bias to Bitmaps and put it before the intrinsic.
IRBuilder<> Builder(I);

View File

@ -476,8 +476,8 @@ bool ObjCARCContract::tryToPeepholeInstruction(
RVInstMarker->getString(),
/*Constraints=*/"", /*hasSideEffects=*/true);
objcarc::createCallInstWithColors(IA, std::nullopt, "",
Inst->getIterator(), BlockColors);
objcarc::createCallInstWithColors(IA, {}, "", Inst->getIterator(),
BlockColors);
}
decline_rv_optimization:
return false;

View File

@ -994,7 +994,7 @@ void ObjCARCOpt::OptimizeIndividualCallImpl(Function &F, Instruction *Inst,
CallInst *NewCall = CallInst::Create(Decl, Call->getArgOperand(0), "",
Call->getIterator());
NewCall->setMetadata(MDKindCache.get(ARCMDKindID::ImpreciseRelease),
MDNode::get(C, std::nullopt));
MDNode::get(C, {}));
LLVM_DEBUG(dbgs() << "Replacing autorelease{,RV}(x) with objc_release(x) "
"since x is otherwise unused.\nOld: "

View File

@ -505,8 +505,8 @@ static void shortenAssignment(Instruction *Inst, Value *OriginalDest,
// Failed to create a fragment expression for this so discard the value,
// making this a kill location.
auto *Expr = *DIExpression::createFragmentExpression(
DIExpression::get(Assign->getContext(), std::nullopt),
DeadFragment.OffsetInBits, DeadFragment.SizeInBits);
DIExpression::get(Assign->getContext(), {}), DeadFragment.OffsetInBits,
DeadFragment.SizeInBits);
Assign->setExpression(Expr);
Assign->setKillLocation();
};

View File

@ -1380,7 +1380,7 @@ public:
for (unsigned I = 1; I < N; ++I)
EmbedCost +=
TTI.getShuffleCost(TTI::SK_Splice, FixedVectorType::get(EltTy, 1),
std::nullopt, TTI::TCK_RecipThroughput);
{}, TTI::TCK_RecipThroughput);
return EmbedCost;
}
@ -1402,7 +1402,7 @@ public:
for (unsigned I = 1; I < N; ++I)
EmbedCost -=
TTI.getShuffleCost(TTI::SK_Splice, FixedVectorType::get(EltTy, 1),
std::nullopt, TTI::TCK_RecipThroughput);
{}, TTI::TCK_RecipThroughput);
return EmbedCost;
}

View File

@ -236,7 +236,7 @@ static ArrayRef<Use> GetDeoptBundleOperands(const CallBase *Call) {
if (!DeoptBundle) {
assert(AllowStatepointWithNoDeoptInfo &&
"Found non-leaf call without deopt info!");
return std::nullopt;
return {};
}
return DeoptBundle->Inputs;

View File

@ -429,7 +429,7 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit,
// discard the value component of this dbg.assign as the value cannot
// be computed with the new fragment.
Expr = *DIExpression::createFragmentExpression(
DIExpression::get(Expr->getContext(), std::nullopt),
DIExpression::get(Expr->getContext(), {}),
NewFragment.OffsetInBits, NewFragment.SizeInBits);
SetKillLocation = true;
}
@ -445,8 +445,7 @@ static void migrateDebugInfo(AllocaInst *OldAlloca, bool IsSplit,
::Value *NewValue = Value ? Value : DbgAssign->getValue();
auto *NewAssign = UnwrapDbgInstPtr(
DIB.insertDbgAssign(Inst, NewValue, DbgAssign->getVariable(), Expr,
Dest,
DIExpression::get(Expr->getContext(), std::nullopt),
Dest, DIExpression::get(Expr->getContext(), {}),
DbgAssign->getDebugLoc()),
DbgAssign);

View File

@ -1554,8 +1554,7 @@ static void fixupDebugInfoPostExtraction(Function &OldFunc, Function &NewFunc,
assert(OldSP->getUnit() && "Missing compile unit for subprogram");
DIBuilder DIB(*OldFunc.getParent(), /*AllowUnresolved=*/false,
OldSP->getUnit());
auto SPType =
DIB.createSubroutineType(DIB.getOrCreateTypeArray(std::nullopt));
auto SPType = DIB.createSubroutineType(DIB.getOrCreateTypeArray({}));
DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagDefinition |
DISubprogram::SPFlagOptimized |
DISubprogram::SPFlagLocalToUnit;

View File

@ -115,8 +115,7 @@ bool llvm::applyDebugifyMetadata(
continue;
bool InsertedDbgVal = false;
auto SPType =
DIB.createSubroutineType(DIB.getOrCreateTypeArray(std::nullopt));
auto SPType = DIB.createSubroutineType(DIB.getOrCreateTypeArray({}));
DISubprogram::DISPFlags SPFlags =
DISubprogram::SPFlagDefinition | DISubprogram::SPFlagOptimized;
if (F.hasPrivateLinkage() || F.hasInternalLinkage())

View File

@ -1042,7 +1042,7 @@ void ScopedAliasMetadataDeepCloner::clone() {
SmallVector<TempMDTuple, 16> DummyNodes;
for (const MDNode *I : MD) {
DummyNodes.push_back(MDTuple::getTemporary(I->getContext(), std::nullopt));
DummyNodes.push_back(MDTuple::getTemporary(I->getContext(), {}));
MDMap[I].reset(DummyNodes.back().get());
}

View File

@ -3638,7 +3638,7 @@ void llvm::copyRangeMetadata(const DataLayout &DL, const LoadInst &OldLI,
unsigned BitWidth = DL.getPointerTypeSizeInBits(NewTy);
if (BitWidth == OldLI.getType()->getScalarSizeInBits() &&
!getConstantRangeFromMetadata(*N).contains(APInt(BitWidth, 0))) {
MDNode *NN = MDNode::get(OldLI.getContext(), std::nullopt);
MDNode *NN = MDNode::get(OldLI.getContext(), {});
NewLI.setMetadata(LLVMContext::MD_nonnull, NN);
}
}

View File

@ -391,9 +391,8 @@ Value *Mapper::mapValue(const Value *V) {
// ensures metadata operands only reference defined SSA values.
return (Flags & RF_IgnoreMissingLocals)
? nullptr
: MetadataAsValue::get(
V->getContext(),
MDTuple::get(V->getContext(), std::nullopt));
: MetadataAsValue::get(V->getContext(),
MDTuple::get(V->getContext(), {}));
}
if (auto *AL = dyn_cast<DIArgList>(MD)) {
SmallVector<ValueAsMetadata *, 4> MappedArgs;

View File

@ -5666,8 +5666,8 @@ LoopVectorizationCostModel::getConsecutiveMemOpCost(Instruction *I,
bool Reverse = ConsecutiveStride < 0;
if (Reverse)
Cost += TTI.getShuffleCost(TargetTransformInfo::SK_Reverse, VectorTy,
std::nullopt, CostKind, 0);
Cost += TTI.getShuffleCost(TargetTransformInfo::SK_Reverse, VectorTy, {},
CostKind, 0);
return Cost;
}
@ -5746,8 +5746,8 @@ LoopVectorizationCostModel::getInterleaveGroupCost(Instruction *I,
assert(!Legal->isMaskRequired(I) &&
"Reverse masked interleaved access not supported.");
Cost += Group->getNumMembers() *
TTI.getShuffleCost(TargetTransformInfo::SK_Reverse, VectorTy,
std::nullopt, CostKind, 0);
TTI.getShuffleCost(TargetTransformInfo::SK_Reverse, VectorTy, {},
CostKind, 0);
}
return Cost;
}

Some files were not shown because too many files have changed in this diff Show More