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 {
111111}
112112
113113SMECallAttrs::SMECallAttrs (const CallBase &CB)
114- : CallerFn(*CB.getFunction()), CalledFn(CB.getCalledFunction() ),
114+ : CallerFn(*CB.getFunction()), CalledFn(SMEAttrs::Normal ),
115115 Callsite(CB.getAttributes()), IsIndirect(CB.isIndirectCall()) {
116+ if (auto *CalledFunction = CB.getCalledFunction ()) {
117+ CalledFn = SMEAttrs (*CalledFunction);
118+ CalledFn.addKnownFunctionAttrs (CalledFunction->getName ());
119+ }
120+
116121 // FIXME: We probably should not allow SME attributes on direct calls but
117122 // clang duplicates streaming mode attributes at each callsite.
118123 assert ((IsIndirect ||
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ namespace llvm {
1616class Function ;
1717class CallBase ;
1818class AttributeList ;
19+ class SMECallAttrs ;
1920
2021// / SMEAttrs is a utility class to parse the SME ACLE attributes on functions.
2122// / It helps determine a function's requirements for PSTATE.ZA and PSTATE.SM.
@@ -50,12 +51,7 @@ class SMEAttrs {
5051
5152 SMEAttrs () = default ;
5253 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()) {}
5955 SMEAttrs (const AttributeList &L);
6056 SMEAttrs (StringRef FuncName) { addKnownFunctionAttrs (FuncName); };
6157
@@ -144,6 +140,8 @@ class SMEAttrs {
144140 return Bitmask == Other.Bitmask ;
145141 }
146142
143+ friend SMECallAttrs;
144+
147145private:
148146 void addKnownFunctionAttrs (StringRef FuncName);
149147};
You can’t perform that action at this time.
0 commit comments