[RISCV] Remove Type::isRVVType() and replace with isRVVSizelessBuiltinType(). NFC

These both do the same thing, but some profiling on a
Releast+Asserts build suggests isRVVSizelessBuiltinType() is the
more efficient version so lets keep that one.
This commit is contained in:
Craig Topper 2023-12-08 18:43:08 -08:00
parent cb92511c4d
commit b88b480640
5 changed files with 4 additions and 14 deletions

View File

@ -2384,8 +2384,6 @@ public:
bool isRVVType(unsigned ElementCount) const;
bool isRVVType() const;
bool isRVVType(unsigned Bitwidth, bool IsFloat, bool IsBFloat = false) const;
/// Return the implicit lifetime for this type, which must not be dependent.
@ -7284,14 +7282,6 @@ inline bool Type::isOpenCLSpecificType() const {
isQueueT() || isReserveIDT() || isPipeType() || isOCLExtOpaqueType();
}
inline bool Type::isRVVType() const {
#define RVV_TYPE(Name, Id, SingletonId) \
isSpecificBuiltinType(BuiltinType::Id) ||
return
#include "clang/Basic/RISCVVTypes.def"
false; // end of boolean or operation.
}
inline bool Type::isRVVType(unsigned ElementCount) const {
bool Ret = false;
#define RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned, \

View File

@ -64,7 +64,7 @@ static bool isTrackedVar(const VarDecl *vd, const DeclContext *dc) {
QualType ty = vd->getType();
if (const auto *RD = ty->getAsRecordDecl())
return recordIsNotEmpty(RD);
return ty->isScalarType() || ty->isVectorType() || ty->isRVVType();
return ty->isScalarType() || ty->isVectorType() || ty->isRVVSizelessBuiltinType();
}
return false;
}

View File

@ -2077,7 +2077,7 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
targetDiag(D->getLocation(), diag::note_defined_here, FD) << D;
}
if (TI.hasRISCVVTypes() && Ty->isRVVType())
if (TI.hasRISCVVTypes() && Ty->isRVVSizelessBuiltinType())
checkRVVTypeSupport(Ty, Loc, D);
// Don't allow SVE types in functions without a SVE target.

View File

@ -5983,7 +5983,7 @@ bool Sema::CheckRISCVBuiltinFunctionCall(const TargetInfo &TI,
ValType = ValType.getUnqualifiedType();
if (!ValType->isIntegerType() && !ValType->isAnyPointerType() &&
!ValType->isBlockPointerType() && !ValType->isFloatingType() &&
!ValType->isVectorType() && !ValType->isRVVType()) {
!ValType->isVectorType() && !ValType->isRVVSizelessBuiltinType()) {
Diag(DRE->getBeginLoc(),
diag::err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector)
<< PointerArg->getType() << PointerArg->getSourceRange();

View File

@ -8914,7 +8914,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
}
}
if (T->isRVVType())
if (T->isRVVSizelessBuiltinType())
checkRVVTypeSupport(T, NewVD->getLocation(), cast<Decl>(CurContext));
}