[clang] [llvm] Revert "[RISCV][clang] Support XSfmm ABI attributes (#206260)" (PR #241096)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 18:55:25 PST 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-risc-v

Author: Brandon Wu (4vtomat)

<details>
<summary>Changes</summary>

This reverts commit 09dcbfb936c629a1285fb04fff9974456f041804. Revert for now and investigate why compile time increase.

---

Patch is 47.01 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/241096.diff


25 Files Affected:

- (modified) clang/include/clang/AST/TypeBase.h (+7-98) 
- (modified) clang/include/clang/AST/TypeProperties.td (-4) 
- (modified) clang/include/clang/Basic/Attr.td (-35) 
- (modified) clang/include/clang/Basic/AttrDocs.td (-67) 
- (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td (-9) 
- (modified) clang/include/clang/Sema/SemaRISCV.h (-6) 
- (modified) clang/lib/AST/ASTContext.cpp (+2-4) 
- (modified) clang/lib/AST/Type.cpp (-18) 
- (modified) clang/lib/AST/TypePrinter.cpp (-5) 
- (modified) clang/lib/CodeGen/CGCall.cpp (-21) 
- (modified) clang/lib/Sema/SemaChecking.cpp (-4) 
- (modified) clang/lib/Sema/SemaRISCV.cpp (-105) 
- (modified) clang/lib/Sema/SemaType.cpp (-102) 
- (removed) clang/test/PCH/riscv-function-attributes.cpp (-13) 
- (removed) clang/test/Sema/sifive-xsfmm-func-attr.c (-146) 
- (modified) llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp (-6) 
- (modified) llvm/lib/Target/RISCV/RISCV.h (-1) 
- (modified) llvm/lib/Target/RISCV/RISCVCallingConv.cpp (-21) 
- (modified) llvm/lib/Target/RISCV/RISCVCallingConv.h (-4) 
- (modified) llvm/lib/Target/RISCV/RISCVISelLowering.cpp (-5) 
- (modified) llvm/lib/Target/RISCV/RISCVInstrInfo.cpp (-1) 
- (removed) llvm/lib/Target/RISCV/RISCVStateAttributes.h (-29) 
- (modified) llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp (-12) 
- (modified) llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h (-3) 
- (removed) llvm/test/CodeGen/RISCV/riscv-state-check.ll (-32) 


``````````diff
diff --git a/clang/include/clang/AST/TypeBase.h b/clang/include/clang/AST/TypeBase.h
index 35b427318f0dce..56e31f25c26d6d 100644
--- a/clang/include/clang/AST/TypeBase.h
+++ b/clang/include/clang/AST/TypeBase.h
@@ -4993,17 +4993,14 @@ class FunctionType : public Type {
     LLVM_PREFERRED_TYPE(bool)
     unsigned HasArmTypeAttributes : 1;
 
-    LLVM_PREFERRED_TYPE(bool)
-    unsigned HasRISCVTypeAttributes : 1;
-
     LLVM_PREFERRED_TYPE(bool)
     unsigned EffectsHaveConditions : 1;
     unsigned NumFunctionEffects : 4;
 
     FunctionTypeExtraBitfields()
         : NumExceptionType(0), HasExtraAttributeInfo(false),
-          HasArmTypeAttributes(false), HasRISCVTypeAttributes(false),
-          EffectsHaveConditions(false), NumFunctionEffects(0) {}
+          HasArmTypeAttributes(false), EffectsHaveConditions(false),
+          NumFunctionEffects(0) {}
   };
 
   /// A holder for extra information from attributes which aren't part of an
@@ -5049,46 +5046,6 @@ class FunctionType : public Type {
     ARM_InOut = 4,
   };
 
-  /// RISC-V type attributes for states.
-  enum RISCVTypeAttributes : unsigned {
-    RISCVNormalFunction = 0,
-
-    // Describes the value of the xsfmm tile state using RISCVStateValue.
-    // Each tile gets 3 bits to store its state.
-    RISCVXsfmmShift = 0,
-    RISCVXsfmmMask = 0b111 << RISCVXsfmmShift,
-
-    // Currently using 3 bits for xsfmm
-    RISCVAttributeMask = 0b111
-  };
-
-  enum RISCVStateValue : unsigned {
-    RISCVNone = 0,
-    RISCVIn = 1,
-    RISCVOut = 2,
-    RISCVInOut = 3,
-    RISCVPreserves = 4,
-    RISCVNew = 5,
-  };
-
-  static const char *ToRISCVStateString(RISCVStateValue St) {
-    switch (St) {
-    case RISCVNone:
-      return "none";
-    case RISCVIn:
-      return "__riscv_in";
-    case RISCVOut:
-      return "__riscv_out";
-    case RISCVInOut:
-      return "__riscv_inout";
-    case RISCVPreserves:
-      return "__riscv_preserves";
-    case RISCVNew:
-      return "__riscv_new";
-    }
-    llvm_unreachable("Invalid RISC-V state value");
-  }
-
   static ArmStateValue getArmZAState(unsigned AttrBits) {
     return static_cast<ArmStateValue>((AttrBits & SME_ZAMask) >> SME_ZAShift);
   }
@@ -5097,11 +5054,6 @@ class FunctionType : public Type {
     return static_cast<ArmStateValue>((AttrBits & SME_ZT0Mask) >> SME_ZT0Shift);
   }
 
-  static RISCVStateValue getRISCVXsfmmState(unsigned AttrBits) {
-    return static_cast<RISCVStateValue>((AttrBits & RISCVXsfmmMask) >>
-                                        RISCVXsfmmShift);
-  }
-
   /// A holder for Arm type attributes as described in the Arm C/C++
   /// Language extensions which are not particularly common to all
   /// types and therefore accounted separately from FunctionTypeBitfields.
@@ -5114,13 +5066,6 @@ class FunctionType : public Type {
     FunctionTypeArmAttributes() : AArch64SMEAttributes(SME_NormalFunction) {}
   };
 
-  struct alignas(void *) FunctionTypeRISCVAttributes {
-    LLVM_PREFERRED_TYPE(RISCVTypeAttributes)
-    unsigned RISCVAttributes : 3;
-
-    FunctionTypeRISCVAttributes() : RISCVAttributes(RISCVNormalFunction) {}
-  };
-
 protected:
   FunctionType(TypeClass tc, QualType res, QualType Canonical,
                TypeDependence Dependence, ExtInfo Info)
@@ -5598,11 +5543,9 @@ class FunctionProtoType final
           FunctionProtoType, QualType, SourceLocation,
           FunctionType::FunctionTypeExtraBitfields,
           FunctionType::FunctionTypeExtraAttributeInfo,
-          FunctionType::FunctionTypeArmAttributes,
-          FunctionType::FunctionTypeRISCVAttributes,
-          FunctionType::ExceptionType, Expr *, FunctionDecl *,
-          FunctionType::ExtParameterInfo, Qualifiers, FunctionEffect,
-          EffectConditionExpr> {
+          FunctionType::FunctionTypeArmAttributes, FunctionType::ExceptionType,
+          Expr *, FunctionDecl *, FunctionType::ExtParameterInfo, Qualifiers,
+          FunctionEffect, EffectConditionExpr> {
   friend class ASTContext; // ASTContext creates these.
   friend TrailingObjects;
 
@@ -5705,18 +5648,14 @@ class FunctionProtoType final
     unsigned CFIUncheckedCallee : 1;
     LLVM_PREFERRED_TYPE(AArch64SMETypeAttributes)
     unsigned AArch64SMEAttributes : 9;
-    LLVM_PREFERRED_TYPE(RISCVTypeAttributes)
-    unsigned RISCVAttributes : 3;
 
     ExtProtoInfo()
         : Variadic(false), HasTrailingReturn(false), CFIUncheckedCallee(false),
-          AArch64SMEAttributes(SME_NormalFunction),
-          RISCVAttributes(RISCVNormalFunction) {}
+          AArch64SMEAttributes(SME_NormalFunction) {}
 
     ExtProtoInfo(CallingConv CC)
         : ExtInfo(CC), Variadic(false), HasTrailingReturn(false),
-          CFIUncheckedCallee(false), AArch64SMEAttributes(SME_NormalFunction),
-          RISCVAttributes(RISCVNormalFunction) {}
+          CFIUncheckedCallee(false), AArch64SMEAttributes(SME_NormalFunction) {}
 
     ExtProtoInfo withExceptionSpec(const ExceptionSpecInfo &ESI) {
       ExtProtoInfo Result(*this);
@@ -5733,7 +5672,6 @@ class FunctionProtoType final
     bool requiresFunctionProtoTypeExtraBitfields() const {
       return ExceptionSpec.Type == EST_Dynamic ||
              requiresFunctionProtoTypeArmAttributes() ||
-             requiresFunctionProtoTypeRISCVAttributes() ||
              requiresFunctionProtoTypeExtraAttributeInfo() ||
              !FunctionEffects.empty();
     }
@@ -5752,17 +5690,6 @@ class FunctionProtoType final
       else
         AArch64SMEAttributes &= ~Kind;
     }
-
-    bool requiresFunctionProtoTypeRISCVAttributes() const {
-      return RISCVAttributes != RISCVNormalFunction;
-    }
-
-    void setRISCVAttribute(RISCVTypeAttributes Kind, bool Enable = true) {
-      if (Enable)
-        RISCVAttributes |= Kind;
-      else
-        RISCVAttributes &= ~Kind;
-    }
   };
 
 private:
@@ -5778,11 +5705,6 @@ class FunctionProtoType final
     return hasArmTypeAttributes();
   }
 
-  unsigned
-  numTrailingObjects(OverloadToken<FunctionTypeRISCVAttributes>) const {
-    return hasRISCVTypeAttributes();
-  }
-
   unsigned numTrailingObjects(OverloadToken<FunctionTypeExtraBitfields>) const {
     return hasExtraBitfields();
   }
@@ -5896,12 +5818,6 @@ class FunctionProtoType final
                ->HasArmTypeAttributes;
   }
 
-  bool hasRISCVTypeAttributes() const {
-    return FunctionTypeBits.HasExtraBitfields &&
-           getTrailingObjects<FunctionTypeExtraBitfields>()
-               ->HasRISCVTypeAttributes;
-  }
-
   bool hasExtQualifiers() const {
     return FunctionTypeBits.HasExtQuals;
   }
@@ -5931,7 +5847,6 @@ class FunctionProtoType final
     EPI.ExtParameterInfos = getExtParameterInfosOrNull();
     EPI.ExtraAttributeInfo = getExtraAttributeInfo();
     EPI.AArch64SMEAttributes = getAArch64SMEAttributes();
-    EPI.RISCVAttributes = getRISCVAttributes();
     EPI.FunctionEffects = getFunctionEffects();
     return EPI;
   }
@@ -6134,12 +6049,6 @@ class FunctionProtoType final
         ->AArch64SMEAttributes;
   }
 
-  unsigned getRISCVAttributes() const {
-    if (!hasRISCVTypeAttributes())
-      return RISCVNormalFunction;
-    return getTrailingObjects<FunctionTypeRISCVAttributes>()->RISCVAttributes;
-  }
-
   ExtParameterInfo getExtParameterInfo(unsigned I) const {
     assert(I < getNumParams() && "parameter index out of range");
     if (hasExtParameterInfos())
diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td
index e5b7202d8193a4..1a2a3fda0dcff0 100644
--- a/clang/include/clang/AST/TypeProperties.td
+++ b/clang/include/clang/AST/TypeProperties.td
@@ -349,9 +349,6 @@ let Class = FunctionProtoType in {
   def : Property<"AArch64SMEAttributes", UInt32> {
     let Read = [{ node->getAArch64SMEAttributes() }];
   }
-  def : Property<"RISCVAttributes", UInt32> {
-    let Read = [{ node->getRISCVAttributes() }];
-  }
   def : Property<"functionEffects", Array<FunctionEffect>> {
     let Read = [{ node->getFunctionEffectsWithoutConditions() }];
   }
@@ -375,7 +372,6 @@ let Class = FunctionProtoType in {
     epi.ExtParameterInfos =
       extParameterInfo.empty() ? nullptr : extParameterInfo.data();
     epi.AArch64SMEAttributes = AArch64SMEAttributes;
-    epi.RISCVAttributes = RISCVAttributes;
     epi.FunctionEffects = FunctionEffectsRef::create(functionEffects, functionEffectConds);
     return ctx.getFunctionType(returnType, parameters, epi);
   }]>;
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 283b7834206de2..24fd853a2384af 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -3694,41 +3694,6 @@ def RISCVVLSCC: DeclOrTypeAttr, TargetSpecificAttr<TargetRISCV> {
  let Documentation = [RISCVVLSCCDocs];
 }
 
-def RISCVIn : TypeAttr, TargetSpecificAttr<TargetRISCV> {
-  let Spellings = [RegularKeyword<"__riscv_in">];
-  let Args = [VariadicStringArgument<"InArgs">];
-  let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>;
-  let Documentation = [RISCVInDocs];
-}
-
-def RISCVOut : TypeAttr, TargetSpecificAttr<TargetRISCV> {
-  let Spellings = [RegularKeyword<"__riscv_out">];
-  let Args = [VariadicStringArgument<"OutArgs">];
-  let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>;
-  let Documentation = [RISCVOutDocs];
-}
-
-def RISCVInOut : TypeAttr, TargetSpecificAttr<TargetRISCV> {
-  let Spellings = [RegularKeyword<"__riscv_inout">];
-  let Args = [VariadicStringArgument<"InOutArgs">];
-  let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>;
-  let Documentation = [RISCVInOutDocs];
-}
-
-def RISCVPreserves : TypeAttr, TargetSpecificAttr<TargetRISCV> {
-  let Spellings = [RegularKeyword<"__riscv_preserves">];
-  let Args = [VariadicStringArgument<"PreserveArgs">];
-  let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>;
-  let Documentation = [RISCVPreservesDocs];
-}
-
-def RISCVNew : TypeAttr, TargetSpecificAttr<TargetRISCV> {
-  let Spellings = [RegularKeyword<"__riscv_new">];
-  let Args = [VariadicStringArgument<"NewArgs">];
-  let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>;
-  let Documentation = [RISCVNewDocs];
-}
-
 def Target : InheritableAttr {
   let Spellings = [GCC<"target">];
   let Args = [StringArgument<"featuresStr">];
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index e1374d45754e31..2300c8456ef164 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -6963,73 +6963,6 @@ the ABI. This variant aims to pass fixed-length vectors via vector registers,
 if possible, rather than through general-purpose registers.}];
 }
 
-def RISCVInDocs : Documentation {
-  let Category = DocCatFunction;
-  let Heading = "__riscv_in";
-  let Content = [{
-The ``__riscv_in(S)`` attribute indicates that a function reads from state S.
-This attribute is usually used in RISC-V matrix extensions to specify that the
-function will read from a matrix state passed as arguments.
-This helps compiler checks to prevent common programming errors that could lead
-to undefined behavior, data corruption, or incorrect computation results when
-working with matrix operations.
-  }];
-}
-
-def RISCVOutDocs : Documentation {
-  let Category = DocCatFunction;
-  let Heading = "__riscv_out";
-  let Content = [{
-The ``__riscv_out(S)`` attribute indicates that a function writes to state S.
-This attribute is usually used in RISC-V matrix extensions to specify that the
-function will write to a matrix state passed as arguments.
-This helps compiler checks to prevent common programming errors that could lead
-to undefined behavior, data corruption, or incorrect computation results when
-working with matrix operations.
-  }];
-}
-
-def RISCVInOutDocs : Documentation {
-  let Category = DocCatFunction;
-  let Heading = "__riscv_inout";
-  let Content = [{
-The ``__riscv_inout(S)`` attribute indicates that a function reads from and
-writes to state S.
-This attribute is usually used in RISC-V matrix extensions to specify that the
-function will read from and write to a matrix state passed as arguments.
-This helps compiler checks to prevent common programming errors that could lead
-to undefined behavior, data corruption, or incorrect computation results when
-working with matrix operations.
-  }];
-}
-
-def RISCVPreservesDocs : Documentation {
-  let Category = DocCatFunction;
-  let Heading = "__riscv_preserves";
-  let Content = [{
-The ``__riscv_preserves(S)`` attribute indicates that a function neither reads
-from nor writes to state S.
-This attribute is usually used in RISC-V matrix extensions to specify that the
-function will not read from or write to a matrix state passed as arguments.
-This helps compiler checks to prevent common programming errors that could lead
-to undefined behavior, data corruption, or incorrect computation results when
-working with matrix operations.
-  }];
-}
-
-def RISCVNewDocs : Documentation {
-  let Category = DocCatFunction;
-  let Heading = "__riscv_new";
-  let Content = [{
-The ``__riscv_new(S)`` attribute indicates that a function initiates a new state.
-This attribute is usually used in RISC-V matrix extensions to specify that the
-function will initiate a new matrix state passed as arguments.
-This helps compiler checks to prevent common programming errors that could lead
-to undefined behavior, data corruption, or incorrect computation results when
-working with matrix operations.
-  }];
-}
-
 def PreferredNameDocs : Documentation {
   let Category = DocCatDecl;
   let Content = [{
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index a2fc77812965ad..3e56980e22902b 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -13820,15 +13820,6 @@ def warn_riscv_attribute_interrupt_duplicate_type : Warning<
 def err_riscv_attribute_interrupt_invalid_combination : Error<
   "RISC-V 'interrupt' attribute contains invalid combination of interrupt types">;
 def err_riscv_builtin_invalid_twiden : Error<"RISC-V XSfmm twiden must be 1, 2 or 4">;
-// RISC-V errors
-def err_riscv_call_invalid_features : Error<
-  "call to an attributed function requires %0">;
-def err_missing_riscv_state : Error<"missing state for %0">;
-def err_unknown_riscv_state : Error<"unknown state '%0'">;
-def err_conflicting_attributes_riscv_state : Error<
-  "conflicting attribute. Description: %0">;
-def err_mutually_exclusive_attributes_riscv_state : Error<
-  "mutually exclusive attributes for state '%0'">;
 
 def err_std_source_location_impl_not_found : Error<
   "'std::source_location::__impl' was not found; it must be defined before '__builtin_source_location' is called">;
diff --git a/clang/include/clang/Sema/SemaRISCV.h b/clang/include/clang/Sema/SemaRISCV.h
index a0111f7e25b8c3..49ac1d01b2b977 100644
--- a/clang/include/clang/Sema/SemaRISCV.h
+++ b/clang/include/clang/Sema/SemaRISCV.h
@@ -39,12 +39,6 @@ class SemaRISCV : public SemaBase {
   void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D,
                            const llvm::StringMap<bool> &FeatureMap);
 
-  /// Check for conflicting RISC-V architecture state attributes (e.g. XSfmm
-  /// matrix state) between a caller and callee.
-  void checkConflictingStateAttributes(
-      const FunctionDecl *CallerFD, const FunctionDecl *FD,
-      const FunctionProtoType::ExtProtoInfo &CalleeExtInfo, SourceLocation Loc);
-
   bool isValidRVVBitcast(QualType srcType, QualType destType);
 
   void handleInterruptAttr(Decl *D, const ParsedAttr &AL);
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index f648bbe1f244d9..060dbde16d80a1 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -5216,14 +5216,12 @@ QualType ASTContext::getFunctionTypeInternal(
   size_t Size = FunctionProtoType::totalSizeToAlloc<
       QualType, SourceLocation, FunctionType::FunctionTypeExtraBitfields,
       FunctionType::FunctionTypeExtraAttributeInfo,
-      FunctionType::FunctionTypeArmAttributes,
-      FunctionType::FunctionTypeRISCVAttributes, FunctionType::ExceptionType,
+      FunctionType::FunctionTypeArmAttributes, FunctionType::ExceptionType,
       Expr *, FunctionDecl *, FunctionProtoType::ExtParameterInfo, Qualifiers,
       FunctionEffect, EffectConditionExpr>(
       NumArgs, EPI.Variadic, EPI.requiresFunctionProtoTypeExtraBitfields(),
       EPI.requiresFunctionProtoTypeExtraAttributeInfo(),
-      EPI.requiresFunctionProtoTypeArmAttributes(),
-      EPI.requiresFunctionProtoTypeRISCVAttributes(), ESH.NumExceptionType,
+      EPI.requiresFunctionProtoTypeArmAttributes(), ESH.NumExceptionType,
       ESH.NumExprPtr, ESH.NumFunctionDeclPtr,
       EPI.ExtParameterInfos ? NumArgs : 0,
       EPI.TypeQuals.hasNonFastQualifiers() ? 1 : 0, EPI.FunctionEffects.size(),
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 55cb4c56fb1972..9fc657168abe4a 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -3960,15 +3960,6 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef<QualType> params,
     ExtraBits.HasArmTypeAttributes = true;
   }
 
-  if (epi.requiresFunctionProtoTypeRISCVAttributes()) {
-    auto &RISCVTypeAttrs = *getTrailingObjects<FunctionTypeRISCVAttributes>();
-    RISCVTypeAttrs = FunctionTypeRISCVAttributes();
-
-    // Also set the bit in FunctionTypeExtraBitfields
-    auto &ExtraBits = *getTrailingObjects<FunctionTypeExtraBitfields>();
-    ExtraBits.HasRISCVTypeAttributes = true;
-  }
-
   // Fill in the trailing argument array.
   auto *argSlot = getTrailingObjects<QualType>();
   for (unsigned i = 0; i != getNumParams(); ++i) {
@@ -3985,14 +3976,6 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef<QualType> params,
     ArmTypeAttrs.AArch64SMEAttributes = epi.AArch64SMEAttributes;
   }
 
-  // Propagate the RISC-V state attributes.
-  if (epi.RISCVAttributes != RISCVNormalFunction) {
-    auto &RISCVTypeAttrs = *getTrailingObjects<FunctionTypeRISCVAttributes>();
-    assert(epi.RISCVAttributes <= RISCVAttributeMask &&
-           "Not enough bits to encode RISC-V attributes");
-    RISCVTypeAttrs.RISCVAttributes = epi.RISCVAttributes;
-  }
-
   // Fill in the exception type array if present.
   if (getExceptionSpecType() == EST_Dynamic) {
     auto &ExtraBits = *getTrailingObjects<FunctionTypeExtraBitfields>();
@@ -4243,7 +4226,6 @@ void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result,
   ID.AddInteger((EffectCount << 3) | (HasConds << 2) |
                 (epi.AArch64SMEAttributes << 1) | epi.HasTrailingReturn);
   ID.AddInteger(epi.CFIUncheckedCallee);
-  ID.AddInteger(epi.RISCVAttributes);
 
   for (unsigned Idx = 0; Idx != EffectCount; ++Idx) {
     ID.AddInteger(epi.FunctionEffects.Effects[Idx].toOpaqueInt32());
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp
index 1c9b0d7ce9f914..a90b2d2c0cb94d 100644
--- a/clang/lib/AST/TypePrinter.cpp
+++ b/clang/lib/AST/TypePrinter.cpp
@@ -2063,11 +2063,6 @@ void TypePrinter::printAttributedAfter(const AttributedType *T,
   case attr::ArmOut:
   case attr::ArmInOut:
   case attr::ArmPreserves:
-  case attr::RISCVIn:
-  case attr::RISCVOut:
-  case attr::RISCVInOut:
-  case attr::RISCVPreserves:
-  case attr::RISCVNew:
   case attr::NonBlocking:
   case attr::NonAllocating:
   case attr::Blocking:
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 5a05f8686b70b5..1d7f9f742b87e9 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -2264,27 +2264,6 @@ static void AddAttributesFromFunctionProtoType(ASTContext &Ctx,
     FuncAttrs.addAttribute("aarch64_out_zt0");
   if (FunctionType::getArmZT0State(SMEBits) == FunctionType::ARM_InOut)
     FuncAttrs.addAttribute("aarch64_inout_zt0");
-
-  unsigned RISCVBits = FPT->getRISCVAttributes();
-  switch (FunctionType::getRISCVXsfmmState(RISCVBits)) {
-  case FunctionType::RISCVNone:
-    break;
-  case FunctionType::RISCVIn:
-    FuncAttrs.addAttribute("riscv_in");
-    break;
-  case FunctionType::RISCVOut:
-    FuncAttrs.addAttribute("riscv_out");
-    break;
-  case FunctionType::RISCVInOut:
-    FuncAttrs.addAttribute("riscv_inout");
-    break;
-  case FunctionType::RISCVPreserves:
-    FuncAttrs.addAttribute("riscv_preserves");
-    break;
-  case FunctionType::RISCVNew:
-    FuncAttrs.addAttribute("riscv_ne...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/241096


More information about the cfe-commits mailing list