2012-04-14 09:54:10 -04:00
|
|
|
//===-- TargetOptionsImpl.cpp - Options that apply to all targets ----------==//
|
|
|
|
|
//
|
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
|
//
|
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
|
|
|
|
// This file implements the methods in the TargetOptions.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
2014-11-24 04:08:18 -05:00
|
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
2017-12-18 15:10:56 -05:00
|
|
|
#include "llvm/CodeGen/TargetFrameLowering.h"
|
|
|
|
|
#include "llvm/CodeGen/TargetSubtargetInfo.h"
|
2017-06-10 09:44:06 -04:00
|
|
|
#include "llvm/IR/Function.h"
|
|
|
|
|
#include "llvm/IR/Module.h"
|
2012-04-14 09:54:10 -04:00
|
|
|
#include "llvm/Target/TargetOptions.h"
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
|
|
/// DisableFramePointerElim - This returns true if frame pointer elimination
|
|
|
|
|
/// optimization should be disabled for the given machine function.
|
|
|
|
|
bool TargetOptions::DisableFramePointerElim(const MachineFunction &MF) const {
|
2015-05-27 14:44:32 -04:00
|
|
|
// Check to see if we should eliminate all frame pointers.
|
|
|
|
|
if (MF.getSubtarget().getFrameLowering()->noFramePointerElim(MF))
|
|
|
|
|
return true;
|
2012-04-14 09:54:10 -04:00
|
|
|
|
2015-05-27 14:44:32 -04:00
|
|
|
// Check to see if we should eliminate non-leaf frame pointers.
|
2017-12-18 15:10:56 -05:00
|
|
|
if (MF.getFunction().hasFnAttribute("no-frame-pointer-elim-non-leaf"))
|
2017-01-02 14:17:04 -05:00
|
|
|
return MF.getFrameInfo().hasCalls();
|
2015-05-27 14:44:32 -04:00
|
|
|
|
|
|
|
|
return false;
|
2012-04-14 09:54:10 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// HonorSignDependentRoundingFPMath - Return true if the codegen must assume
|
|
|
|
|
/// that the rounding mode of the FPU can change from its default.
|
|
|
|
|
bool TargetOptions::HonorSignDependentRoundingFPMath() const {
|
|
|
|
|
return !UnsafeFPMath && HonorSignDependentRoundingFPMathOption;
|
|
|
|
|
}
|