[llvm] [llvm] Consistently respect `naked` fn attribute in `TargetFrameLowering::hasFP()` (PR #106014)
Alex Rønne Petersen via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 29 11:41:12 PDT 2024
================
@@ -0,0 +1,11 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc < %s -mtriple aarch64 | FileCheck %s -check-prefixes=NAKED
+
+define dso_local void @_start() naked "frame-pointer"="all" {
+; NAKED-LABEL: _start:
+; NAKED: // %bb.0:
+; NAKED-NEXT: mov w8, #42 // =0x2a
+; NAKED-NEXT: blr x8
+ call void inttoptr (i32 42 to ptr)()
----------------
alexrp wrote:
The LLVM language reference doesn't disallow it; it only makes mention of not emitting a prologue/epilogue.
I do strongly agree that it's a bad idea to put non-`asm` code in a naked function *in general*, but in this case, it was the only thing I could think of to write that works across all the targets we're testing here. At least ARC and SPIR-V don't like inline `asm`, for example.
https://github.com/llvm/llvm-project/pull/106014
More information about the llvm-commits
mailing list