LLVM 19.0.0git
TargetOptionsImpl.cpp
Go to the documentation of this file.
1//===-- TargetOptionsImpl.cpp - Options that apply to all targets ----------==//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the methods in the TargetOptions.
10//
11//===----------------------------------------------------------------------===//
12
17#include "llvm/IR/Function.h"
19using namespace llvm;
20
21/// DisableFramePointerElim - This returns true if frame pointer elimination
22/// optimization should be disabled for the given machine function.
24 // Check to see if the target want to forcably keep frame pointer.
26 return true;
27
28 const Function &F = MF.getFunction();
29
30 if (!F.hasFnAttribute("frame-pointer"))
31 return false;
32 StringRef FP = F.getFnAttribute("frame-pointer").getValueAsString();
33 if (FP == "all")
34 return true;
35 if (FP == "non-leaf")
36 return MF.getFrameInfo().hasCalls();
37 if (FP == "none")
38 return false;
39 llvm_unreachable("unknown frame pointer flag");
40}
41
42/// HonorSignDependentRoundingFPMath - Return true if the codegen must assume
43/// that the rounding mode of the FPU can change from its default.
46}
47
48/// NOTE: There are targets that still do not support the debug entry values
49/// production and that is being controlled with the SupportsDebugEntryValues.
50/// In addition, SCE debugger does not have the feature implemented, so prefer
51/// not to emit the debug entry values in that case.
52/// The EnableDebugEntryValues can be used for the testing purposes.
56}
#define F(x, y, z)
Definition: MD5.cpp:55
bool hasCalls() const
Return true if the current function has any function calls.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Function & getFunction()
Return the LLVM function that this machine code represents.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
virtual bool keepFramePointer(const MachineFunction &MF) const
Return true if the target wants to keep the frame pointer regardless of the function attribute "frame...
unsigned UnsafeFPMath
UnsafeFPMath - This flag is enabled when the -enable-unsafe-fp-math flag is specified on the command ...
bool HonorSignDependentRoundingFPMath() const
HonorSignDependentRoundingFPMath - Return true if the codegen must assume that the rounding mode of t...
unsigned SupportsDebugEntryValues
Set if the target supports the debug entry values by default.
unsigned HonorSignDependentRoundingFPMathOption
HonorSignDependentRoundingFPMath - This returns true when the -enable-sign-dependent-rounding-fp-math...
DebuggerKind DebuggerTuning
Which debugger to tune for.
bool DisableFramePointerElim(const MachineFunction &MF) const
DisableFramePointerElim - This returns true if frame pointer elimination optimization should be disab...
unsigned EnableDebugEntryValues
When set to true, the EnableDebugEntryValues option forces production of debug entry values even if t...
bool ShouldEmitDebugEntryValues() const
NOTE: There are targets that still do not support the debug entry values production.
virtual const TargetFrameLowering * getFrameLowering() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ SCE
Tune debug info for SCE targets (e.g. PS4).