Add option to disable leaf frame pointer elimination

This commit is contained in:
Arnold Schwaighofer
2020-05-21 07:52:00 -07:00
parent e155f03e0d
commit 109813ffe5
6 changed files with 27 additions and 1 deletions

View File

@@ -988,7 +988,8 @@ bool swift::irgen::shouldRemoveTargetFeature(StringRef feature) {
void IRGenModule::setHasFramePointer(llvm::AttrBuilder &Attrs,
bool HasFramePointer) {
Attrs.addAttribute("frame-pointer", HasFramePointer ? "non-leaf" : "none");
auto UseFramePointer = IRGen.Opts.DisableFPElimLeaf ? "all" : "non-leaf";
Attrs.addAttribute("frame-pointer", HasFramePointer ? UseFramePointer : "none");
}
void IRGenModule::setHasFramePointer(llvm::Function *F,