File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
llvm/lib/Target/AArch64/Utils Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 1414
1515using namespace llvm ;
1616
17- void SMEAttrs::set (unsigned M, bool Enable) {
18- if (Enable)
19- Bitmask |= M;
20- else
21- Bitmask &= ~M;
22-
17+ void SMEAttrs::validate () const {
2318 // Streaming Mode Attrs
2419 assert (!(hasStreamingInterface () && hasStreamingCompatibleInterface ()) &&
2520 " SM_Enabled and SM_Compatible are mutually exclusive" );
@@ -81,6 +76,10 @@ SMEAttrs::SMEAttrs(const AttributeList &Attrs) {
8176
8277void SMEAttrs::addKnownFunctionAttrs (StringRef FuncName,
8378 const TargetLowering &TLI) {
79+ // If the function name does not start with a _ or #_ is not a builtin.
80+ if (!FuncName.starts_with (' _' ) && !FuncName.starts_with (" #_" ))
81+ return ;
82+
8483 struct SMERoutineAttr {
8584 RTLIB::Libcall LC{RTLIB::UNKNOWN_LIBCALL};
8685 unsigned Attrs{SMEAttrs::Normal};
Original file line number Diff line number Diff line change @@ -62,7 +62,15 @@ class SMEAttrs {
6262 addKnownFunctionAttrs (FuncName, TLI);
6363 };
6464
65- void set (unsigned M, bool Enable = true );
65+ void set (unsigned M, bool Enable = true ) {
66+ if (Enable)
67+ Bitmask |= M;
68+ else
69+ Bitmask &= ~M;
70+ #ifndef NDEBUG
71+ validate ();
72+ #endif
73+ }
6674
6775 // Interfaces to query PSTATE.SM
6876 bool hasStreamingBody () const { return Bitmask & SM_Body; }
@@ -149,6 +157,7 @@ class SMEAttrs {
149157
150158private:
151159 void addKnownFunctionAttrs (StringRef FuncName, const TargetLowering &TLI);
160+ void validate () const ;
152161};
153162
154163// / SMECallAttrs is a utility class to hold the SMEAttrs for a callsite. It has
You can’t perform that action at this time.
0 commit comments