[PATCH] D127209: [SVE][AArch64] Refine hasSVEArgsOrReturn

Matt Devereau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 05:51:33 PDT 2022


MattDevereau added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h:199
+    return HasSVEArgs ||
+           isa<ScalableVectorType>(MF.getFunction().getReturnType());
+  };
----------------
efriedma wrote:
> Hmm... actually, looking at this again, I'm a little concerned about checking the IR return type directly, instead of using AnalyzeReturn.  I'm not sure if this actually comes up in practice, but calling convention lowering does various transforms on the return type.  Maybe if you write something silly like "<vscale x 1000 x double>".
> 
> Maybe we can add a bit of code to LowerFormalArguments to also check the return type?
Modifying test `@sve_caller_sve_callee()` in `sve-tailcall.ll` to use return type `<vscale x 1000 x double>` caused the output "LLVM ERROR: Invalid size request on a scalable vector.".

In similar fashion to the changes in LowerFormalArguments, I checked the types of the return values in `AArch64TargetLowering::LowerReturn` instead of checking the IR return type directly. This ends up passing on the rest of the tests except `sve_caller_sve_callee` and `sve_caller_sve_callee_fastcc`, where the return type is not eligible for tail optimization and the frame-pointer is incorrectly unpreserved. Is directly checking the IR return type in `AArch64TargetLowering::LowerReturn` after `AnalyzeReturn` still not sufficient?






Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127209/new/

https://reviews.llvm.org/D127209



More information about the llvm-commits mailing list