[clang] 0708500 - [Clang] Remove bogus assert in are[Lax]CompatibleSveTypes()

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Thu May 2 09:14:08 PDT 2024


Author: Sander de Smalen
Date: 2024-05-02T16:13:37Z
New Revision: 0708500ce0149c501e802b7ab6581770cc7a5334

URL: https://github.com/llvm/llvm-project/commit/0708500ce0149c501e802b7ab6581770cc7a5334
DIFF: https://github.com/llvm/llvm-project/commit/0708500ce0149c501e802b7ab6581770cc7a5334.diff

LOG: [Clang] Remove bogus assert in are[Lax]CompatibleSveTypes()

This caused an assertion failure for the following input:

  __SVInt32_t bar(__SVInt32_t x);

  void foo(__SVInt32_t x) {
    return bar(x);
  }

Added: 
    

Modified: 
    clang/lib/AST/ASTContext.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index cbf4932aff9a6b..03014568f8fe66 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -9554,11 +9554,6 @@ static uint64_t getSVETypeSize(ASTContext &Context, const BuiltinType *Ty) {
 
 bool ASTContext::areCompatibleSveTypes(QualType FirstType,
                                        QualType SecondType) {
-  assert(
-      ((FirstType->isSVESizelessBuiltinType() && SecondType->isVectorType()) ||
-       (FirstType->isVectorType() && SecondType->isSVESizelessBuiltinType())) &&
-      "Expected SVE builtin type and vector type!");
-
   auto IsValidCast = [this](QualType FirstType, QualType SecondType) {
     if (const auto *BT = FirstType->getAs<BuiltinType>()) {
       if (const auto *VT = SecondType->getAs<VectorType>()) {
@@ -9584,11 +9579,6 @@ bool ASTContext::areCompatibleSveTypes(QualType FirstType,
 
 bool ASTContext::areLaxCompatibleSveTypes(QualType FirstType,
                                           QualType SecondType) {
-  assert(
-      ((FirstType->isSVESizelessBuiltinType() && SecondType->isVectorType()) ||
-       (FirstType->isVectorType() && SecondType->isSVESizelessBuiltinType())) &&
-      "Expected SVE builtin type and vector type!");
-
   auto IsLaxCompatible = [this](QualType FirstType, QualType SecondType) {
     const auto *BT = FirstType->getAs<BuiltinType>();
     if (!BT)


        


More information about the cfe-commits mailing list