[llvm] [AArch64] Cache repeated subtarget queries (NFC) (PR #222637)

Cullen Rhodes via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 01:50:35 PDT 2026


================
@@ -436,6 +439,10 @@ AArch64TargetMachine::~AArch64TargetMachine() = default;
 
 const AArch64Subtarget *
 AArch64TargetMachine::getSubtargetImpl(const Function &F) const {
+  AttributeSet FnAttrs = F.getAttributes().getFnAttrs();
+  if (LastSubtarget && LastSubtargetAttrs == FnAttrs)
+    return LastSubtarget;
----------------
c-rhodes wrote:

no worries, I've added a comment and updated the commit message, hope it's clearer now

https://github.com/llvm/llvm-project/pull/222637


More information about the llvm-commits mailing list