[llvm] [AArch64] Don't inline streaming Fn if caller has no SVE (PR #150595)

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 03:11:45 PDT 2025


================
@@ -280,16 +280,22 @@ bool AArch64TTIImpl::areInlineCompatible(const Function *Caller,
   if (CallAttrs.callee().isNewZA() || CallAttrs.callee().isNewZT0())
     return false;
 
+  const TargetMachine &TM = getTLI()->getTargetMachine();
+  const FeatureBitset &CallerBits =
+      TM.getSubtargetImpl(*Caller)->getFeatureBits();
+
+  // Cannot inline a streaming function into a non-streaming function,
+  // if the caller has no SVE.
+  if (CallAttrs.requiresSMChange() && !CallerBits.test(AArch64::FeatureSVE))
----------------
gbossu wrote:

I'm wondering if there's other features we should test for? (Maybe not now, but I don't know what the future holds). Is there maybe a more generic way to check that the features of the callee are supported by the caller?

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


More information about the llvm-commits mailing list