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 14
14
15
15
using namespace llvm ;
16
16
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 {
23
18
// Streaming Mode Attrs
24
19
assert (!(hasStreamingInterface () && hasStreamingCompatibleInterface ()) &&
25
20
" SM_Enabled and SM_Compatible are mutually exclusive" );
@@ -81,6 +76,10 @@ SMEAttrs::SMEAttrs(const AttributeList &Attrs) {
81
76
82
77
void SMEAttrs::addKnownFunctionAttrs (StringRef FuncName,
83
78
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
+
84
83
struct SMERoutineAttr {
85
84
RTLIB::Libcall LC{RTLIB::UNKNOWN_LIBCALL};
86
85
unsigned Attrs{SMEAttrs::Normal};
Original file line number Diff line number Diff line change @@ -62,7 +62,15 @@ class SMEAttrs {
62
62
addKnownFunctionAttrs (FuncName, TLI);
63
63
};
64
64
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
+ }
66
74
67
75
// Interfaces to query PSTATE.SM
68
76
bool hasStreamingBody () const { return Bitmask & SM_Body; }
@@ -149,6 +157,7 @@ class SMEAttrs {
149
157
150
158
private:
151
159
void addKnownFunctionAttrs (StringRef FuncName, const TargetLowering &TLI);
160
+ void validate () const ;
152
161
};
153
162
154
163
// / 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