[llvm] [ARM] r11 is reserved when using -mframe-chain=aapcs (PR #86951)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 13:56:29 PDT 2024


efriedma-quic wrote:

Since the frame-chain options originally come from armclang, we can look at their documentation to see the expected semantics: https://developer.arm.com/documentation/101754/0622/armclang-Reference/armclang-Command-line-Options/-mframe-chain . The frontend flag semantics are... not really what I would have chosen, but seem good enough that it's not worth diverging.  It would be nice to make sure -momit-leaf-frame-pointer interacts reasonably with -mframe-chain, though.

Regardless of what the frontend flags look like, though, I think we want the internal representation to match what I mentioned before: change the definition of the "frame-pointer" function attribute in LLVM IR to add the value "reserved", and query that to check whether the frame pointer register should be reserved.  The value fits cleanly into the existing hierarchy, has an obvious cross-platform meaning, and allows us to narrow the target-specific attribute to only specify whether r11 is the frame pointer register in Thumb mode.

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


More information about the llvm-commits mailing list