aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorOliver Stannard <oliver.stannard@arm.com>2024-06-07 10:58:10 +0100
committerGitHub <noreply@github.com>2024-06-07 10:58:10 +0100
commit1a5239251ead73ee57f4e2f7fc93433ac7cf18b1 (patch)
treea2c31e3c7dce81d19f390f97e9d9754b5dbeda81 /llvm/lib/IR/Function.cpp
parentb87a80d4ebca9e1c065f0d2762e500078c4badca (diff)
downloadllvm-1a5239251ead73ee57f4e2f7fc93433ac7cf18b1.zip
llvm-1a5239251ead73ee57f4e2f7fc93433ac7cf18b1.tar.gz
llvm-1a5239251ead73ee57f4e2f7fc93433ac7cf18b1.tar.bz2
[ARM] r11 is reserved when using -mframe-chain=aapcs (#86951)
When using the -mframe-chain=aapcs or -mframe-chain=aapcs-leaf options, we cannot use r11 as an allocatable register, even if -fomit-frame-pointer is also used. This is so that r11 will always point to a valid frame record, even if we don't create one in every function.
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 13fa1af..3f73502 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -383,6 +383,9 @@ Function *Function::createWithDefaultAttr(FunctionType *Ty,
case FramePointerKind::None:
// 0 ("none") is the default.
break;
+ case FramePointerKind::Reserved:
+ B.addAttribute("frame-pointer", "reserved");
+ break;
case FramePointerKind::NonLeaf:
B.addAttribute("frame-pointer", "non-leaf");
break;