File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
llvm/lib/Target/AArch64/Utils Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,13 @@ bool SMECallAttrs::requiresSMChange() const {
111
111
}
112
112
113
113
SMECallAttrs::SMECallAttrs (const CallBase &CB)
114
- : CallerFn(*CB.getFunction()), CalledFn(CB.getCalledFunction() ),
114
+ : CallerFn(*CB.getFunction()), CalledFn(SMEAttrs::Normal ),
115
115
Callsite(CB.getAttributes()), IsIndirect(CB.isIndirectCall()) {
116
+ if (auto *CalledFunction = CB.getCalledFunction ()) {
117
+ CalledFn = SMEAttrs (*CalledFunction);
118
+ CalledFn.addKnownFunctionAttrs (CalledFunction->getName ());
119
+ }
120
+
116
121
// FIXME: We probably should not allow SME attributes on direct calls but
117
122
// clang duplicates streaming mode attributes at each callsite.
118
123
assert ((IsIndirect ||
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ class Function;
17
17
class CallBase ;
18
18
class AttributeList ;
19
19
20
+ class SMECallAttrs ;
21
+
20
22
// / SMEAttrs is a utility class to parse the SME ACLE attributes on functions.
21
23
// / It helps determine a function's requirements for PSTATE.ZA and PSTATE.SM.
22
24
class SMEAttrs {
@@ -50,12 +52,7 @@ class SMEAttrs {
50
52
51
53
SMEAttrs () = default ;
52
54
SMEAttrs (unsigned Mask) { set (Mask); }
53
- SMEAttrs (const Function *F)
54
- : SMEAttrs(F ? F->getAttributes () : AttributeList()) {
55
- if (F)
56
- addKnownFunctionAttrs (F->getName ());
57
- }
58
- SMEAttrs (const Function &F) : SMEAttrs(&F) {}
55
+ SMEAttrs (const Function &F) : SMEAttrs(F.getAttributes()) {}
59
56
SMEAttrs (const AttributeList &L);
60
57
SMEAttrs (StringRef FuncName) { addKnownFunctionAttrs (FuncName); };
61
58
@@ -144,6 +141,8 @@ class SMEAttrs {
144
141
return Bitmask == Other.Bitmask ;
145
142
}
146
143
144
+ friend SMECallAttrs;
145
+
147
146
private:
148
147
void addKnownFunctionAttrs (StringRef FuncName);
149
148
};
You can’t perform that action at this time.
0 commit comments