[llvm-dev] Thumb frame pointer register
Tim Northover via llvm-dev
llvm-dev at lists.llvm.org
Wed Aug 21 01:56:10 PDT 2019
Hi Son Tuan,
On Wed, 21 Aug 2019 at 06:05, Son Tuan VU via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I noticed that for ARM Thumb target, llc uses r7 as frame pointer (gcc does not do this AFAIK), and this register should therefore not be used as a general-purpose register.
This is generally considered an ABI matter. On EABI and GNUEABI
platforms, I believe both GCC and Clang use r7 in Thumb mode, but r11
in ARM mode. This isn't configurable.
So I'd suggest making sure llc is producing ARM code for that
particular file: for example by using -mtriple=armv7-linux-gnueabihf
rather than -mtriple=thumbv7-linux-gnueabihf.
More information about the llvm-dev