File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
llvm/lib/Target/AArch64/Utils Expand file tree Collapse file tree 2 files changed +10
-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 @@ -16,6 +16,7 @@ namespace llvm {
16
16
class Function ;
17
17
class CallBase ;
18
18
class AttributeList ;
19
+ class SMECallAttrs ;
19
20
20
21
// / SMEAttrs is a utility class to parse the SME ACLE attributes on functions.
21
22
// / It helps determine a function's requirements for PSTATE.ZA and PSTATE.SM.
@@ -50,12 +51,7 @@ class SMEAttrs {
50
51
51
52
SMEAttrs () = default ;
52
53
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) {}
54
+ SMEAttrs (const Function &F) : SMEAttrs(F.getAttributes()) {}
59
55
SMEAttrs (const AttributeList &L);
60
56
SMEAttrs (StringRef FuncName) { addKnownFunctionAttrs (FuncName); };
61
57
@@ -144,6 +140,8 @@ class SMEAttrs {
144
140
return Bitmask == Other.Bitmask ;
145
141
}
146
142
143
+ friend SMECallAttrs;
144
+
147
145
private:
148
146
void addKnownFunctionAttrs (StringRef FuncName);
149
147
};
You can’t perform that action at this time.
0 commit comments