Skip to content

Commit b88b480

Browse files
committed
[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.
1 parent cb92511 commit b88b480

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

clang/include/clang/AST/Type.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2384,8 +2384,6 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
23842384

23852385
bool isRVVType(unsigned ElementCount) const;
23862386

2387-
bool isRVVType() const;
2388-
23892387
bool isRVVType(unsigned Bitwidth, bool IsFloat, bool IsBFloat = false) const;
23902388

23912389
/// Return the implicit lifetime for this type, which must not be dependent.
@@ -7284,14 +7282,6 @@ inline bool Type::isOpenCLSpecificType() const {
72847282
isQueueT() || isReserveIDT() || isPipeType() || isOCLExtOpaqueType();
72857283
}
72867284

7287-
inline bool Type::isRVVType() const {
7288-
#define RVV_TYPE(Name, Id, SingletonId) \
7289-
isSpecificBuiltinType(BuiltinType::Id) ||
7290-
return
7291-
#include "clang/Basic/RISCVVTypes.def"
7292-
false; // end of boolean or operation.
7293-
}
7294-
72957285
inline bool Type::isRVVType(unsigned ElementCount) const {
72967286
bool Ret = false;
72977287
#define RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned, \

clang/lib/Analysis/UninitializedValues.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static bool isTrackedVar(const VarDecl *vd, const DeclContext *dc) {
6464
QualType ty = vd->getType();
6565
if (const auto *RD = ty->getAsRecordDecl())
6666
return recordIsNotEmpty(RD);
67-
return ty->isScalarType() || ty->isVectorType() || ty->isRVVType();
67+
return ty->isScalarType() || ty->isVectorType() || ty->isRVVSizelessBuiltinType();
6868
}
6969
return false;
7070
}

clang/lib/Sema/Sema.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
20772077
targetDiag(D->getLocation(), diag::note_defined_here, FD) << D;
20782078
}
20792079

2080-
if (TI.hasRISCVVTypes() && Ty->isRVVType())
2080+
if (TI.hasRISCVVTypes() && Ty->isRVVSizelessBuiltinType())
20812081
checkRVVTypeSupport(Ty, Loc, D);
20822082

20832083
// Don't allow SVE types in functions without a SVE target.

clang/lib/Sema/SemaChecking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5983,7 +5983,7 @@ bool Sema::CheckRISCVBuiltinFunctionCall(const TargetInfo &TI,
59835983
ValType = ValType.getUnqualifiedType();
59845984
if (!ValType->isIntegerType() && !ValType->isAnyPointerType() &&
59855985
!ValType->isBlockPointerType() && !ValType->isFloatingType() &&
5986-
!ValType->isVectorType() && !ValType->isRVVType()) {
5986+
!ValType->isVectorType() && !ValType->isRVVSizelessBuiltinType()) {
59875987
Diag(DRE->getBeginLoc(),
59885988
diag::err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector)
59895989
<< PointerArg->getType() << PointerArg->getSourceRange();

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8914,7 +8914,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
89148914
}
89158915
}
89168916

8917-
if (T->isRVVType())
8917+
if (T->isRVVSizelessBuiltinType())
89188918
checkRVVTypeSupport(T, NewVD->getLocation(), cast<Decl>(CurContext));
89198919
}
89208920

0 commit comments

Comments
 (0)