summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/CodeGen/CommandFlags.inc
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/CodeGen/CommandFlags.inc')
-rw-r--r--llvm/include/llvm/CodeGen/CommandFlags.inc25
1 files changed, 18 insertions, 7 deletions
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.inc b/llvm/include/llvm/CodeGen/CommandFlags.inc
index 6535e068b6e..568d329a5e8 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.inc
+++ b/llvm/include/llvm/CodeGen/CommandFlags.inc
@@ -114,10 +114,16 @@ static cl::opt<TargetMachine::CodeGenFileType> FileType(
clEnumValN(TargetMachine::CGFT_Null, "null",
"Emit nothing, for performance testing")));
-static cl::opt<bool>
- DisableFPElim("disable-fp-elim",
- cl::desc("Disable frame pointer elimination optimization"),
- cl::init(false));
+static cl::opt<llvm::FramePointer::FP> FramePointerUsage(
+ "frame-pointer", cl::desc("Specify frame pointer elimination optimization"),
+ cl::init(llvm::FramePointer::None),
+ cl::values(
+ clEnumValN(llvm::FramePointer::All, "all",
+ "Disable frame pointer elimination"),
+ clEnumValN(llvm::FramePointer::NonLeaf, "non-leaf",
+ "Disable frame pointer elimination for non-leaf frame"),
+ clEnumValN(llvm::FramePointer::None, "none",
+ "Enable frame pointer elimination")));
static cl::opt<bool> EnableUnsafeFPMath(
"enable-unsafe-fp-math",
@@ -368,9 +374,14 @@ setFunctionAttributes(StringRef CPU, StringRef Features, Module &M) {
NewAttrs.addAttribute("target-cpu", CPU);
if (!Features.empty())
NewAttrs.addAttribute("target-features", Features);
- if (DisableFPElim.getNumOccurrences() > 0)
- NewAttrs.addAttribute("no-frame-pointer-elim",
- DisableFPElim ? "true" : "false");
+ if (FramePointerUsage.getNumOccurrences() > 0) {
+ if (FramePointerUsage == llvm::FramePointer::All)
+ NewAttrs.addAttribute("frame-pointer", "all");
+ else if (FramePointerUsage == llvm::FramePointer::NonLeaf)
+ NewAttrs.addAttribute("frame-pointer", "non-leaf");
+ else if (FramePointerUsage == llvm::FramePointer::None)
+ NewAttrs.addAttribute("frame-pointer", "none");
+ }
if (DisableTailCalls.getNumOccurrences() > 0)
NewAttrs.addAttribute("disable-tail-calls",
toStringRef(DisableTailCalls));
OpenPOWER on IntegriCloud