mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
Fix some clang-tidy bugprone-argument-comment issues
This commit is contained in:
parent
6ab9d78a52
commit
64799c106c
@ -772,7 +772,7 @@ public:
|
|||||||
/// CreateMachineInstr - Allocate a new MachineInstr. Use this instead
|
/// CreateMachineInstr - Allocate a new MachineInstr. Use this instead
|
||||||
/// of `new MachineInstr'.
|
/// of `new MachineInstr'.
|
||||||
MachineInstr *CreateMachineInstr(const MCInstrDesc &MCID, const DebugLoc &DL,
|
MachineInstr *CreateMachineInstr(const MCInstrDesc &MCID, const DebugLoc &DL,
|
||||||
bool NoImp = false);
|
bool NoImplicit = false);
|
||||||
|
|
||||||
/// Create a new MachineInstr which is a copy of \p Orig, identical in all
|
/// Create a new MachineInstr which is a copy of \p Orig, identical in all
|
||||||
/// ways except the instruction has no parent, prev, or next. Bundling flags
|
/// ways except the instruction has no parent, prev, or next. Bundling flags
|
||||||
|
@ -596,7 +596,7 @@ public:
|
|||||||
GlobalValue::LinkageTypes::AvailableExternallyLinkage,
|
GlobalValue::LinkageTypes::AvailableExternallyLinkage,
|
||||||
/*NotEligibleToImport=*/true, /*Live=*/true, /*IsLocal=*/false,
|
/*NotEligibleToImport=*/true, /*Live=*/true, /*IsLocal=*/false,
|
||||||
/*CanAutoHide=*/false),
|
/*CanAutoHide=*/false),
|
||||||
/*InsCount=*/0, FunctionSummary::FFlags{}, /*EntryCount=*/0,
|
/*NumInsts=*/0, FunctionSummary::FFlags{}, /*EntryCount=*/0,
|
||||||
std::vector<ValueInfo>(), std::move(Edges),
|
std::vector<ValueInfo>(), std::move(Edges),
|
||||||
std::vector<GlobalValue::GUID>(),
|
std::vector<GlobalValue::GUID>(),
|
||||||
std::vector<FunctionSummary::VFuncId>(),
|
std::vector<FunctionSummary::VFuncId>(),
|
||||||
|
@ -28,8 +28,8 @@ template <typename T, typename F>
|
|||||||
std::enable_if_t<std::is_integral<T>::value && sizeof(T) * 8 <= 64,
|
std::enable_if_t<std::is_integral<T>::value && sizeof(T) * 8 <= 64,
|
||||||
llvm::Optional<T>>
|
llvm::Optional<T>>
|
||||||
checkedOp(T LHS, T RHS, F Op, bool Signed = true) {
|
checkedOp(T LHS, T RHS, F Op, bool Signed = true) {
|
||||||
llvm::APInt ALHS(/*BitSize=*/sizeof(T) * 8, LHS, Signed);
|
llvm::APInt ALHS(sizeof(T) * 8, LHS, Signed);
|
||||||
llvm::APInt ARHS(/*BitSize=*/sizeof(T) * 8, RHS, Signed);
|
llvm::APInt ARHS(sizeof(T) * 8, RHS, Signed);
|
||||||
bool Overflow;
|
bool Overflow;
|
||||||
llvm::APInt Out = (ALHS.*Op)(ARHS, Overflow);
|
llvm::APInt Out = (ALHS.*Op)(ARHS, Overflow);
|
||||||
if (Overflow)
|
if (Overflow)
|
||||||
|
@ -147,11 +147,11 @@ public:
|
|||||||
: MinSize(MinSize), IsScalable(Scalable) {}
|
: MinSize(MinSize), IsScalable(Scalable) {}
|
||||||
|
|
||||||
static constexpr TypeSize Fixed(uint64_t Size) {
|
static constexpr TypeSize Fixed(uint64_t Size) {
|
||||||
return TypeSize(Size, /*IsScalable=*/false);
|
return TypeSize(Size, /*Scalable=*/false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr TypeSize Scalable(uint64_t MinSize) {
|
static constexpr TypeSize Scalable(uint64_t MinSize) {
|
||||||
return TypeSize(MinSize, /*IsScalable=*/true);
|
return TypeSize(MinSize, /*Scalable=*/true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scalable vector types with the same minimum size as a fixed size type are
|
// Scalable vector types with the same minimum size as a fixed size type are
|
||||||
|
@ -636,7 +636,7 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
|
|||||||
const DataLayout *DL) const {
|
const DataLayout *DL) const {
|
||||||
LLVMContext &Ctx = FTy.getContext();
|
LLVMContext &Ctx = FTy.getContext();
|
||||||
Type *PCharTy = Type::getInt8PtrTy(Ctx);
|
Type *PCharTy = Type::getInt8PtrTy(Ctx);
|
||||||
Type *SizeTTy = DL ? DL->getIntPtrType(Ctx, /*AS=*/0) : nullptr;
|
Type *SizeTTy = DL ? DL->getIntPtrType(Ctx, /*AddressSpace=*/0) : nullptr;
|
||||||
auto IsSizeTTy = [SizeTTy](Type *Ty) {
|
auto IsSizeTTy = [SizeTTy](Type *Ty) {
|
||||||
return SizeTTy ? Ty == SizeTTy : Ty->isIntegerTy();
|
return SizeTTy ? Ty == SizeTTy : Ty->isIntegerTy();
|
||||||
};
|
};
|
||||||
|
@ -699,7 +699,7 @@ static void interpretValues(const MachineInstr *CurMI,
|
|||||||
Register FP = TRI.getFrameRegister(*MF);
|
Register FP = TRI.getFrameRegister(*MF);
|
||||||
bool IsSPorFP = (RegLoc == SP) || (RegLoc == FP);
|
bool IsSPorFP = (RegLoc == SP) || (RegLoc == FP);
|
||||||
if (TRI.isCalleeSavedPhysReg(RegLoc, *MF) || IsSPorFP) {
|
if (TRI.isCalleeSavedPhysReg(RegLoc, *MF) || IsSPorFP) {
|
||||||
MachineLocation MLoc(RegLoc, /*IsIndirect=*/IsSPorFP);
|
MachineLocation MLoc(RegLoc, /*Indirect=*/IsSPorFP);
|
||||||
finishCallSiteParams(MLoc, ParamValue->second,
|
finishCallSiteParams(MLoc, ParamValue->second,
|
||||||
ForwardedRegWorklist[ParamFwdReg], Params);
|
ForwardedRegWorklist[ParamFwdReg], Params);
|
||||||
} else {
|
} else {
|
||||||
|
@ -134,17 +134,18 @@ bool BranchFolderPass::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
MF.getSubtarget().getRegisterInfo());
|
MF.getSubtarget().getRegisterInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
BranchFolder::BranchFolder(bool defaultEnableTailMerge, bool CommonHoist,
|
BranchFolder::BranchFolder(bool DefaultEnableTailMerge, bool CommonHoist,
|
||||||
MBFIWrapper &FreqInfo,
|
MBFIWrapper &FreqInfo,
|
||||||
const MachineBranchProbabilityInfo &ProbInfo,
|
const MachineBranchProbabilityInfo &ProbInfo,
|
||||||
ProfileSummaryInfo *PSI,
|
ProfileSummaryInfo *PSI, unsigned MinTailLength)
|
||||||
unsigned MinTailLength)
|
|
||||||
: EnableHoistCommonCode(CommonHoist), MinCommonTailLength(MinTailLength),
|
: EnableHoistCommonCode(CommonHoist), MinCommonTailLength(MinTailLength),
|
||||||
MBBFreqInfo(FreqInfo), MBPI(ProbInfo), PSI(PSI) {
|
MBBFreqInfo(FreqInfo), MBPI(ProbInfo), PSI(PSI) {
|
||||||
if (MinCommonTailLength == 0)
|
if (MinCommonTailLength == 0)
|
||||||
MinCommonTailLength = TailMergeSize;
|
MinCommonTailLength = TailMergeSize;
|
||||||
switch (FlagEnableTailMerge) {
|
switch (FlagEnableTailMerge) {
|
||||||
case cl::BOU_UNSET: EnableTailMerge = defaultEnableTailMerge; break;
|
case cl::BOU_UNSET:
|
||||||
|
EnableTailMerge = DefaultEnableTailMerge;
|
||||||
|
break;
|
||||||
case cl::BOU_TRUE: EnableTailMerge = true; break;
|
case cl::BOU_TRUE: EnableTailMerge = true; break;
|
||||||
case cl::BOU_FALSE: EnableTailMerge = false; break;
|
case cl::BOU_FALSE: EnableTailMerge = false; break;
|
||||||
}
|
}
|
||||||
|
@ -32,8 +32,7 @@ class TargetRegisterInfo;
|
|||||||
|
|
||||||
class LLVM_LIBRARY_VISIBILITY BranchFolder {
|
class LLVM_LIBRARY_VISIBILITY BranchFolder {
|
||||||
public:
|
public:
|
||||||
explicit BranchFolder(bool defaultEnableTailMerge,
|
explicit BranchFolder(bool DefaultEnableTailMerge, bool CommonHoist,
|
||||||
bool CommonHoist,
|
|
||||||
MBFIWrapper &FreqInfo,
|
MBFIWrapper &FreqInfo,
|
||||||
const MachineBranchProbabilityInfo &ProbInfo,
|
const MachineBranchProbabilityInfo &ProbInfo,
|
||||||
ProfileSummaryInfo *PSI,
|
ProfileSummaryInfo *PSI,
|
||||||
|
@ -3359,8 +3359,8 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// No tail merging opportunities if the block number is less than four.
|
// No tail merging opportunities if the block number is less than four.
|
||||||
if (MF.size() > 3 && EnableTailMerge) {
|
if (MF.size() > 3 && EnableTailMerge) {
|
||||||
unsigned TailMergeSize = TailDupSize + 1;
|
unsigned TailMergeSize = TailDupSize + 1;
|
||||||
BranchFolder BF(/*EnableTailMerge=*/true, /*CommonHoist=*/false, *MBFI,
|
BranchFolder BF(/*DefaultEnableTailMerge=*/true, /*CommonHoist=*/false,
|
||||||
*MBPI, PSI, TailMergeSize);
|
*MBFI, *MBPI, PSI, TailMergeSize);
|
||||||
|
|
||||||
if (BF.OptimizeFunction(MF, TII, MF.getSubtarget().getRegisterInfo(), MLI,
|
if (BF.OptimizeFunction(MF, TII, MF.getSubtarget().getRegisterInfo(), MLI,
|
||||||
/*AfterPlacement=*/true)) {
|
/*AfterPlacement=*/true)) {
|
||||||
|
@ -347,9 +347,9 @@ void MachineFunction::assignBeginEndSections() {
|
|||||||
/// Allocate a new MachineInstr. Use this instead of `new MachineInstr'.
|
/// Allocate a new MachineInstr. Use this instead of `new MachineInstr'.
|
||||||
MachineInstr *MachineFunction::CreateMachineInstr(const MCInstrDesc &MCID,
|
MachineInstr *MachineFunction::CreateMachineInstr(const MCInstrDesc &MCID,
|
||||||
const DebugLoc &DL,
|
const DebugLoc &DL,
|
||||||
bool NoImp) {
|
bool NoImplicit) {
|
||||||
return new (InstructionRecycler.Allocate<MachineInstr>(Allocator))
|
return new (InstructionRecycler.Allocate<MachineInstr>(Allocator))
|
||||||
MachineInstr(*this, MCID, DL, NoImp);
|
MachineInstr(*this, MCID, DL, NoImplicit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new MachineInstr which is a copy of the 'Orig' instruction,
|
/// Create a new MachineInstr which is a copy of the 'Orig' instruction,
|
||||||
|
@ -488,7 +488,7 @@ void MachineVerifier::report(const char *msg, const MachineInstr *MI) {
|
|||||||
errs() << "- instruction: ";
|
errs() << "- instruction: ";
|
||||||
if (Indexes && Indexes->hasIndex(*MI))
|
if (Indexes && Indexes->hasIndex(*MI))
|
||||||
errs() << Indexes->getInstructionIndex(*MI) << '\t';
|
errs() << Indexes->getInstructionIndex(*MI) << '\t';
|
||||||
MI->print(errs(), /*SkipOpers=*/true);
|
MI->print(errs(), /*IsStandalone=*/true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MachineVerifier::report(const char *msg, const MachineOperand *MO,
|
void MachineVerifier::report(const char *msg, const MachineOperand *MO,
|
||||||
|
@ -1180,7 +1180,7 @@ std::string ScheduleDAGInstrs::getGraphNodeLabel(const SUnit *SU) const {
|
|||||||
if (SU == &ExitSU)
|
if (SU == &ExitSU)
|
||||||
oss << "<exit>";
|
oss << "<exit>";
|
||||||
else
|
else
|
||||||
SU->getInstr()->print(oss, /*SkipOpers=*/true);
|
SU->getInstr()->print(oss, /*IsStandalone=*/true);
|
||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@ Register FastISel::materializeConstant(const Value *V, MVT VT) {
|
|||||||
getRegForValue(ConstantInt::get(V->getContext(), SIntVal));
|
getRegForValue(ConstantInt::get(V->getContext(), SIntVal));
|
||||||
if (IntegerReg)
|
if (IntegerReg)
|
||||||
Reg = fastEmit_r(IntVT.getSimpleVT(), VT, ISD::SINT_TO_FP, IntegerReg,
|
Reg = fastEmit_r(IntVT.getSimpleVT(), VT, ISD::SINT_TO_FP, IntegerReg,
|
||||||
/*Kill=*/false);
|
/*Op0IsKill=*/false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (const auto *Op = dyn_cast<Operator>(V)) {
|
} else if (const auto *Op = dyn_cast<Operator>(V)) {
|
||||||
@ -1789,13 +1789,13 @@ bool FastISel::selectFNeg(const User *I, const Value *In) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
Register IntResultReg = fastEmit_ri_(
|
Register IntResultReg = fastEmit_ri_(
|
||||||
IntVT.getSimpleVT(), ISD::XOR, IntReg, /*IsKill=*/true,
|
IntVT.getSimpleVT(), ISD::XOR, IntReg, /*Op0IsKill=*/true,
|
||||||
UINT64_C(1) << (VT.getSizeInBits() - 1), IntVT.getSimpleVT());
|
UINT64_C(1) << (VT.getSizeInBits() - 1), IntVT.getSimpleVT());
|
||||||
if (!IntResultReg)
|
if (!IntResultReg)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ResultReg = fastEmit_r(IntVT.getSimpleVT(), VT.getSimpleVT(), ISD::BITCAST,
|
ResultReg = fastEmit_r(IntVT.getSimpleVT(), VT.getSimpleVT(), ISD::BITCAST,
|
||||||
IntResultReg, /*IsKill=*/true);
|
IntResultReg, /*Op0IsKill=*/true);
|
||||||
if (!ResultReg)
|
if (!ResultReg)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1320,7 +1320,7 @@ static bool doImportingForModule(Module &M) {
|
|||||||
|
|
||||||
// Next we need to promote to global scope and rename any local values that
|
// Next we need to promote to global scope and rename any local values that
|
||||||
// are potentially exported to other modules.
|
// are potentially exported to other modules.
|
||||||
if (renameModuleForThinLTO(M, *Index, /*clearDSOOnDeclarations=*/false,
|
if (renameModuleForThinLTO(M, *Index, /*ClearDSOLocalOnDeclarations=*/false,
|
||||||
/*GlobalsToImport=*/nullptr)) {
|
/*GlobalsToImport=*/nullptr)) {
|
||||||
errs() << "Error renaming module\n";
|
errs() << "Error renaming module\n";
|
||||||
return false;
|
return false;
|
||||||
|
@ -432,7 +432,7 @@ void HWAddressSanitizer::createHwasanCtorComdat() {
|
|||||||
auto *NoteTy = StructType::get(Int32Ty, Int32Ty, Int32Ty, Name->getType(),
|
auto *NoteTy = StructType::get(Int32Ty, Int32Ty, Int32Ty, Name->getType(),
|
||||||
Int32Ty, Int32Ty);
|
Int32Ty, Int32Ty);
|
||||||
auto *Note =
|
auto *Note =
|
||||||
new GlobalVariable(M, NoteTy, /*isConstantGlobal=*/true,
|
new GlobalVariable(M, NoteTy, /*isConstant=*/true,
|
||||||
GlobalValue::PrivateLinkage, nullptr, kHwasanNoteName);
|
GlobalValue::PrivateLinkage, nullptr, kHwasanNoteName);
|
||||||
Note->setSection(".note.hwasan.globals");
|
Note->setSection(".note.hwasan.globals");
|
||||||
Note->setComdat(NoteComdat);
|
Note->setComdat(NoteComdat);
|
||||||
|
@ -1435,7 +1435,7 @@ static void fixupDebugInfoPostExtraction(Function &OldFunc, Function &NewFunc,
|
|||||||
// function arguments, as the parameters don't correspond to anything at the
|
// function arguments, as the parameters don't correspond to anything at the
|
||||||
// source level.
|
// source level.
|
||||||
assert(OldSP->getUnit() && "Missing compile unit for subprogram");
|
assert(OldSP->getUnit() && "Missing compile unit for subprogram");
|
||||||
DIBuilder DIB(*OldFunc.getParent(), /*AllowUnresolvedNodes=*/false,
|
DIBuilder DIB(*OldFunc.getParent(), /*AllowUnresolved=*/false,
|
||||||
OldSP->getUnit());
|
OldSP->getUnit());
|
||||||
auto SPType = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
|
auto SPType = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
|
||||||
DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagDefinition |
|
DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagDefinition |
|
||||||
|
@ -775,7 +775,7 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
|
|||||||
// supported on the target.
|
// supported on the target.
|
||||||
if (ST->getMetadata(LLVMContext::MD_nontemporal)) {
|
if (ST->getMetadata(LLVMContext::MD_nontemporal)) {
|
||||||
// Arbitrarily try a vector of 2 elements.
|
// Arbitrarily try a vector of 2 elements.
|
||||||
auto *VecTy = FixedVectorType::get(T, /*NumElements=*/2);
|
auto *VecTy = FixedVectorType::get(T, /*NumElts=*/2);
|
||||||
assert(VecTy && "did not find vectorized version of stored type");
|
assert(VecTy && "did not find vectorized version of stored type");
|
||||||
if (!TTI->isLegalNTStore(VecTy, ST->getAlign())) {
|
if (!TTI->isLegalNTStore(VecTy, ST->getAlign())) {
|
||||||
reportVectorizationFailure(
|
reportVectorizationFailure(
|
||||||
@ -790,7 +790,7 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
|
|||||||
if (LD->getMetadata(LLVMContext::MD_nontemporal)) {
|
if (LD->getMetadata(LLVMContext::MD_nontemporal)) {
|
||||||
// For nontemporal loads, check that a nontemporal vector version is
|
// For nontemporal loads, check that a nontemporal vector version is
|
||||||
// supported on the target (arbitrarily try a vector of 2 elements).
|
// supported on the target (arbitrarily try a vector of 2 elements).
|
||||||
auto *VecTy = FixedVectorType::get(I.getType(), /*NumElements=*/2);
|
auto *VecTy = FixedVectorType::get(I.getType(), /*NumElts=*/2);
|
||||||
assert(VecTy && "did not find vectorized version of load type");
|
assert(VecTy && "did not find vectorized version of load type");
|
||||||
if (!TTI->isLegalNTLoad(VecTy, LD->getAlign())) {
|
if (!TTI->isLegalNTLoad(VecTy, LD->getAlign())) {
|
||||||
reportVectorizationFailure(
|
reportVectorizationFailure(
|
||||||
|
@ -2374,7 +2374,7 @@ BoUpSLP::~BoUpSLP() {
|
|||||||
void BoUpSLP::eraseInstructions(ArrayRef<Value *> AV) {
|
void BoUpSLP::eraseInstructions(ArrayRef<Value *> AV) {
|
||||||
for (auto *V : AV) {
|
for (auto *V : AV) {
|
||||||
if (auto *I = dyn_cast<Instruction>(V))
|
if (auto *I = dyn_cast<Instruction>(V))
|
||||||
eraseInstruction(I, /*ReplaceWithUndef=*/true);
|
eraseInstruction(I, /*ReplaceOpsWithUndef=*/true);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user