Chris Lattner | b26bcc5 | 2001-09-14 05:34:53 +0000 | [diff] [blame] | 1 | //===-- TargetMachine.cpp - General Target Information ---------------------==// |
Misha Brukman | f976c85 | 2005-04-21 22:55:34 +0000 | [diff] [blame] | 2 | // |
John Criswell | b576c94 | 2003-10-20 19:43:21 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Misha Brukman | f976c85 | 2005-04-21 22:55:34 +0000 | [diff] [blame] | 7 | // |
John Criswell | b576c94 | 2003-10-20 19:43:21 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | b26bcc5 | 2001-09-14 05:34:53 +0000 | [diff] [blame] | 9 | // |
| 10 | // This file describes the general parts of a Target machine. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
Vikram S. Adve | daae699 | 2001-07-21 12:42:08 +0000 | [diff] [blame] | 13 | |
Evan Cheng | e566763 | 2010-04-21 03:18:23 +0000 | [diff] [blame] | 14 | #include "llvm/CodeGen/MachineFunction.h" |
| 15 | #include "llvm/CodeGen/MachineFrameInfo.h" |
Chris Lattner | af76e59 | 2009-08-22 20:48:53 +0000 | [diff] [blame] | 16 | #include "llvm/MC/MCAsmInfo.h" |
Misha Brukman | e67d5fb | 2004-06-21 21:20:23 +0000 | [diff] [blame] | 17 | #include "llvm/Target/TargetMachine.h" |
Evan Cheng | 4c1aa86 | 2006-02-22 20:19:42 +0000 | [diff] [blame] | 18 | #include "llvm/Target/TargetOptions.h" |
Reid Spencer | 551ccae | 2004-09-01 22:55:40 +0000 | [diff] [blame] | 19 | #include "llvm/Support/CommandLine.h" |
Chris Lattner | f70e0c2 | 2003-12-28 21:23:38 +0000 | [diff] [blame] | 20 | using namespace llvm; |
Brian Gaeke | d0fde30 | 2003-11-11 22:41:34 +0000 | [diff] [blame] | 21 | |
Vikram S. Adve | e1f7280 | 2002-09-16 15:39:26 +0000 | [diff] [blame] | 22 | //--------------------------------------------------------------------------- |
Brian Gaeke | 323819e | 2004-03-04 19:16:23 +0000 | [diff] [blame] | 23 | // Command-line options that tend to be useful on more than one back-end. |
| 24 | // |
| 25 | |
Misha Brukman | f90e402 | 2004-06-21 21:44:12 +0000 | [diff] [blame] | 26 | namespace llvm { |
Mon P Wang | bc65ca8 | 2009-03-20 05:06:58 +0000 | [diff] [blame] | 27 | bool LessPreciseFPMADOption; |
Misha Brukman | f90e402 | 2004-06-21 21:44:12 +0000 | [diff] [blame] | 28 | bool PrintMachineCode; |
| 29 | bool NoFramePointerElim; |
Evan Cheng | e566763 | 2010-04-21 03:18:23 +0000 | [diff] [blame] | 30 | bool NoFramePointerElimNonLeaf; |
Chris Lattner | 45554a6 | 2005-01-15 06:00:32 +0000 | [diff] [blame] | 31 | bool NoExcessFPPrecision; |
Chris Lattner | 34f74a6 | 2005-04-30 04:09:52 +0000 | [diff] [blame] | 32 | bool UnsafeFPMath; |
Evan Cheng | 60108e9 | 2010-07-15 22:07:12 +0000 | [diff] [blame] | 33 | bool NoInfsFPMath; |
| 34 | bool NoNaNsFPMath; |
Chris Lattner | a7ad3d1 | 2007-05-03 00:27:11 +0000 | [diff] [blame] | 35 | bool HonorSignDependentRoundingFPMathOption; |
Evan Cheng | c9ab2f3 | 2006-12-09 02:41:30 +0000 | [diff] [blame] | 36 | bool UseSoftFloat; |
Anton Korobeynikov | 0eebf65 | 2009-06-08 22:53:56 +0000 | [diff] [blame] | 37 | FloatABI::ABIType FloatABIType; |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 38 | bool NoImplicitFloat; |
Anton Korobeynikov | 5032e5a | 2007-01-17 10:33:08 +0000 | [diff] [blame] | 39 | bool NoZerosInBSS; |
Duncan Sands | 57b6e9e | 2010-05-02 15:36:26 +0000 | [diff] [blame] | 40 | bool JITExceptionHandling; |
Reid Kleckner | 2763217 | 2009-09-20 23:52:43 +0000 | [diff] [blame] | 41 | bool JITEmitDebugInfo; |
| 42 | bool JITEmitDebugInfoToDisk; |
Dan Gohman | 1797ed5 | 2010-02-08 20:27:50 +0000 | [diff] [blame] | 43 | bool GuaranteedTailCallOpt; |
Evan Cheng | f05589d | 2011-06-23 18:15:47 +0000 | [diff] [blame] | 44 | unsigned StackAlignmentOverride; |
Evan Cheng | 6547e40 | 2008-07-01 23:18:29 +0000 | [diff] [blame] | 45 | bool RealignStack; |
Dale Johannesen | 7232464 | 2008-07-31 18:13:12 +0000 | [diff] [blame] | 46 | bool DisableJumpTables; |
Owen Anderson | 95dad83 | 2008-10-07 20:22:28 +0000 | [diff] [blame] | 47 | bool StrongPHIElim; |
Evan Cheng | 2c69f8e | 2011-04-07 00:58:44 +0000 | [diff] [blame] | 48 | bool HasDivModLibcall; |
Evan Cheng | 42bf74b | 2009-03-25 01:47:28 +0000 | [diff] [blame] | 49 | bool AsmVerbosityDefault(false); |
Chris Lattner | d74ea2b | 2006-05-24 17:04:05 +0000 | [diff] [blame] | 50 | } |
Misha Brukman | 0fb5a66 | 2004-06-21 21:08:45 +0000 | [diff] [blame] | 51 | |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 52 | static cl::opt<bool, true> |
| 53 | PrintCode("print-machineinstrs", |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 54 | cl::desc("Print generated machine code"), |
| 55 | cl::location(PrintMachineCode), cl::init(false)); |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 56 | static cl::opt<bool, true> |
Evan Cheng | 89df08c | 2008-05-30 22:39:18 +0000 | [diff] [blame] | 57 | DisableFPElim("disable-fp-elim", |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 58 | cl::desc("Disable frame pointer elimination optimization"), |
| 59 | cl::location(NoFramePointerElim), |
| 60 | cl::init(false)); |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 61 | static cl::opt<bool, true> |
Evan Cheng | e566763 | 2010-04-21 03:18:23 +0000 | [diff] [blame] | 62 | DisableFPElimNonLeaf("disable-non-leaf-fp-elim", |
| 63 | cl::desc("Disable frame pointer elimination optimization for non-leaf funcs"), |
| 64 | cl::location(NoFramePointerElimNonLeaf), |
| 65 | cl::init(false)); |
| 66 | static cl::opt<bool, true> |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 67 | DisableExcessPrecision("disable-excess-fp-precision", |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 68 | cl::desc("Disable optimizations that may increase FP precision"), |
| 69 | cl::location(NoExcessFPPrecision), |
| 70 | cl::init(false)); |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 71 | static cl::opt<bool, true> |
Mon P Wang | bc65ca8 | 2009-03-20 05:06:58 +0000 | [diff] [blame] | 72 | EnableFPMAD("enable-fp-mad", |
| 73 | cl::desc("Enable less precise MAD instructions to be generated"), |
| 74 | cl::location(LessPreciseFPMADOption), |
| 75 | cl::init(false)); |
| 76 | static cl::opt<bool, true> |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 77 | EnableUnsafeFPMath("enable-unsafe-fp-math", |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 78 | cl::desc("Enable optimizations that may decrease FP precision"), |
| 79 | cl::location(UnsafeFPMath), |
| 80 | cl::init(false)); |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 81 | static cl::opt<bool, true> |
Evan Cheng | 60108e9 | 2010-07-15 22:07:12 +0000 | [diff] [blame] | 82 | EnableNoInfsFPMath("enable-no-infs-fp-math", |
| 83 | cl::desc("Enable FP math optimizations that assume no +-Infs"), |
| 84 | cl::location(NoInfsFPMath), |
| 85 | cl::init(false)); |
| 86 | static cl::opt<bool, true> |
| 87 | EnableNoNaNsFPMath("enable-no-nans-fp-math", |
| 88 | cl::desc("Enable FP math optimizations that assume no NaNs"), |
| 89 | cl::location(NoNaNsFPMath), |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 90 | cl::init(false)); |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 91 | static cl::opt<bool, true> |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 92 | EnableHonorSignDependentRoundingFPMath("enable-sign-dependent-rounding-fp-math", |
| 93 | cl::Hidden, |
| 94 | cl::desc("Force codegen to assume rounding mode can change dynamically"), |
| 95 | cl::location(HonorSignDependentRoundingFPMathOption), |
| 96 | cl::init(false)); |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 97 | static cl::opt<bool, true> |
| 98 | GenerateSoftFloatCalls("soft-float", |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 99 | cl::desc("Generate software floating point library calls"), |
| 100 | cl::location(UseSoftFloat), |
| 101 | cl::init(false)); |
Anton Korobeynikov | 0eebf65 | 2009-06-08 22:53:56 +0000 | [diff] [blame] | 102 | static cl::opt<llvm::FloatABI::ABIType, true> |
| 103 | FloatABIForCalls("float-abi", |
| 104 | cl::desc("Choose float ABI type"), |
| 105 | cl::location(FloatABIType), |
| 106 | cl::init(FloatABI::Default), |
| 107 | cl::values( |
| 108 | clEnumValN(FloatABI::Default, "default", |
| 109 | "Target default float ABI type"), |
| 110 | clEnumValN(FloatABI::Soft, "soft", |
| 111 | "Soft float ABI (implied by -soft-float)"), |
| 112 | clEnumValN(FloatABI::Hard, "hard", |
| 113 | "Hard float ABI (uses FP registers)"), |
| 114 | clEnumValEnd)); |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 115 | static cl::opt<bool, true> |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 116 | DontPlaceZerosInBSS("nozero-initialized-in-bss", |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 117 | cl::desc("Don't place zero-initialized symbols into bss section"), |
| 118 | cl::location(NoZerosInBSS), |
| 119 | cl::init(false)); |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 120 | static cl::opt<bool, true> |
Duncan Sands | 57b6e9e | 2010-05-02 15:36:26 +0000 | [diff] [blame] | 121 | EnableJITExceptionHandling("jit-enable-eh", |
| 122 | cl::desc("Emit exception handling information"), |
| 123 | cl::location(JITExceptionHandling), |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 124 | cl::init(false)); |
Reid Kleckner | 2763217 | 2009-09-20 23:52:43 +0000 | [diff] [blame] | 125 | // In debug builds, make this default to true. |
| 126 | #ifdef NDEBUG |
| 127 | #define EMIT_DEBUG false |
| 128 | #else |
| 129 | #define EMIT_DEBUG true |
| 130 | #endif |
| 131 | static cl::opt<bool, true> |
| 132 | EmitJitDebugInfo("jit-emit-debug", |
| 133 | cl::desc("Emit debug information to debugger"), |
| 134 | cl::location(JITEmitDebugInfo), |
| 135 | cl::init(EMIT_DEBUG)); |
| 136 | #undef EMIT_DEBUG |
| 137 | static cl::opt<bool, true> |
| 138 | EmitJitDebugInfoToDisk("jit-emit-debug-to-disk", |
| 139 | cl::Hidden, |
| 140 | cl::desc("Emit debug info objfiles to disk"), |
| 141 | cl::location(JITEmitDebugInfoToDisk), |
| 142 | cl::init(false)); |
Arnold Schwaighofer | c85e171 | 2007-10-11 19:40:01 +0000 | [diff] [blame] | 143 | |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 144 | static cl::opt<bool, true> |
Dan Gohman | 1797ed5 | 2010-02-08 20:27:50 +0000 | [diff] [blame] | 145 | EnableGuaranteedTailCallOpt("tailcallopt", |
Evan Cheng | 8c86db5 | 2010-01-27 00:10:09 +0000 | [diff] [blame] | 146 | cl::desc("Turn fastcc calls into tail calls by (potentially) changing ABI."), |
Dan Gohman | 1797ed5 | 2010-02-08 20:27:50 +0000 | [diff] [blame] | 147 | cl::location(GuaranteedTailCallOpt), |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 148 | cl::init(false)); |
Evan Cheng | 6547e40 | 2008-07-01 23:18:29 +0000 | [diff] [blame] | 149 | static cl::opt<unsigned, true> |
| 150 | OverrideStackAlignment("stack-alignment", |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 151 | cl::desc("Override default stack alignment"), |
Evan Cheng | f05589d | 2011-06-23 18:15:47 +0000 | [diff] [blame] | 152 | cl::location(StackAlignmentOverride), |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 153 | cl::init(0)); |
Dan Gohman | 844731a | 2008-05-13 00:00:25 +0000 | [diff] [blame] | 154 | static cl::opt<bool, true> |
| 155 | EnableRealignStack("realign-stack", |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 156 | cl::desc("Realign stack if needed"), |
| 157 | cl::location(RealignStack), |
| 158 | cl::init(true)); |
Evan Cheng | 6547e40 | 2008-07-01 23:18:29 +0000 | [diff] [blame] | 159 | static cl::opt<bool, true> |
Dale Johannesen | 7232464 | 2008-07-31 18:13:12 +0000 | [diff] [blame] | 160 | DisableSwitchTables(cl::Hidden, "disable-jump-tables", |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 161 | cl::desc("Do not generate jump tables."), |
| 162 | cl::location(DisableJumpTables), |
| 163 | cl::init(false)); |
Owen Anderson | 95dad83 | 2008-10-07 20:22:28 +0000 | [diff] [blame] | 164 | static cl::opt<bool, true> |
| 165 | EnableStrongPHIElim(cl::Hidden, "strong-phi-elim", |
Bill Wendling | f9abd7e | 2009-03-11 22:30:01 +0000 | [diff] [blame] | 166 | cl::desc("Use strong PHI elimination."), |
| 167 | cl::location(StrongPHIElim), |
| 168 | cl::init(false)); |
Evan Cheng | 4da0c7c | 2011-04-08 21:37:21 +0000 | [diff] [blame] | 169 | static cl::opt<std::string> |
| 170 | TrapFuncName("trap-func", cl::Hidden, |
| 171 | cl::desc("Emit a call to trap function rather than a trap instruction"), |
| 172 | cl::init("")); |
Chris Lattner | 43ac721 | 2010-04-13 00:36:43 +0000 | [diff] [blame] | 173 | static cl::opt<bool> |
| 174 | DataSections("fdata-sections", |
| 175 | cl::desc("Emit data into separate sections"), |
| 176 | cl::init(false)); |
| 177 | static cl::opt<bool> |
| 178 | FunctionSections("ffunction-sections", |
| 179 | cl::desc("Emit functions into separate sections"), |
| 180 | cl::init(false)); |
Brian Gaeke | 323819e | 2004-03-04 19:16:23 +0000 | [diff] [blame] | 181 | //--------------------------------------------------------------------------- |
Chris Lattner | f70e0c2 | 2003-12-28 21:23:38 +0000 | [diff] [blame] | 182 | // TargetMachine Class |
| 183 | // |
Misha Brukman | 167deff | 2004-08-10 23:10:25 +0000 | [diff] [blame] | 184 | |
Evan Cheng | ebdeeab | 2011-07-08 01:53:10 +0000 | [diff] [blame] | 185 | TargetMachine::TargetMachine(const Target &T, |
| 186 | StringRef TT, StringRef CPU, StringRef FS) |
Benjamin Kramer | e236dc6 | 2011-07-20 01:27:58 +0000 | [diff] [blame] | 187 | : TheTarget(T), TargetTriple(TT), TargetCPU(CPU), TargetFS(FS), |
| 188 | CodeGenInfo(0), AsmInfo(0), |
Rafael Espindola | 195a0ce | 2010-11-19 02:26:16 +0000 | [diff] [blame] | 189 | MCRelaxAll(false), |
Rafael Espindola | dd0dfdf | 2011-01-23 18:50:12 +0000 | [diff] [blame] | 190 | MCNoExecStack(false), |
Daniel Dunbar | a7b8c2b | 2011-03-28 22:49:19 +0000 | [diff] [blame] | 191 | MCSaveTempLabels(false), |
Rafael Espindola | f1a5c7e | 2011-04-30 03:44:37 +0000 | [diff] [blame] | 192 | MCUseLoc(true), |
| 193 | MCUseCFI(true) { |
Anton Korobeynikov | 0eebf65 | 2009-06-08 22:53:56 +0000 | [diff] [blame] | 194 | // Typically it will be subtargets that will adjust FloatABIType from Default |
| 195 | // to Soft or Hard. |
| 196 | if (UseSoftFloat) |
| 197 | FloatABIType = FloatABI::Soft; |
| 198 | } |
| 199 | |
Chris Lattner | f70e0c2 | 2003-12-28 21:23:38 +0000 | [diff] [blame] | 200 | TargetMachine::~TargetMachine() { |
Benjamin Kramer | e236dc6 | 2011-07-20 01:27:58 +0000 | [diff] [blame] | 201 | delete CodeGenInfo; |
Jim Laskey | fde1b3b | 2006-09-07 23:39:26 +0000 | [diff] [blame] | 202 | delete AsmInfo; |
Chris Lattner | f70e0c2 | 2003-12-28 21:23:38 +0000 | [diff] [blame] | 203 | } |
| 204 | |
Evan Cheng | 4c1aa86 | 2006-02-22 20:19:42 +0000 | [diff] [blame] | 205 | /// getRelocationModel - Returns the code generation relocation model. The |
| 206 | /// choices are static, PIC, and dynamic-no-pic, and target default. |
Evan Cheng | 4396613 | 2011-07-19 06:37:02 +0000 | [diff] [blame] | 207 | Reloc::Model TargetMachine::getRelocationModel() const { |
| 208 | if (!CodeGenInfo) |
| 209 | return Reloc::Default; |
| 210 | return CodeGenInfo->getRelocationModel(); |
Evan Cheng | 4c1aa86 | 2006-02-22 20:19:42 +0000 | [diff] [blame] | 211 | } |
Evan Cheng | 80235d5 | 2006-05-23 18:18:46 +0000 | [diff] [blame] | 212 | |
Evan Cheng | 152ed05 | 2006-07-06 01:53:36 +0000 | [diff] [blame] | 213 | /// getCodeModel - Returns the code model. The choices are small, kernel, |
| 214 | /// medium, large, and target default. |
Evan Cheng | 34ad6db | 2011-07-20 07:51:56 +0000 | [diff] [blame^] | 215 | CodeModel::Model TargetMachine::getCodeModel() const { |
| 216 | if (!CodeGenInfo) |
| 217 | return CodeModel::Default; |
| 218 | return CodeGenInfo->getCodeModel(); |
Evan Cheng | 152ed05 | 2006-07-06 01:53:36 +0000 | [diff] [blame] | 219 | } |
| 220 | |
Evan Cheng | 42bf74b | 2009-03-25 01:47:28 +0000 | [diff] [blame] | 221 | bool TargetMachine::getAsmVerbosityDefault() { |
| 222 | return AsmVerbosityDefault; |
| 223 | } |
| 224 | |
| 225 | void TargetMachine::setAsmVerbosityDefault(bool V) { |
| 226 | AsmVerbosityDefault = V; |
| 227 | } |
| 228 | |
Chris Lattner | 43ac721 | 2010-04-13 00:36:43 +0000 | [diff] [blame] | 229 | bool TargetMachine::getFunctionSections() { |
| 230 | return FunctionSections; |
| 231 | } |
| 232 | |
| 233 | bool TargetMachine::getDataSections() { |
| 234 | return DataSections; |
| 235 | } |
| 236 | |
| 237 | void TargetMachine::setFunctionSections(bool V) { |
| 238 | FunctionSections = V; |
| 239 | } |
| 240 | |
| 241 | void TargetMachine::setDataSections(bool V) { |
| 242 | DataSections = V; |
| 243 | } |
| 244 | |
Evan Cheng | 80235d5 | 2006-05-23 18:18:46 +0000 | [diff] [blame] | 245 | namespace llvm { |
Evan Cheng | e566763 | 2010-04-21 03:18:23 +0000 | [diff] [blame] | 246 | /// DisableFramePointerElim - This returns true if frame pointer elimination |
| 247 | /// optimization should be disabled for the given machine function. |
| 248 | bool DisableFramePointerElim(const MachineFunction &MF) { |
Bill Wendling | 53f7602 | 2010-05-17 23:09:50 +0000 | [diff] [blame] | 249 | // Check to see if we should eliminate non-leaf frame pointers and then |
| 250 | // check to see if we should eliminate all frame pointers. |
Bill Wendling | 2abc93d | 2010-05-18 21:47:08 +0000 | [diff] [blame] | 251 | if (NoFramePointerElimNonLeaf && !NoFramePointerElim) { |
Evan Cheng | e566763 | 2010-04-21 03:18:23 +0000 | [diff] [blame] | 252 | const MachineFrameInfo *MFI = MF.getFrameInfo(); |
Bill Wendling | 0fc546b | 2010-05-14 21:28:24 +0000 | [diff] [blame] | 253 | return MFI->hasCalls(); |
Evan Cheng | e566763 | 2010-04-21 03:18:23 +0000 | [diff] [blame] | 254 | } |
Bill Wendling | 53f7602 | 2010-05-17 23:09:50 +0000 | [diff] [blame] | 255 | |
| 256 | return NoFramePointerElim; |
Evan Cheng | e566763 | 2010-04-21 03:18:23 +0000 | [diff] [blame] | 257 | } |
| 258 | |
Mon P Wang | bc65ca8 | 2009-03-20 05:06:58 +0000 | [diff] [blame] | 259 | /// LessPreciseFPMAD - This flag return true when -enable-fp-mad option |
| 260 | /// is specified on the command line. When this flag is off(default), the |
| 261 | /// code generator is not allowed to generate mad (multiply add) if the |
| 262 | /// result is "less precise" than doing those operations individually. |
| 263 | bool LessPreciseFPMAD() { return UnsafeFPMath || LessPreciseFPMADOption; } |
| 264 | |
Chris Lattner | aa4f1e1 | 2007-05-03 00:16:07 +0000 | [diff] [blame] | 265 | /// HonorSignDependentRoundingFPMath - Return true if the codegen must assume |
| 266 | /// that the rounding mode of the FPU can change from its default. |
| 267 | bool HonorSignDependentRoundingFPMath() { |
| 268 | return !UnsafeFPMath && HonorSignDependentRoundingFPMathOption; |
| 269 | } |
Evan Cheng | 4da0c7c | 2011-04-08 21:37:21 +0000 | [diff] [blame] | 270 | |
| 271 | /// getTrapFunctionName - If this returns a non-empty string, this means isel |
| 272 | /// should lower Intrinsic::trap to a call to the specified function name |
| 273 | /// instead of an ISD::TRAP node. |
| 274 | StringRef getTrapFunctionName() { |
| 275 | return TrapFuncName; |
| 276 | } |
Reid Spencer | 077b387 | 2006-05-24 19:05:21 +0000 | [diff] [blame] | 277 | } |